No empty .Rs/.Re
[netbsd-mini2440.git] / share / mk / sys.mk
blobe1347294d65cb692100d888f5f60f8f8f7471875
1 # $NetBSD: sys.mk,v 1.98 2008/08/04 16:02:25 joerg Exp $
2 # @(#)sys.mk 8.2 (Berkeley) 3/21/94
4 unix?= We run NetBSD.
6 .SUFFIXES: .a .o .ln .s .S .c .cc .cpp .cxx .C .f .F .r .p .l .y .sh
8 .LIBS: .a
10 AR?= ar
11 ARFLAGS?= rl
12 RANLIB?= ranlib
14 AS?= as
15 AFLAGS?=
16 COMPILE.s?= ${CC} ${AFLAGS} -c
17 LINK.s?= ${CC} ${AFLAGS} ${LDFLAGS}
18 COMPILE.S?= ${CC} ${AFLAGS} ${CPPFLAGS} -c -traditional-cpp
19 LINK.S?= ${CC} ${AFLAGS} ${CPPFLAGS} ${LDFLAGS}
21 CC?= cc
22 .if ${MACHINE_ARCH} == "alpha" || \
23 ${MACHINE_ARCH} == "arm" || \
24 ${MACHINE_ARCH} == "x86_64" || \
25 ${MACHINE_ARCH} == "armeb" || \
26 ${MACHINE_ARCH} == "hppa" || \
27 ${MACHINE_ARCH} == "i386" || \
28 ${MACHINE_ARCH} == "m68k" || \
29 ${MACHINE_ARCH} == "mipsel" || ${MACHINE_ARCH} == "mipseb" || \
30 ${MACHINE_ARCH} == "mips64el" || ${MACHINE_ARCH} == "mips64eb" || \
31 ${MACHINE_ARCH} == "powerpc" || \
32 ${MACHINE_ARCH} == "sparc" || \
33 ${MACHINE_ARCH} == "sparc64"
34 DBG?= -O2
35 .elif ${MACHINE_ARCH} == "sh3el" || ${MACHINE_ARCH} == "sh3eb"
36 # -O2 is too -falign-* zealous for low-memory sh3 machines
37 DBG?= -Os -freorder-blocks
38 .elif ${MACHINE_ARCH} == "vax"
39 DBG?= -O1 -fgcse -fstrength-reduce -fgcse-after-reload
40 .elif ${MACHINE_ARCH} == "m68000"
41 # see src/doc/HACKS for details
42 DBG?= -O1
43 .else
44 DBG?= -O
45 .endif
46 CFLAGS?= ${DBG}
47 LDFLAGS?=
48 COMPILE.c?= ${CC} ${CFLAGS} ${CPPFLAGS} -c
49 LINK.c?= ${CC} ${CFLAGS} ${CPPFLAGS} ${LDFLAGS}
51 CXX?= c++
52 CXXFLAGS?= ${CFLAGS:N-Wno-traditional:N-Wstrict-prototypes:N-Wmissing-prototypes:N-Wno-pointer-sign:N-ffreestanding:N-std=gnu99}
54 __ALLSRC1= ${empty(DESTDIR):?${.ALLSRC}:${.ALLSRC:S|^${DESTDIR}|^destdir|}}
55 __ALLSRC2= ${empty(MAKEOBJDIR):?${__ALLSRC1}:${__ALLSRC1:S|^${MAKEOBJDIR}|^obj|}}
56 __ALLSRC3= ${empty(NETBSDSRCDIR):?${__ALLSRC2}:${__ALLSRC2:S|^${NETBSDSRCDIR}|^src|}}
58 _CXXSEED?= ${BUILDSEED:D-frandom-seed=${BUILDSEED:Q}/${__ALLSRC3:O:Q}/${.TARGET:Q}}
60 COMPILE.cc?= ${CXX} ${_CXXSEED} ${CXXFLAGS} ${CPPFLAGS} -c
61 LINK.cc?= ${CXX} ${CXXFLAGS} ${CPPFLAGS} ${LDFLAGS}
63 OBJC?= ${CC}
64 OBJCFLAGS?= ${CFLAGS}
65 COMPILE.m?= ${OBJC} ${OBJCFLAGS} ${CPPFLAGS} -c
66 LINK.m?= ${OBJC} ${OBJCFLAGS} ${CPPFLAGS} ${LDFLAGS}
68 CPP?= cpp
69 CPPFLAGS?=
71 FC?= f77
72 FFLAGS?= -O
73 RFLAGS?=
74 COMPILE.f?= ${FC} ${FFLAGS} -c
75 LINK.f?= ${FC} ${FFLAGS} ${LDFLAGS}
76 COMPILE.F?= ${FC} ${FFLAGS} ${CPPFLAGS} -c
77 LINK.F?= ${FC} ${FFLAGS} ${CPPFLAGS} ${LDFLAGS}
78 COMPILE.r?= ${FC} ${FFLAGS} ${RFLAGS} -c
79 LINK.r?= ${FC} ${FFLAGS} ${RFLAGS} ${LDFLAGS}
81 INSTALL?= install
83 LD?= ld
85 LEX?= lex
86 LFLAGS?=
87 LEX.l?= ${LEX} ${LFLAGS}
89 LINT?= lint
90 LINTFLAGS?= -chapbxzFS
92 LORDER?= lorder
94 MAKE?= make
96 NM?= nm
98 PC?= pc
99 PFLAGS?=
100 COMPILE.p?= ${PC} ${PFLAGS} ${CPPFLAGS} -c
101 LINK.p?= ${PC} ${PFLAGS} ${CPPFLAGS} ${LDFLAGS}
103 SHELL?= sh
105 SIZE?= size
107 TSORT?= tsort -q
109 YACC?= yacc
110 YFLAGS?=
111 YACC.y?= ${YACC} ${YFLAGS}
115 ${LINK.c} -o ${.TARGET} ${.IMPSRC} ${LDLIBS}
116 .c.o:
117 ${COMPILE.c} ${.IMPSRC}
118 .c.a:
119 ${COMPILE.c} ${.IMPSRC}
120 ${AR} ${ARFLAGS} ${.TARGET} ${.PREFIX}.o
121 rm -f ${.PREFIX}.o
122 .c.ln:
123 ${LINT} ${LINTFLAGS} \
124 ${CPPFLAGS:C/-([IDU])[ ]*/-\1/Wg:M-[IDU]*} \
125 -i ${.IMPSRC}
127 # C++
128 .cc .cpp .cxx .C:
129 ${LINK.cc} -o ${.TARGET} ${.IMPSRC} ${LDLIBS}
130 .cc.o .cpp.o .cxx.o .C.o:
131 ${COMPILE.cc} ${.IMPSRC}
132 .cc.a .cpp.a .cxx.a .C.a:
133 ${COMPILE.cc} ${.IMPSRC}
134 ${AR} ${ARFLAGS} ${.TARGET} ${.PREFIX}.o
135 rm -f ${.PREFIX}.o
137 # Fortran/Ratfor
139 ${LINK.f} -o ${.TARGET} ${.IMPSRC} ${LDLIBS}
140 .f.o:
141 ${COMPILE.f} ${.IMPSRC}
142 .f.a:
143 ${COMPILE.f} ${.IMPSRC}
144 ${AR} ${ARFLAGS} ${.TARGET} ${.PREFIX}.o
145 rm -f ${.PREFIX}.o
148 ${LINK.F} -o ${.TARGET} ${.IMPSRC} ${LDLIBS}
149 .F.o:
150 ${COMPILE.F} ${.IMPSRC}
151 .F.a:
152 ${COMPILE.F} ${.IMPSRC}
153 ${AR} ${ARFLAGS} ${.TARGET} ${.PREFIX}.o
154 rm -f ${.PREFIX}.o
157 ${LINK.r} -o ${.TARGET} ${.IMPSRC} ${LDLIBS}
158 .r.o:
159 ${COMPILE.r} ${.IMPSRC}
160 .r.a:
161 ${COMPILE.r} ${.IMPSRC}
162 ${AR} ${ARFLAGS} ${.TARGET} ${.PREFIX}.o
163 rm -f ${.PREFIX}.o
165 # Pascal
167 ${LINK.p} -o ${.TARGET} ${.IMPSRC} ${LDLIBS}
168 .p.o:
169 ${COMPILE.p} ${.IMPSRC}
170 .p.a:
171 ${COMPILE.p} ${.IMPSRC}
172 ${AR} ${ARFLAGS} ${.TARGET} ${.PREFIX}.o
173 rm -f ${.PREFIX}.o
175 # Assembly
177 ${LINK.s} -o ${.TARGET} ${.IMPSRC} ${LDLIBS}
178 .s.o:
179 ${COMPILE.s} ${.IMPSRC}
180 .s.a:
181 ${COMPILE.s} ${.IMPSRC}
182 ${AR} ${ARFLAGS} ${.TARGET} ${.PREFIX}.o
183 rm -f ${.PREFIX}.o
185 ${LINK.S} -o ${.TARGET} ${.IMPSRC} ${LDLIBS}
186 .S.o:
187 ${COMPILE.S} ${.IMPSRC}
188 .S.a:
189 ${COMPILE.S} ${.IMPSRC}
190 ${AR} ${ARFLAGS} ${.TARGET} ${.PREFIX}.o
191 rm -f ${.PREFIX}.o
193 # Lex
195 ${LEX.l} ${.IMPSRC}
196 ${LINK.c} -o ${.TARGET} lex.yy.c ${LDLIBS} -ll
197 rm -f lex.yy.c
198 .l.c:
199 ${LEX.l} ${.IMPSRC}
200 mv lex.yy.c ${.TARGET}
201 .l.o:
202 ${LEX.l} ${.IMPSRC}
203 ${COMPILE.c} -o ${.TARGET} lex.yy.c
204 rm -f lex.yy.c
206 # Yacc
208 ${YACC.y} ${.IMPSRC}
209 ${LINK.c} -o ${.TARGET} y.tab.c ${LDLIBS}
210 rm -f y.tab.c
211 .y.c:
212 ${YACC.y} ${.IMPSRC}
213 mv y.tab.c ${.TARGET}
214 .y.o:
215 ${YACC.y} ${.IMPSRC}
216 ${COMPILE.c} -o ${.TARGET} y.tab.c
217 rm -f y.tab.c
219 # Shell
220 .sh:
221 rm -f ${.TARGET}
222 cp ${.IMPSRC} ${.TARGET}
223 chmod a+x ${.TARGET}