1 # $NetBSD: sys.mk,v 1.110 2012/10/06 20:54:58 christos Exp $
2 # @(#)sys.mk 8.2 (Berkeley) 3/21/94
4 # This variable should be used to differentiate Minix builds in Makefiles.
8 .if
${MKSMALL
:U
} == "yes"
19 .
endif # defined(__MINIX)
22 .SUFFIXES
: .a .o .ln .s .S .c .
cc .
cpp .
cxx .C .f .F .r .p .l .y .sh
32 COMPILE.s?
= ${CC} ${AFLAGS} ${AFLAGS.
${<:T
}} -c
33 LINK.s?
= ${CC} ${AFLAGS} ${AFLAGS.
${<:T
}} ${LDFLAGS}
34 _ASM_TRADITIONAL_CPP
= -x assembler-with-cpp
35 COMPILE.S?
= ${CC} ${AFLAGS} ${AFLAGS.
${<:T
}} ${CPPFLAGS} ${_ASM_TRADITIONAL_CPP} -c
36 LINK.S?
= ${CC} ${AFLAGS} ${AFLAGS.
${<:T
}} ${CPPFLAGS} ${LDFLAGS}
39 .if
${MACHINE_ARCH} == "sh3el" ||
${MACHINE_ARCH} == "sh3eb"
40 # -O2 is too -falign-* zealous for low-memory sh3 machines
41 DBG?
= -Os
-freorder-blocks
42 .elif
${MACHINE_ARCH} == "m68k" ||
${MACHINE_ARCH} == "m68000"
43 # see src/doc/HACKS for details
45 .elif
${MACHINE_ARCH} == "vax"
46 DBG?
= -O1
-fgcse
-fstrength-reduce
-fgcse-after-reload
52 COMPILE.c?
= ${CC} ${CFLAGS} ${CPPFLAGS} -c
53 LINK.c?
= ${CC} ${CFLAGS} ${CPPFLAGS} ${LDFLAGS}
55 # C Type Format data is required for DTrace
56 # XXX TBD VERSION is not defined
57 CTFFLAGS ?
= -L VERSION
58 CTFMFLAGS ?
= -t
-L VERSION
60 .if defined
(MKDTRACE
) && ${MKDTRACE} != "no"
61 CTFCONVERT ?
= ${TOOL_CTFCONVERT}
62 CTFMERGE ?
= ${TOOL_CTFMERGE}
63 .if defined
(CFLAGS
) && (${CFLAGS
:M-g
} != "")
72 CXXFLAGS?
= ${CFLAGS
:N-Wno-traditional
:N-Wstrict-prototypes
:N-Wmissing-prototypes
:N-Wno-pointer-sign
:N-ffreestanding
:N-std
=gnu99
:N-Wold-style-definition
:N-Wno-format-zero-length
}
74 __ALLSRC1
= ${empty
(DESTDIR
):?
${.ALLSRC
}:${.ALLSRC
:S|^
${DESTDIR}|^destdir|
}}
75 __ALLSRC2
= ${empty
(MAKEOBJDIR
):?
${__ALLSRC1}:${__ALLSRC1
:S|^
${MAKEOBJDIR}|^obj|
}}
76 __ALLSRC3
= ${empty
(NETBSDSRCDIR
):?
${__ALLSRC2}:${__ALLSRC2
:S|^
${NETBSDSRCDIR}|^src|
}}
77 __BUILDSEED
= ${BUILDSEED}/${__ALLSRC3
:O
}/${.TARGET
}
78 _CXXSEED?
= ${BUILDSEED
:D-frandom-seed
=${__BUILDSEED
:hash
}}
80 COMPILE.
cc?
= ${CXX} ${_CXXSEED} ${CXXFLAGS} ${CPPFLAGS} -c
81 LINK.
cc?
= ${CXX} ${CXXFLAGS} ${CPPFLAGS} ${LDFLAGS}
85 COMPILE.m?
= ${OBJC} ${OBJCFLAGS} ${CPPFLAGS} -c
86 LINK.m?
= ${OBJC} ${OBJCFLAGS} ${CPPFLAGS} ${LDFLAGS}
94 COMPILE.f?
= ${FC} ${FFLAGS} -c
95 LINK.f?
= ${FC} ${FFLAGS} ${LDFLAGS}
96 COMPILE.F?
= ${FC} ${FFLAGS} ${CPPFLAGS} -c
97 LINK.F?
= ${FC} ${FFLAGS} ${CPPFLAGS} ${LDFLAGS}
98 COMPILE.r?
= ${FC} ${FFLAGS} ${RFLAGS} -c
99 LINK.r?
= ${FC} ${FFLAGS} ${RFLAGS} ${LDFLAGS}
107 LEX.l?
= ${LEX} ${LFLAGS}
110 LINTFLAGS?
= -chapbxzFS
120 COMPILE.p?
= ${PC} ${PFLAGS} ${CPPFLAGS} -c
121 LINK.p?
= ${PC} ${PFLAGS} ${CPPFLAGS} ${LDFLAGS}
131 YACC.y?
= ${YACC} ${YFLAGS}
135 ${LINK.c
} -o
${.TARGET
} ${.IMPSRC
} ${LDLIBS}
136 .if defined
(CTFCONVERT
)
137 ${CTFCONVERT} ${CTFFLAGS} ${.TARGET
}
140 ${COMPILE.c
} ${.IMPSRC
}
141 .if defined
(CTFCONVERT
)
142 ${CTFCONVERT} ${CTFFLAGS} ${.TARGET
}
145 ${COMPILE.c
} ${.IMPSRC
}
146 ${AR} ${ARFLAGS} ${.TARGET
} ${.PREFIX
}.o
149 ${LINT} ${LINTFLAGS} \
150 ${CPPFLAGS
:C
/-([IDU
])[ ]*/-\
1/Wg
:M-
[IDU
]*} \
155 ${LINK.
cc} -o
${.TARGET
} ${.IMPSRC
} ${LDLIBS}
156 .
cc.o .
cpp.o .
cxx.o .C.o
:
157 ${COMPILE.
cc} ${.IMPSRC
}
158 .
cc.a .
cpp.a .
cxx.a .C.a
:
159 ${COMPILE.
cc} ${.IMPSRC
}
160 ${AR} ${ARFLAGS} ${.TARGET
} ${.PREFIX
}.o
165 ${LINK.f
} -o
${.TARGET
} ${.IMPSRC
} ${LDLIBS}
167 ${COMPILE.f
} ${.IMPSRC
}
169 ${COMPILE.f
} ${.IMPSRC
}
170 ${AR} ${ARFLAGS} ${.TARGET
} ${.PREFIX
}.o
174 ${LINK.F
} -o
${.TARGET
} ${.IMPSRC
} ${LDLIBS}
175 .if defined
(CTFCONVERT
)
176 ${CTFCONVERT} ${CTFFLAGS} ${.TARGET
}
179 ${COMPILE.F
} ${.IMPSRC
}
180 .if defined
(CTFCONVERT
)
181 ${CTFCONVERT} ${CTFFLAGS} ${.TARGET
}
184 ${COMPILE.F
} ${.IMPSRC
}
185 ${AR} ${ARFLAGS} ${.TARGET
} ${.PREFIX
}.o
189 ${LINK.r
} -o
${.TARGET
} ${.IMPSRC
} ${LDLIBS}
191 ${COMPILE.r
} ${.IMPSRC
}
193 ${COMPILE.r
} ${.IMPSRC
}
194 ${AR} ${ARFLAGS} ${.TARGET
} ${.PREFIX
}.o
199 ${LINK.p
} -o
${.TARGET
} ${.IMPSRC
} ${LDLIBS}
200 .if defined
(CTFCONVERT
)
201 ${CTFCONVERT} ${CTFFLAGS} ${.TARGET
}
204 ${COMPILE.p
} ${.IMPSRC
}
205 .if defined
(CTFCONVERT
)
206 ${CTFCONVERT} ${CTFFLAGS} ${.TARGET
}
209 ${COMPILE.p
} ${.IMPSRC
}
210 ${AR} ${ARFLAGS} ${.TARGET
} ${.PREFIX
}.o
215 ${LINK.s
} -o
${.TARGET
} ${.IMPSRC
} ${LDLIBS}
216 .if defined
(CTFCONVERT
)
217 ${CTFCONVERT} ${CTFFLAGS} ${.TARGET
}
220 ${COMPILE.s
} ${.IMPSRC
}
221 .if defined
(CTFCONVERT
)
222 ${CTFCONVERT} ${CTFFLAGS} ${.TARGET
}
225 ${COMPILE.s
} ${.IMPSRC
}
226 ${AR} ${ARFLAGS} ${.TARGET
} ${.PREFIX
}.o
229 ${LINK.S
} -o
${.TARGET
} ${.IMPSRC
} ${LDLIBS}
230 .if defined
(CTFCONVERT
)
231 ${CTFCONVERT} ${CTFFLAGS} ${.TARGET
}
234 ${COMPILE.S
} ${.IMPSRC
}
235 .if defined
(CTFCONVERT
)
236 ${CTFCONVERT} ${CTFFLAGS} ${.TARGET
}
239 ${COMPILE.S
} ${.IMPSRC
}
240 ${AR} ${ARFLAGS} ${.TARGET
} ${.PREFIX
}.o
246 ${LINK.c
} -o
${.TARGET
} lex.yy.c
${LDLIBS} -ll
250 mv
lex.yy.c
${.TARGET
}
253 ${COMPILE.c
} -o
${.TARGET
} lex.yy.c
259 ${LINK.c
} -o
${.TARGET
} y.tab.c
${LDLIBS}
263 mv y.tab.c
${.TARGET
}
266 ${COMPILE.c
} -o
${.TARGET
} y.tab.c
272 cp
${.IMPSRC
} ${.TARGET
}