1 # from: @(#)sys.mk 8.2 (Berkeley) 3/21/94
4 unix ?
= We run FreeBSD
, not UNIX.
7 # If the special target .POSIX appears (without prerequisites or
8 # commands) before the first noncomment line in the makefile, make shall
9 # process the makefile as specified by the Posix 1003.2 specification.
10 # make(1) sets the special macro %POSIX in this case (to the actual
11 # value "1003.2", for what it's worth).
13 # The rules below use this macro to distinguish between Posix-compliant
14 # and default behaviour.
17 .SUFFIXES
: .o .c .y .l .a .sh .f
19 .SUFFIXES
: .out .a .ln .o .c .
cc .
cpp .
cxx .C .m .F .f .e .r .y .l .S .asm .s .cl .p .h .sh
38 .if
${MACHINE_ARCH} == "arm" ||
${MACHINE_ARCH} == "mips"
43 .if defined
(NO_STRICT_ALIASING
)
44 CFLAGS
+= -fno-strict-aliasing
48 # Turn CTF conversion off by default for now. This default could be
49 # changed later if DTrace becomes popular.
50 .if
!defined
(WITH_CTF
)
54 # C Type Format data is required for DTrace
55 CTFFLAGS ?
= -L VERSION
58 CTFCONVERT ?
= ctfconvert
60 .if defined
(CFLAGS
) && (${CFLAGS
:M-g
} != "")
68 CXXFLAGS ?
= ${CFLAGS
:N-std
=*:N-Wnested-externs
:N-W
*-prototypes
:N-Wno-pointer-sign
}
72 .if empty
(.MAKEFLAGS
:M-s
)
77 .if
${.MAKEFLAGS
:M-s
} == "-s"
84 .if
!empty
(.MAKEFLAGS
:M-n
) && ${.MAKEFLAGS
:M-n
} == "-n"
108 LINTFLAGS ?
= -cghapbx
109 LINTKERNFLAGS ?
= ${LINTFLAGS}
110 LINTOBJFLAGS ?
= -cghapbxu
-i
111 LINTOBJKERNFLAGS?
= ${LINTOBJFLAGS}
112 LINTLIBFLAGS ?
= -cghapbxu
-C
${LIB}
117 OBJCFLAGS ?
= ${OBJCINCLUDES} ${CFLAGS} -Wno-import
136 # Posix 1003.2 mandated rules
138 # Quoted directly from the Posix 1003.2 draft, only the macros
139 # $@, $< and $* have been replaced by ${.TARGET}, ${.IMPSRC}, and
142 # SINGLE SUFFIX RULES
144 ${CC} ${CFLAGS} ${LDFLAGS} -o
${.TARGET
} ${.IMPSRC
}
145 .if defined
(CTFCONVERT
)
146 ${CTFCONVERT} ${CTFFLAGS} ${.TARGET
}
150 ${FC} ${FFLAGS} ${LDFLAGS} -o
${.TARGET
} ${.IMPSRC
}
151 .if defined
(CTFCONVERT
)
152 ${CTFCONVERT} ${CTFFLAGS} ${.TARGET
}
156 cp
${.IMPSRC
} ${.TARGET
}
159 # DOUBLE SUFFIX RULES
162 ${CC} ${CFLAGS} -c
${.IMPSRC
}
163 .if defined
(CTFCONVERT
)
164 ${CTFCONVERT} ${CTFFLAGS} ${.TARGET
}
168 ${FC} ${FFLAGS} -c
${.IMPSRC
}
169 .if defined
(CTFCONVERT
)
170 ${CTFCONVERT} ${CTFFLAGS} ${.TARGET
}
174 ${YACC} ${YFLAGS} ${.IMPSRC
}
175 ${CC} ${CFLAGS} -c y.tab.c
177 mv y.tab.o
${.TARGET
}
178 .if defined
(CTFCONVERT
)
179 ${CTFCONVERT} ${CTFFLAGS} ${.TARGET
}
183 ${LEX} ${LFLAGS} ${.IMPSRC
}
184 ${CC} ${CFLAGS} -c
lex.yy.c
186 mv
lex.yy.o
${.TARGET
}
187 .if defined
(CTFCONVERT
)
188 ${CTFCONVERT} ${CTFFLAGS} ${.TARGET
}
192 ${YACC} ${YFLAGS} ${.IMPSRC
}
193 mv y.tab.c
${.TARGET
}
196 ${LEX} ${LFLAGS} ${.IMPSRC
}
197 mv
lex.yy.c
${.TARGET
}
200 ${CC} ${CFLAGS} -c
${.IMPSRC
}
201 ${AR} ${ARFLAGS} ${.TARGET
} ${.PREFIX
}.o
205 ${FC} ${FFLAGS} -c
${.IMPSRC
}
206 ${AR} ${ARFLAGS} ${.TARGET
} ${.PREFIX
}.o
214 cp
-p
${.IMPSRC
} ${.TARGET
}
218 ${LINT} ${LINTOBJFLAGS} ${CFLAGS
:M-
[DIU
]*} ${.IMPSRC
} || \
221 .
cc.ln .C.ln .
cpp.ln .
cxx.ln
:
222 ${LINT} ${LINTOBJFLAGS} ${CXXFLAGS
:M-
[DIU
]*} ${.IMPSRC
} || \
226 ${CC} ${CFLAGS} ${LDFLAGS} ${.IMPSRC
} ${LDLIBS} -o
${.TARGET
}
227 .if defined
(CTFCONVERT
)
228 ${CTFCONVERT} ${CTFFLAGS} ${.TARGET
}
232 ${CC} ${CFLAGS} -c
${.IMPSRC
}
233 .if defined
(CTFCONVERT
)
234 ${CTFCONVERT} ${CTFFLAGS} ${.TARGET
}
238 ${CXX} ${CXXFLAGS} ${LDFLAGS} ${.IMPSRC
} ${LDLIBS} -o
${.TARGET
}
240 .
cc.o .
cpp.o .
cxx.o .C.o
:
241 ${CXX} ${CXXFLAGS} -c
${.IMPSRC
}
244 ${OBJC} ${OBJCFLAGS} -c
${.IMPSRC
}
245 .if defined
(CTFCONVERT
)
246 ${CTFCONVERT} ${CTFFLAGS} ${.TARGET
}
250 ${PC} ${PFLAGS} -c
${.IMPSRC
}
251 .if defined
(CTFCONVERT
)
252 ${CTFCONVERT} ${CTFFLAGS} ${.TARGET
}
256 ${FC} ${RFLAGS} ${EFLAGS} ${FFLAGS} ${LDFLAGS} ${.IMPSRC
} ${LDLIBS} \
260 ${FC} ${RFLAGS} ${EFLAGS} ${FFLAGS} -c
${.IMPSRC
}
263 ${CC} ${CFLAGS} -c
${.IMPSRC
}
264 .if defined
(CTFCONVERT
)
265 ${CTFCONVERT} ${CTFFLAGS} ${.TARGET
}
269 ${CC} -x assembler-with-cpp
${CFLAGS} -c
${.IMPSRC
}
270 .if defined
(CTFCONVERT
)
271 ${CTFCONVERT} ${CTFFLAGS} ${.TARGET
}
275 ${AS} ${AFLAGS} -o
${.TARGET
} ${.IMPSRC
}
276 .if defined
(CTFCONVERT
)
277 ${CTFCONVERT} ${CTFFLAGS} ${.TARGET
}
282 ${YACC} ${YFLAGS} ${.IMPSRC
}
283 ${CC} ${CFLAGS} -c y.tab.c
-o
${.TARGET
}
285 .if defined
(CTFCONVERT
)
286 ${CTFCONVERT} ${CTFFLAGS} ${.TARGET
}
290 ${LEX} -t
${LFLAGS} ${.IMPSRC
} > ${.PREFIX
}.tmp.c
291 ${CC} ${CFLAGS} -c
${.PREFIX
}.tmp.c
-o
${.TARGET
}
292 rm -f
${.PREFIX
}.tmp.c
293 .if defined
(CTFCONVERT
)
294 ${CTFCONVERT} ${CTFFLAGS} ${.TARGET
}
299 ${YACC} ${YFLAGS} ${.IMPSRC
}
300 mv y.tab.c
${.TARGET
}
303 ${LEX} -t
${LFLAGS} ${.IMPSRC
} > ${.TARGET
}
305 .s.out .c.out .o.out
:
306 ${CC} ${CFLAGS} ${LDFLAGS} ${.IMPSRC
} ${LDLIBS} -o
${.TARGET
}
307 .if defined
(CTFCONVERT
)
308 ${CTFCONVERT} ${CTFFLAGS} ${.TARGET
}
311 .f.out .F.out .r.out .e.out
:
312 ${FC} ${EFLAGS} ${RFLAGS} ${FFLAGS} ${LDFLAGS} ${.IMPSRC
} \
313 ${LDLIBS} -o
${.TARGET
}
315 .if defined
(CTFCONVERT
)
316 ${CTFCONVERT} ${CTFFLAGS} ${.TARGET
}
321 ${YACC} ${YFLAGS} ${.IMPSRC
}
322 ${CC} ${CFLAGS} ${LDFLAGS} y.tab.c
${LDLIBS} -ly
-o
${.TARGET
}
324 .if defined
(CTFCONVERT
)
325 ${CTFCONVERT} ${CTFFLAGS} ${.TARGET
}
329 ${LEX} -t
${LFLAGS} ${.IMPSRC
} > ${.PREFIX
}.tmp.c
330 ${CC} ${CFLAGS} ${LDFLAGS} ${.PREFIX
}.tmp.c
${LDLIBS} -ll
-o
${.TARGET
}
331 rm -f
${.PREFIX
}.tmp.c
332 .if defined
(CTFCONVERT
)
333 ${CTFCONVERT} ${CTFFLAGS} ${.TARGET
}
336 # FreeBSD build pollution. Hide it in the non-POSIX part of the ifdef.
337 __MAKE_CONF?
=/etc
/make.conf
338 .if exists
(${__MAKE_CONF})
339 .
include "${__MAKE_CONF}"
342 .if defined
(__MAKE_SHELL
) && !empty
(__MAKE_SHELL
)
343 SHELL
= ${__MAKE_SHELL}
344 .SHELL
: path
=${__MAKE_SHELL}
347 # Default executable format
348 # XXX hint for bsd.port.mk
356 .
include <bsd.compat.mk
>
357 .
include <bsd.cpu.mk
>