1 # $NetBSD: sys.mk,v 1.98 2008/08/04 16:02:25 joerg Exp $
2 # @(#)sys.mk 8.2 (Berkeley) 3/21/94
6 .SUFFIXES
: .a .o .ln .s .S .c .
cc .
cpp .
cxx .C .f .F .r .p .l .y .sh
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}
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"
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
48 COMPILE.c?
= ${CC} ${CFLAGS} ${CPPFLAGS} -c
49 LINK.c?
= ${CC} ${CFLAGS} ${CPPFLAGS} ${LDFLAGS}
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}
65 COMPILE.m?
= ${OBJC} ${OBJCFLAGS} ${CPPFLAGS} -c
66 LINK.m?
= ${OBJC} ${OBJCFLAGS} ${CPPFLAGS} ${LDFLAGS}
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}
87 LEX.l?
= ${LEX} ${LFLAGS}
90 LINTFLAGS?
= -chapbxzFS
100 COMPILE.p?
= ${PC} ${PFLAGS} ${CPPFLAGS} -c
101 LINK.p?
= ${PC} ${PFLAGS} ${CPPFLAGS} ${LDFLAGS}
111 YACC.y?
= ${YACC} ${YFLAGS}
115 ${LINK.c
} -o
${.TARGET
} ${.IMPSRC
} ${LDLIBS}
117 ${COMPILE.c
} ${.IMPSRC
}
119 ${COMPILE.c
} ${.IMPSRC
}
120 ${AR} ${ARFLAGS} ${.TARGET
} ${.PREFIX
}.o
123 ${LINT} ${LINTFLAGS} \
124 ${CPPFLAGS
:C
/-([IDU
])[ ]*/-\
1/Wg
:M-
[IDU
]*} \
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
139 ${LINK.f
} -o
${.TARGET
} ${.IMPSRC
} ${LDLIBS}
141 ${COMPILE.f
} ${.IMPSRC
}
143 ${COMPILE.f
} ${.IMPSRC
}
144 ${AR} ${ARFLAGS} ${.TARGET
} ${.PREFIX
}.o
148 ${LINK.F
} -o
${.TARGET
} ${.IMPSRC
} ${LDLIBS}
150 ${COMPILE.F
} ${.IMPSRC
}
152 ${COMPILE.F
} ${.IMPSRC
}
153 ${AR} ${ARFLAGS} ${.TARGET
} ${.PREFIX
}.o
157 ${LINK.r
} -o
${.TARGET
} ${.IMPSRC
} ${LDLIBS}
159 ${COMPILE.r
} ${.IMPSRC
}
161 ${COMPILE.r
} ${.IMPSRC
}
162 ${AR} ${ARFLAGS} ${.TARGET
} ${.PREFIX
}.o
167 ${LINK.p
} -o
${.TARGET
} ${.IMPSRC
} ${LDLIBS}
169 ${COMPILE.p
} ${.IMPSRC
}
171 ${COMPILE.p
} ${.IMPSRC
}
172 ${AR} ${ARFLAGS} ${.TARGET
} ${.PREFIX
}.o
177 ${LINK.s
} -o
${.TARGET
} ${.IMPSRC
} ${LDLIBS}
179 ${COMPILE.s
} ${.IMPSRC
}
181 ${COMPILE.s
} ${.IMPSRC
}
182 ${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
196 ${LINK.c
} -o
${.TARGET
} lex.yy.c
${LDLIBS} -ll
200 mv
lex.yy.c
${.TARGET
}
203 ${COMPILE.c
} -o
${.TARGET
} lex.yy.c
209 ${LINK.c
} -o
${.TARGET
} y.tab.c
${LDLIBS}
213 mv y.tab.c
${.TARGET
}
216 ${COMPILE.c
} -o
${.TARGET
} y.tab.c
222 cp
${.IMPSRC
} ${.TARGET
}