blob: 75d83c2bf442c43b0b7149f2f21e5df0f88cd4cd (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
|
# $Id: SunOS.mk,v 1.7 2016/03/22 20:45:15 sjg Exp $
.if ${.PARSEFILE} == "sys.mk"
.include <host-target.mk>
OS?= SunOS.${HOST_OSMAJOR}
unix?= We run ${OS}.
.endif
.if ${HOST_OSMAJOR} > 4
ROOT_GROUP= root
SHLIB_FULLVERSION = ${SHLIB_MAJOR}
# suppress the dependency
LIBCRT0= /dev/null
.ifndef CC
# the PATH below may find an ancient gcc
CC := ${gcc:L:${M_whence}}
.export CC
.endif
# the stuff in /usr/xpg4/bin is usually more sane.
PATH=/usr/xpg4/bin:/usr/sbin:/usr/bin:/usr/ucb:/usr/sfw/bin:/opt/gnu/bin:/usr/ccs/bin:/usr/local/bin
.export PATH
DSHLIBEXT = .so
HOST_LIBDIRS = /usr/lib /lib /usr/sfw/lib
# no -X
LD_X=
LD_x=
RANLIB= :
CPP= /usr/ccs/lib/cpp
.else
ROOT_GROUP= wheel
RANLIB= ranlib
CPP= cpp
.endif
# the rest is common
.SUFFIXES: .out .a .ln .o .c ${CXX_SUFFIXES} .F .f .r .y .l .s .S .cl .p .h .sh .m4
.LIBS: .a
AR= ar
ARFLAGS= rl
AS= as
AS_STDIN= -
AFLAGS=
COMPILE.s= ${AS} ${AFLAGS}
LINK.s= ${CC} ${AFLAGS} ${LDFLAGS}
COMPILE.S= ${CC} ${AFLAGS} ${CPPFLAGS} -c
LINK.S= ${CC} ${AFLAGS} ${CPPFLAGS} ${LDFLAGS}
.if exists(/opt/gnu/bin/gcc) || exists(/usr/local/bin/gcc)
CC ?= gcc -pipe
DBG= -O -g
STATIC= -static
.else
CC ?= cc
DBG= -g
STATIC= -Bstatic
.endif
CFLAGS= ${DBG}
COMPILE.c= ${CC} ${CFLAGS} ${CPPFLAGS} -c
LINK.c= ${CC} ${CFLAGS} ${CPPFLAGS} ${LDFLAGS}
CXX= g++
CXXFLAGS= ${CFLAGS}
COMPILE.cc= ${CXX} ${CXXFLAGS} ${CPPFLAGS} -c
LINK.cc= ${CXX} ${CXXFLAGS} ${CPPFLAGS} ${LDFLAGS}
.if defined(DESTDIR)
CPPFLAGS+= -nostdinc -idirafter ${DESTDIR}/usr/include
.endif
MK_DEP= mkdeps.sh -N
FC= f77
FFLAGS= -O
RFLAGS=
COMPILE.f= ${FC} ${FFLAGS} -c
LINK.f= ${FC} ${FFLAGS} ${LDFLAGS}
COMPILE.F= ${FC} ${FFLAGS} ${CPPFLAGS} -c
LINK.F= ${FC} ${FFLAGS} ${CPPFLAGS} ${LDFLAGS}
COMPILE.r= ${FC} ${FFLAGS} ${RFLAGS} -c
LINK.r= ${FC} ${FFLAGS} ${RFLAGS} ${LDFLAGS}
LEX= lex
LFLAGS=
LEX.l= ${LEX} ${LFLAGS}
LD= ld
LDFLAGS=
LINT= lint
LINTFLAGS= -chapbx
MAKE= bmake
PC= pc
PFLAGS=
COMPILE.p= ${PC} ${PFLAGS} ${CPPFLAGS} -c
LINK.p= ${PC} ${PFLAGS} ${CPPFLAGS} ${LDFLAGS}
SHELL= sh
.if exists(/usr/local/bin/bison) || exists(/opt/gnu/bin/bison)
YACC= bison -y
.else
YACC= yacc
.endif
YFLAGS= -d
YACC.y= ${YACC} ${YFLAGS}
# C
.c:
${LINK.c} -o ${.TARGET} ${.IMPSRC} ${LDLIBS}
.c.o:
${COMPILE.c} ${.IMPSRC}
.c.a:
${COMPILE.c} ${.IMPSRC}
${AR} ${ARFLAGS} $@ $*.o
rm -f $*.o
# C++
${CXX_SUFFIXES}:
${LINK.cc} -o ${.TARGET} ${.IMPSRC} ${LDLIBS}
${CXX_SUFFIXES:%=%.o}:
${COMPILE.cc} ${.IMPSRC}
${CXX_SUFFIXES:%=%.a}:
${COMPILE.cc} ${.IMPSRC}
${AR} ${ARFLAGS} $@ $*.o
rm -f $*.o
# Fortran/Ratfor
.f:
${LINK.f} -o ${.TARGET} ${.IMPSRC} ${LDLIBS}
.f.o:
${COMPILE.f} ${.IMPSRC}
.f.a:
${COMPILE.f} ${.IMPSRC}
${AR} ${ARFLAGS} $@ $*.o
rm -f $*.o
.F:
${LINK.F} -o ${.TARGET} ${.IMPSRC} ${LDLIBS}
.F.o:
${COMPILE.F} ${.IMPSRC}
.F.a:
${COMPILE.F} ${.IMPSRC}
${AR} ${ARFLAGS} $@ $*.o
rm -f $*.o
.r:
${LINK.r} -o ${.TARGET} ${.IMPSRC} ${LDLIBS}
.r.o:
${COMPILE.r} ${.IMPSRC}
.r.a:
${COMPILE.r} ${.IMPSRC}
${AR} ${ARFLAGS} $@ $*.o
rm -f $*.o
# Pascal
.p:
${LINK.p} -o ${.TARGET} ${.IMPSRC} ${LDLIBS}
.p.o:
${COMPILE.p} ${.IMPSRC}
.p.a:
${COMPILE.p} ${.IMPSRC}
${AR} ${ARFLAGS} $@ $*.o
rm -f $*.o
# Assembly
.s:
${LINK.s} -o ${.TARGET} ${.IMPSRC} ${LDLIBS}
.s.o:
${COMPILE.s} ${.IMPSRC}
.s.a:
${COMPILE.s} ${.IMPSRC}
${AR} ${ARFLAGS} $@ $*.o
rm -f $*.o
.S:
${LINK.S} -o ${.TARGET} ${.IMPSRC} ${LDLIBS}
.S.o:
${COMPILE.S} ${.IMPSRC}
.S.a:
${COMPILE.S} ${.IMPSRC}
${AR} ${ARFLAGS} $@ $*.o
rm -f $*.o
# Lex
.l:
${LEX.l} ${.IMPSRC}
${LINK.c} -o ${.TARGET} lex.yy.c ${LDLIBS} -ll
rm -f lex.yy.c
.l.c:
${LEX.l} ${.IMPSRC}
mv lex.yy.c ${.TARGET}
.l.o:
${LEX.l} ${.IMPSRC}
${COMPILE.c} -o ${.TARGET} lex.yy.c
rm -f lex.yy.c
# Yacc
.y:
${YACC.y} ${.IMPSRC}
${LINK.c} -o ${.TARGET} y.tab.c ${LDLIBS}
rm -f y.tab.c
.y.c:
${YACC.y} ${.IMPSRC}
mv y.tab.c ${.TARGET}
.y.o:
${YACC.y} ${.IMPSRC}
${COMPILE.c} -o ${.TARGET} y.tab.c
rm -f y.tab.c
# Shell
.sh:
rm -f ${.TARGET}
cp ${.IMPSRC} ${.TARGET}
|