1# from: @(#)sys.mk 8.2 (Berkeley) 3/21/94
2# $FreeBSD: head/share/mk/sys.mk 301083 2016-05-31 22:37:11Z bdrewery $
3
4unix ?= We run FreeBSD, not UNIX.
5.FreeBSD ?= true
6
7.if !defined(%POSIX)
8#
9# MACHINE_CPUARCH defines a collection of MACHINE_ARCH. Machines with
10# the same MACHINE_ARCH can run each other's binaries, so it necessarily
--- 45 unchanged lines hidden (view full) ---
56.error ${.newline}ERROR: The filemon module (/dev/filemon) is not loaded.
57.endif
58META_MODE+= nofilemon
59.endif
60.endif
61META_MODE?= normal
62.export META_MODE
63.MAKE.MODE?= ${META_MODE}
64.if ${.MAKE.MODE:Mmeta*} != ""
65OP_META= .META
66.endif
67
68.if ${MK_AUTO_OBJ} == "yes"
69# This needs to be done early - before .PATH is computed
70# Don't do this for 'make showconfig' as it enables all options where meta mode
71# is not expected.
72.if !make(showconfig)
73.sinclude <auto.obj.mk>
74.endif
--- 212 unchanged lines hidden (view full) ---
287 ${FC} ${FFLAGS} -c ${.IMPSRC}
288 ${AR} ${ARFLAGS} ${.TARGET} ${.PREFIX}.o
289 rm -f ${.PREFIX}.o
290
291.else
292
293# non-Posix rule set
294
295.sh: ${OP_META}
296 cp -f ${.IMPSRC} ${.TARGET}
297 chmod a+x ${.TARGET}
298
299.c.ln: ${OP_META}
300 ${LINT} ${LINTOBJFLAGS} ${CFLAGS:M-[DIU]*} ${.IMPSRC} || \
301 touch ${.TARGET}
302
303.cc.ln .C.ln .cpp.ln .cxx.ln: ${OP_META}
304 ${LINT} ${LINTOBJFLAGS} ${CXXFLAGS:M-[DIU]*} ${.IMPSRC} || \
305 touch ${.TARGET}
306
307.c: ${OP_META}
308 ${CC} ${CFLAGS} ${LDFLAGS} ${.IMPSRC} ${LDLIBS} -o ${.TARGET}
309 ${CTFCONVERT_CMD}
310
311.c.o: ${OP_META}
312 ${CC} ${CFLAGS} -c ${.IMPSRC} -o ${.TARGET}
313 ${CTFCONVERT_CMD}
314
315.cc .cpp .cxx .C: ${OP_META}
316 ${CXX} ${CXXFLAGS} ${LDFLAGS} ${.IMPSRC} ${LDLIBS} -o ${.TARGET}
317
318.cc.o .cpp.o .cxx.o .C.o: ${OP_META}
319 ${CXX} ${CXXFLAGS} -c ${.IMPSRC} -o ${.TARGET}
320
321.m.o: ${OP_META}
322 ${OBJC} ${OBJCFLAGS} -c ${.IMPSRC} -o ${.TARGET}
323 ${CTFCONVERT_CMD}
324
325.p.o: ${OP_META}
326 ${PC} ${PFLAGS} -c ${.IMPSRC} -o ${.TARGET}
327 ${CTFCONVERT_CMD}
328
329.e .r .F .f: ${OP_META}
330 ${FC} ${RFLAGS} ${EFLAGS} ${FFLAGS} ${LDFLAGS} ${.IMPSRC} ${LDLIBS} \
331 -o ${.TARGET}
332
333.e.o .r.o .F.o .f.o: ${OP_META}
334 ${FC} ${RFLAGS} ${EFLAGS} ${FFLAGS} -c ${.IMPSRC} -o ${.TARGET}
335
336.S.o: ${OP_META}
337 ${CC:N${CCACHE_BIN}} ${CFLAGS} ${ACFLAGS} -c ${.IMPSRC} -o ${.TARGET}
338 ${CTFCONVERT_CMD}
339
340.asm.o: ${OP_META}
341 ${CC:N${CCACHE_BIN}} -x assembler-with-cpp ${CFLAGS} ${ACFLAGS} -c ${.IMPSRC} \
342 -o ${.TARGET}
343 ${CTFCONVERT_CMD}
344
345.s.o: ${OP_META}
346 ${AS} ${AFLAGS} -o ${.TARGET} ${.IMPSRC}
347 ${CTFCONVERT_CMD}
348
349# XXX not -j safe
350.y.o: ${OP_META}
351 ${YACC} ${YFLAGS} ${.IMPSRC}
352 ${CC} ${CFLAGS} -c y.tab.c -o ${.TARGET}
353 rm -f y.tab.c
354 ${CTFCONVERT_CMD}
355
356.l.o: ${OP_META}
357 ${LEX} -t ${LFLAGS} ${.IMPSRC} > ${.PREFIX}.tmp.c
358 ${CC} ${CFLAGS} -c ${.PREFIX}.tmp.c -o ${.TARGET}
359 rm -f ${.PREFIX}.tmp.c
360 ${CTFCONVERT_CMD}
361
362# XXX not -j safe
363.y.c: ${OP_META}
364 ${YACC} ${YFLAGS} ${.IMPSRC}
365 mv y.tab.c ${.TARGET}
366
367.l.c: ${OP_META}
368 ${LEX} -t ${LFLAGS} ${.IMPSRC} > ${.TARGET}
369
370.s.out .c.out .o.out: ${OP_META}
371 ${CC} ${CFLAGS} ${LDFLAGS} ${.IMPSRC} ${LDLIBS} -o ${.TARGET}
372 ${CTFCONVERT_CMD}
373
374.f.out .F.out .r.out .e.out: ${OP_META}
375 ${FC} ${EFLAGS} ${RFLAGS} ${FFLAGS} ${LDFLAGS} ${.IMPSRC} \
376 ${LDLIBS} -o ${.TARGET}
377 rm -f ${.PREFIX}.o
378 ${CTFCONVERT_CMD}
379
380# XXX not -j safe
381.y.out: ${OP_META}
382 ${YACC} ${YFLAGS} ${.IMPSRC}
383 ${CC} ${CFLAGS} ${LDFLAGS} y.tab.c ${LDLIBS} -ly -o ${.TARGET}
384 rm -f y.tab.c
385 ${CTFCONVERT_CMD}
386
387.l.out: ${OP_META}
388 ${LEX} -t ${LFLAGS} ${.IMPSRC} > ${.PREFIX}.tmp.c
389 ${CC} ${CFLAGS} ${LDFLAGS} ${.PREFIX}.tmp.c ${LDLIBS} -ll -o ${.TARGET}
390 rm -f ${.PREFIX}.tmp.c
391 ${CTFCONVERT_CMD}
392
393# Pull in global settings.
394__MAKE_CONF?=/etc/make.conf
395.if exists(${__MAKE_CONF})
--- 45 unchanged lines hidden ---
2# $FreeBSD: head/share/mk/sys.mk 301083 2016-05-31 22:37:11Z bdrewery $
3
4unix ?= We run FreeBSD, not UNIX.
5.FreeBSD ?= true
6
7.if !defined(%POSIX)
8#
9# MACHINE_CPUARCH defines a collection of MACHINE_ARCH. Machines with
10# the same MACHINE_ARCH can run each other's binaries, so it necessarily
--- 45 unchanged lines hidden (view full) ---
56.error ${.newline}ERROR: The filemon module (/dev/filemon) is not loaded.
57.endif
58META_MODE+= nofilemon
59.endif
60.endif
61META_MODE?= normal
62.export META_MODE
63.MAKE.MODE?= ${META_MODE}
64.if ${.MAKE.MODE:Mmeta*} != ""
65OP_META= .META
66.endif
67
68.if ${MK_AUTO_OBJ} == "yes"
69# This needs to be done early - before .PATH is computed
70# Don't do this for 'make showconfig' as it enables all options where meta mode
71# is not expected.
72.if !make(showconfig)
73.sinclude <auto.obj.mk>
74.endif
--- 212 unchanged lines hidden (view full) ---
287 ${FC} ${FFLAGS} -c ${.IMPSRC}
288 ${AR} ${ARFLAGS} ${.TARGET} ${.PREFIX}.o
289 rm -f ${.PREFIX}.o
290
291.else
292
293# non-Posix rule set
294
295.sh: ${OP_META}
296 cp -f ${.IMPSRC} ${.TARGET}
297 chmod a+x ${.TARGET}
298
299.c.ln: ${OP_META}
300 ${LINT} ${LINTOBJFLAGS} ${CFLAGS:M-[DIU]*} ${.IMPSRC} || \
301 touch ${.TARGET}
302
303.cc.ln .C.ln .cpp.ln .cxx.ln: ${OP_META}
304 ${LINT} ${LINTOBJFLAGS} ${CXXFLAGS:M-[DIU]*} ${.IMPSRC} || \
305 touch ${.TARGET}
306
307.c: ${OP_META}
308 ${CC} ${CFLAGS} ${LDFLAGS} ${.IMPSRC} ${LDLIBS} -o ${.TARGET}
309 ${CTFCONVERT_CMD}
310
311.c.o: ${OP_META}
312 ${CC} ${CFLAGS} -c ${.IMPSRC} -o ${.TARGET}
313 ${CTFCONVERT_CMD}
314
315.cc .cpp .cxx .C: ${OP_META}
316 ${CXX} ${CXXFLAGS} ${LDFLAGS} ${.IMPSRC} ${LDLIBS} -o ${.TARGET}
317
318.cc.o .cpp.o .cxx.o .C.o: ${OP_META}
319 ${CXX} ${CXXFLAGS} -c ${.IMPSRC} -o ${.TARGET}
320
321.m.o: ${OP_META}
322 ${OBJC} ${OBJCFLAGS} -c ${.IMPSRC} -o ${.TARGET}
323 ${CTFCONVERT_CMD}
324
325.p.o: ${OP_META}
326 ${PC} ${PFLAGS} -c ${.IMPSRC} -o ${.TARGET}
327 ${CTFCONVERT_CMD}
328
329.e .r .F .f: ${OP_META}
330 ${FC} ${RFLAGS} ${EFLAGS} ${FFLAGS} ${LDFLAGS} ${.IMPSRC} ${LDLIBS} \
331 -o ${.TARGET}
332
333.e.o .r.o .F.o .f.o: ${OP_META}
334 ${FC} ${RFLAGS} ${EFLAGS} ${FFLAGS} -c ${.IMPSRC} -o ${.TARGET}
335
336.S.o: ${OP_META}
337 ${CC:N${CCACHE_BIN}} ${CFLAGS} ${ACFLAGS} -c ${.IMPSRC} -o ${.TARGET}
338 ${CTFCONVERT_CMD}
339
340.asm.o: ${OP_META}
341 ${CC:N${CCACHE_BIN}} -x assembler-with-cpp ${CFLAGS} ${ACFLAGS} -c ${.IMPSRC} \
342 -o ${.TARGET}
343 ${CTFCONVERT_CMD}
344
345.s.o: ${OP_META}
346 ${AS} ${AFLAGS} -o ${.TARGET} ${.IMPSRC}
347 ${CTFCONVERT_CMD}
348
349# XXX not -j safe
350.y.o: ${OP_META}
351 ${YACC} ${YFLAGS} ${.IMPSRC}
352 ${CC} ${CFLAGS} -c y.tab.c -o ${.TARGET}
353 rm -f y.tab.c
354 ${CTFCONVERT_CMD}
355
356.l.o: ${OP_META}
357 ${LEX} -t ${LFLAGS} ${.IMPSRC} > ${.PREFIX}.tmp.c
358 ${CC} ${CFLAGS} -c ${.PREFIX}.tmp.c -o ${.TARGET}
359 rm -f ${.PREFIX}.tmp.c
360 ${CTFCONVERT_CMD}
361
362# XXX not -j safe
363.y.c: ${OP_META}
364 ${YACC} ${YFLAGS} ${.IMPSRC}
365 mv y.tab.c ${.TARGET}
366
367.l.c: ${OP_META}
368 ${LEX} -t ${LFLAGS} ${.IMPSRC} > ${.TARGET}
369
370.s.out .c.out .o.out: ${OP_META}
371 ${CC} ${CFLAGS} ${LDFLAGS} ${.IMPSRC} ${LDLIBS} -o ${.TARGET}
372 ${CTFCONVERT_CMD}
373
374.f.out .F.out .r.out .e.out: ${OP_META}
375 ${FC} ${EFLAGS} ${RFLAGS} ${FFLAGS} ${LDFLAGS} ${.IMPSRC} \
376 ${LDLIBS} -o ${.TARGET}
377 rm -f ${.PREFIX}.o
378 ${CTFCONVERT_CMD}
379
380# XXX not -j safe
381.y.out: ${OP_META}
382 ${YACC} ${YFLAGS} ${.IMPSRC}
383 ${CC} ${CFLAGS} ${LDFLAGS} y.tab.c ${LDLIBS} -ly -o ${.TARGET}
384 rm -f y.tab.c
385 ${CTFCONVERT_CMD}
386
387.l.out: ${OP_META}
388 ${LEX} -t ${LFLAGS} ${.IMPSRC} > ${.PREFIX}.tmp.c
389 ${CC} ${CFLAGS} ${LDFLAGS} ${.PREFIX}.tmp.c ${LDLIBS} -ll -o ${.TARGET}
390 rm -f ${.PREFIX}.tmp.c
391 ${CTFCONVERT_CMD}
392
393# Pull in global settings.
394__MAKE_CONF?=/etc/make.conf
395.if exists(${__MAKE_CONF})
--- 45 unchanged lines hidden ---