1 # $NetBSD: sys.mk,v 1.99 2008/09/07 15:54:52 kent Exp $
2 # @(#)sys.mk 8.2 (Berkeley) 3/21/94
6 # This variable should be used to differentiate Minix builds in Makefiles.
9 .SUFFIXES
: .a .o .ln .s .S .c .
cc .
cpp .
cxx .C .f .F .r .p .l .y .sh
13 ### MINIX: see at bottom
20 COMPILE.s?
= ${CC} ${AFLAGS} -c
21 LINK.s?
= ${CC} ${AFLAGS} ${LDFLAGS}
22 #COMPILE.S?= ${CC} ${AFLAGS} ${CPPFLAGS} -c -traditional-cpp
23 COMPILE.S?
= ${CC} ${AFLAGS} ${CPPFLAGS} -c
24 LINK.S?
= ${CC} ${AFLAGS} ${CPPFLAGS} ${LDFLAGS}
27 .if
${MACHINE_ARCH} == "alpha" || \
28 ${MACHINE_ARCH} == "arm" || \
29 ${MACHINE_ARCH} == "x86_64" || \
30 ${MACHINE_ARCH} == "armeb" || \
31 ${MACHINE_ARCH} == "hppa" || \
32 ${MACHINE_ARCH} == "i386" || \
33 ${MACHINE_ARCH} == "m68k" || \
34 ${MACHINE_ARCH} == "mipsel" ||
${MACHINE_ARCH} == "mipseb" || \
35 ${MACHINE_ARCH} == "mips64el" ||
${MACHINE_ARCH} == "mips64eb" || \
36 ${MACHINE_ARCH} == "powerpc" || \
37 ${MACHINE_ARCH} == "sparc" || \
38 ${MACHINE_ARCH} == "sparc64"
40 #MINIX: use -O for now
42 .elif
${MACHINE_ARCH} == "sh3el" ||
${MACHINE_ARCH} == "sh3eb"
43 # -O2 is too -falign-* zealous for low-memory sh3 machines
44 DBG?
= -Os
-freorder-blocks
45 .elif
${MACHINE_ARCH} == "vax"
46 DBG?
= -O1
-fgcse
-fstrength-reduce
-fgcse-after-reload
47 .elif
${MACHINE_ARCH} == "m68000"
48 # see src/doc/HACKS for details
56 COMPILE.c?
= ${CC} ${CFLAGS} ${CPPFLAGS} -c
57 LINK.c?
= ${CC} ${CFLAGS} ${CPPFLAGS} ${LDFLAGS}
60 CXXFLAGS?
= ${CFLAGS
:N-Wno-traditional
:N-Wstrict-prototypes
:N-Wmissing-prototypes
:N-Wno-pointer-sign
:N-ffreestanding
:N-std
=gnu99
}
62 __ALLSRC1
= ${empty
(DESTDIR
):?
${.ALLSRC
}:${.ALLSRC
:S|^
${DESTDIR}|^destdir|
}}
63 __ALLSRC2
= ${empty
(MAKEOBJDIR
):?
${__ALLSRC1}:${__ALLSRC1
:S|^
${MAKEOBJDIR}|^obj|
}}
64 __ALLSRC3
= ${empty
(NETBSDSRCDIR
):?
${__ALLSRC2}:${__ALLSRC2
:S|^
${NETBSDSRCDIR}|^src|
}}
66 _CXXSEED?
= ${BUILDSEED
:D-frandom-seed
=${BUILDSEED
:Q
}/${__ALLSRC3
:O
:Q
}/${.TARGET
:Q
}}
68 COMPILE.
cc?
= ${CXX} ${_CXXSEED} ${CXXFLAGS} ${CPPFLAGS} -c
69 LINK.
cc?
= ${CXX} ${CXXFLAGS} ${CPPFLAGS} ${LDFLAGS}
73 COMPILE.m?
= ${OBJC} ${OBJCFLAGS} ${CPPFLAGS} -c
74 LINK.m?
= ${OBJC} ${OBJCFLAGS} ${CPPFLAGS} ${LDFLAGS}
82 COMPILE.f?
= ${FC} ${FFLAGS} -c
83 LINK.f?
= ${FC} ${FFLAGS} ${LDFLAGS}
84 COMPILE.F?
= ${FC} ${FFLAGS} ${CPPFLAGS} -c
85 LINK.F?
= ${FC} ${FFLAGS} ${CPPFLAGS} ${LDFLAGS}
86 COMPILE.r?
= ${FC} ${FFLAGS} ${RFLAGS} -c
87 LINK.r?
= ${FC} ${FFLAGS} ${RFLAGS} ${LDFLAGS}
95 LEX.l?
= ${LEX} ${LFLAGS}
98 LINTFLAGS?
= -chapbxzFS
108 COMPILE.p?
= ${PC} ${PFLAGS} ${CPPFLAGS} -c
109 LINK.p?
= ${PC} ${PFLAGS} ${CPPFLAGS} ${LDFLAGS}
119 YACC.y?
= ${YACC} ${YFLAGS}
123 ${LINK.c
} -o
${.TARGET
} ${.IMPSRC
} ${LDLIBS}
125 ${COMPILE.c
} ${.IMPSRC
}
127 ${COMPILE.c
} ${.IMPSRC
}
128 ${AR} ${ARFLAGS} ${.TARGET
} ${.PREFIX
}.o
131 ${LINT} ${LINTFLAGS} \
132 ${CPPFLAGS
:C
/-([IDU
])[ ]*/-\
1/Wg
:M-
[IDU
]*} \
137 ${LINK.
cc} -o
${.TARGET
} ${.IMPSRC
} ${LDLIBS}
138 .
cc.o .
cpp.o .
cxx.o .C.o
:
139 ${COMPILE.
cc} ${.IMPSRC
}
140 .
cc.a .
cpp.a .
cxx.a .C.a
:
141 ${COMPILE.
cc} ${.IMPSRC
}
142 ${AR} ${ARFLAGS} ${.TARGET
} ${.PREFIX
}.o
147 ${LINK.f
} -o
${.TARGET
} ${.IMPSRC
} ${LDLIBS}
149 ${COMPILE.f
} ${.IMPSRC
}
151 ${COMPILE.f
} ${.IMPSRC
}
152 ${AR} ${ARFLAGS} ${.TARGET
} ${.PREFIX
}.o
156 ${LINK.F
} -o
${.TARGET
} ${.IMPSRC
} ${LDLIBS}
158 ${COMPILE.F
} ${.IMPSRC
}
160 ${COMPILE.F
} ${.IMPSRC
}
161 ${AR} ${ARFLAGS} ${.TARGET
} ${.PREFIX
}.o
165 ${LINK.r
} -o
${.TARGET
} ${.IMPSRC
} ${LDLIBS}
167 ${COMPILE.r
} ${.IMPSRC
}
169 ${COMPILE.r
} ${.IMPSRC
}
170 ${AR} ${ARFLAGS} ${.TARGET
} ${.PREFIX
}.o
175 ${LINK.p
} -o
${.TARGET
} ${.IMPSRC
} ${LDLIBS}
177 ${COMPILE.p
} ${.IMPSRC
}
179 ${COMPILE.p
} ${.IMPSRC
}
180 ${AR} ${ARFLAGS} ${.TARGET
} ${.PREFIX
}.o
185 ${LINK.s
} -o
${.TARGET
} ${.IMPSRC
} ${LDLIBS}
187 ${COMPILE.s
} ${.IMPSRC
}
189 ${COMPILE.s
} ${.IMPSRC
}
190 ${AR} ${ARFLAGS} ${.TARGET
} ${.PREFIX
}.o
193 ${LINK.S
} -o
${.TARGET
} ${.IMPSRC
} ${LDLIBS}
195 ${COMPILE.S
} ${.IMPSRC
}
197 ${COMPILE.S
} ${.IMPSRC
}
198 ${AR} ${ARFLAGS} ${.TARGET
} ${.PREFIX
}.o
204 ${LINK.c
} -o
${.TARGET
} lex.yy.c
${LDLIBS} -ll
208 mv
lex.yy.c
${.TARGET
}
211 ${COMPILE.c
} -o
${.TARGET
} lex.yy.c
217 ${LINK.c
} -o
${.TARGET
} y.tab.c
${LDLIBS}
221 mv y.tab.c
${.TARGET
}
224 ${COMPILE.c
} -o
${.TARGET
} y.tab.c
230 # cp ${.IMPSRC} ${.TARGET}
231 # chmod a+x ${.TARGET}
239 .if defined
(MKSMALL
) && ${MKSMALL} == "yes"