freebsd-src/mk/sys/Darwin.mk

224 lines
3.8 KiB
Makefile
Raw Normal View History

# $NetBSD: Darwin.sys.mk,v 1.3 2003/02/16 09:44:41 grant Exp $
# @(#)sys.mk 8.2 (Berkeley) 3/21/94
OS ?= Darwin
unix ?= We run ${OS}.
Import bmake-20200517 Changes since 20181221 are mostly portability related hence the large gap in versions imported. There are however some bug fixes, and a rework of filemon handling. In NetBSD make/filemon/filemon_ktrace.c allows use of fktrace and elimination of filemon(4) which has not had the TLC it needs. FreeBSD filemon(4) is in much better shape, so bmake/filemon/filemon_dev.c allows use of that, with a bit less overhead than the ktrace model. Summary of changes from ChangeLog o str.c: empty string does not match % pattern plus unit-test changes o var.c: import handling of old sysV style modifier using '%' o str.c: refactor brk_string o meta.c: meta_oodate, CHECK_VALID_META is too aggressive for CMD a blank command is perfectly valid. o meta.c: meta_oodate, check for corrupted meta file earlier and more often. * meta.c: meta_compat_parent check for USE_FILEMON patch from Soeren Tempel o meta.c: fix compat mode, need to call meta_job_output() o job.c: extra fds for meta mode not needed if using filemon_dev o meta.c: avoid passing NULL to filemon_*() when meta_needed() returns FALSE. o filemon/filemon_{dev,ktrace}.c: allow selection of filemon implementation. filemon_dev.c uses the kernel module while filemon_ktrace.c leverages the fktrace api available in NetBSD. filemon_ktrace.c can hopefully form the basis for adding support for other tracing mechanisms such as strace on Linux. o meta.c: when target is out-of-date per normal make rules record value of .OODATE in meta file. o parse.c: don't pass NULL to realpath(3) some versions cannot handle it. o parse.c: ParseDoDependency: free paths rather than assert plus more unit-tests
2020-05-20 19:34:48 +00:00
.SUFFIXES: .out .a .ln .o .s .S .c .m ${CXX_SUFFIXES} .F .f .r .y .l .cl .p .h
.SUFFIXES: .sh .m4 .dylib
.LIBS: .a .dylib
SHLIBEXT ?= .dylib
HOST_LIBEXT ?= .dylib
DSHLIBEXT ?= .dylib
AR ?= ar
ARFLAGS ?= r
RANLIB =
AS ?= as
AFLAGS ?=
COMPILE.s ?= ${AS} ${AFLAGS}
LINK.s ?= ${CC} ${AFLAGS} ${LDFLAGS}
COMPILE.S ?= ${CC} ${AFLAGS} ${CPPFLAGS} -c
LINK.S ?= ${CC} ${AFLAGS} ${CPPFLAGS} ${LDFLAGS}
PIPE ?= -pipe
Import bmake-20200517 Changes since 20181221 are mostly portability related hence the large gap in versions imported. There are however some bug fixes, and a rework of filemon handling. In NetBSD make/filemon/filemon_ktrace.c allows use of fktrace and elimination of filemon(4) which has not had the TLC it needs. FreeBSD filemon(4) is in much better shape, so bmake/filemon/filemon_dev.c allows use of that, with a bit less overhead than the ktrace model. Summary of changes from ChangeLog o str.c: empty string does not match % pattern plus unit-test changes o var.c: import handling of old sysV style modifier using '%' o str.c: refactor brk_string o meta.c: meta_oodate, CHECK_VALID_META is too aggressive for CMD a blank command is perfectly valid. o meta.c: meta_oodate, check for corrupted meta file earlier and more often. * meta.c: meta_compat_parent check for USE_FILEMON patch from Soeren Tempel o meta.c: fix compat mode, need to call meta_job_output() o job.c: extra fds for meta mode not needed if using filemon_dev o meta.c: avoid passing NULL to filemon_*() when meta_needed() returns FALSE. o filemon/filemon_{dev,ktrace}.c: allow selection of filemon implementation. filemon_dev.c uses the kernel module while filemon_ktrace.c leverages the fktrace api available in NetBSD. filemon_ktrace.c can hopefully form the basis for adding support for other tracing mechanisms such as strace on Linux. o meta.c: when target is out-of-date per normal make rules record value of .OODATE in meta file. o parse.c: don't pass NULL to realpath(3) some versions cannot handle it. o parse.c: ParseDoDependency: free paths rather than assert plus more unit-tests
2020-05-20 19:34:48 +00:00
.if exists(/usr/bin/clang)
CC ?= cc ${PIPE}
CXX ?= c++
Import bmake-20200517 Changes since 20181221 are mostly portability related hence the large gap in versions imported. There are however some bug fixes, and a rework of filemon handling. In NetBSD make/filemon/filemon_ktrace.c allows use of fktrace and elimination of filemon(4) which has not had the TLC it needs. FreeBSD filemon(4) is in much better shape, so bmake/filemon/filemon_dev.c allows use of that, with a bit less overhead than the ktrace model. Summary of changes from ChangeLog o str.c: empty string does not match % pattern plus unit-test changes o var.c: import handling of old sysV style modifier using '%' o str.c: refactor brk_string o meta.c: meta_oodate, CHECK_VALID_META is too aggressive for CMD a blank command is perfectly valid. o meta.c: meta_oodate, check for corrupted meta file earlier and more often. * meta.c: meta_compat_parent check for USE_FILEMON patch from Soeren Tempel o meta.c: fix compat mode, need to call meta_job_output() o job.c: extra fds for meta mode not needed if using filemon_dev o meta.c: avoid passing NULL to filemon_*() when meta_needed() returns FALSE. o filemon/filemon_{dev,ktrace}.c: allow selection of filemon implementation. filemon_dev.c uses the kernel module while filemon_ktrace.c leverages the fktrace api available in NetBSD. filemon_ktrace.c can hopefully form the basis for adding support for other tracing mechanisms such as strace on Linux. o meta.c: when target is out-of-date per normal make rules record value of .OODATE in meta file. o parse.c: don't pass NULL to realpath(3) some versions cannot handle it. o parse.c: ParseDoDependency: free paths rather than assert plus more unit-tests
2020-05-20 19:34:48 +00:00
.elif exists(/usr/bin/gcc)
CC ?= gcc ${PIPE}
.else
CC ?= cc ${PIPE}
.endif
DBG ?= -O2
CFLAGS ?= ${DBG}
COMPILE.c ?= ${CC} ${CFLAGS} ${CPPFLAGS} -c
LINK.c ?= ${CC} ${CFLAGS} ${CPPFLAGS} ${LDFLAGS}
.if exists(/usr/bin/g++)
CXX ?= g++
.else
CXX ?= c++
.endif
CXXFLAGS ?= ${CFLAGS}
COMPILE.cc ?= ${CXX} ${CXXFLAGS} ${CPPFLAGS} -c
LINK.cc ?= ${CXX} ${CXXFLAGS} ${CPPFLAGS} ${LDFLAGS}
OBJC ?= ${CC}
OBJCFLAGS ?= ${CFLAGS}
COMPILE.m ?= ${OBJC} ${OBJCFLAGS} ${CPPFLAGS} -c
LINK.m ?= ${OBJC} ${OBJCFLAGS} ${CPPFLAGS} ${LDFLAGS}
CPP ?= cpp
NOLINT ?= 1
CPPFLAGS ?=
MK_DEP ?= mkdep
FC ?= f77
FFLAGS ?= -O
RFLAGS ?=
COMPILE.f ?= ${FC} ${FFLAGS} -c
LINK.f ?= ${FC} ${FFLAGS} ${LDFLAGS}
COMPILE.F ?= ${FC} ${FFLAGS} ${CPPFLAGS} -c
LINK.F ?= ${FC} ${FFLAGS} ${CPPFLAGS} ${LDFLAGS}
COMPILE.r ?= ${FC} ${FFLAGS} ${RFLAGS} -c
LINK.r ?= ${FC} ${FFLAGS} ${RFLAGS} ${LDFLAGS}
INSTALL ?= install
LEX ?= lex
LFLAGS ?=
LEX.l ?= ${LEX} ${LFLAGS}
LD ?= ld
LDFLAGS ?=
SHLIB_TEENY ?= 0
SHLIB_MINOR ?= 0
MKPICLIB ?= no
LIBEXT ?= .dylib
LINT ?= lint
LINTFLAGS ?= -chapbx
LORDER ?= lorder
NM ?= nm
PC ?= pc
PFLAGS ?=
COMPILE.p ?= ${PC} ${PFLAGS} ${CPPFLAGS} -c
LINK.p ?= ${PC} ${PFLAGS} ${CPPFLAGS} ${LDFLAGS}
SIZE ?= size
TSORT ?= tsort -q
YACC ?= bison -y
YFLAGS ?= -d
YACC.y ?= ${YACC} ${YFLAGS}
# C
.c:
${LINK.c} -o ${.TARGET} ${.IMPSRC} ${LDLIBS}
.c.o:
${COMPILE.c} ${.IMPSRC}
.c.a:
${COMPILE.c} ${.IMPSRC}
${AR} ${ARFLAGS} $@ $*.o
rm -f $*.o
# C++
${CXX_SUFFIXES}:
${LINK.cc} -o ${.TARGET} ${.IMPSRC} ${LDLIBS}
${CXX_SUFFIXES:%=%.o}:
${COMPILE.cc} ${.IMPSRC}
${CXX_SUFFIXES:%=%.a}:
${COMPILE.cc} ${.IMPSRC}
${AR} ${ARFLAGS} $@ $*.o
rm -f $*.o
Import bmake-20200517 Changes since 20181221 are mostly portability related hence the large gap in versions imported. There are however some bug fixes, and a rework of filemon handling. In NetBSD make/filemon/filemon_ktrace.c allows use of fktrace and elimination of filemon(4) which has not had the TLC it needs. FreeBSD filemon(4) is in much better shape, so bmake/filemon/filemon_dev.c allows use of that, with a bit less overhead than the ktrace model. Summary of changes from ChangeLog o str.c: empty string does not match % pattern plus unit-test changes o var.c: import handling of old sysV style modifier using '%' o str.c: refactor brk_string o meta.c: meta_oodate, CHECK_VALID_META is too aggressive for CMD a blank command is perfectly valid. o meta.c: meta_oodate, check for corrupted meta file earlier and more often. * meta.c: meta_compat_parent check for USE_FILEMON patch from Soeren Tempel o meta.c: fix compat mode, need to call meta_job_output() o job.c: extra fds for meta mode not needed if using filemon_dev o meta.c: avoid passing NULL to filemon_*() when meta_needed() returns FALSE. o filemon/filemon_{dev,ktrace}.c: allow selection of filemon implementation. filemon_dev.c uses the kernel module while filemon_ktrace.c leverages the fktrace api available in NetBSD. filemon_ktrace.c can hopefully form the basis for adding support for other tracing mechanisms such as strace on Linux. o meta.c: when target is out-of-date per normal make rules record value of .OODATE in meta file. o parse.c: don't pass NULL to realpath(3) some versions cannot handle it. o parse.c: ParseDoDependency: free paths rather than assert plus more unit-tests
2020-05-20 19:34:48 +00:00
# Objective-C
.m:
${LINK.m} -o ${.TARGET} ${.IMPSRC} ${LDLIBS}
.m.o:
${COMPILE.m} ${.IMPSRC}
.m.a:
${COMPILE.m} ${.IMPSRC}
${AR} ${ARFLAGS} $@ $*.o
rm -f $*.o
# Fortran/Ratfor
.f:
${LINK.f} -o ${.TARGET} ${.IMPSRC} ${LDLIBS}
.f.o:
${COMPILE.f} ${.IMPSRC}
.f.a:
${COMPILE.f} ${.IMPSRC}
${AR} ${ARFLAGS} $@ $*.o
rm -f $*.o
.F:
${LINK.F} -o ${.TARGET} ${.IMPSRC} ${LDLIBS}
.F.o:
${COMPILE.F} ${.IMPSRC}
.F.a:
${COMPILE.F} ${.IMPSRC}
${AR} ${ARFLAGS} $@ $*.o
rm -f $*.o
.r:
${LINK.r} -o ${.TARGET} ${.IMPSRC} ${LDLIBS}
.r.o:
${COMPILE.r} ${.IMPSRC}
.r.a:
${COMPILE.r} ${.IMPSRC}
${AR} ${ARFLAGS} $@ $*.o
rm -f $*.o
# Pascal
.p:
${LINK.p} -o ${.TARGET} ${.IMPSRC} ${LDLIBS}
.p.o:
${COMPILE.p} ${.IMPSRC}
.p.a:
${COMPILE.p} ${.IMPSRC}
${AR} ${ARFLAGS} $@ $*.o
rm -f $*.o
# Assembly
.s:
${LINK.s} -o ${.TARGET} ${.IMPSRC} ${LDLIBS}
.s.o:
${COMPILE.s} -o ${.TARGET} ${.IMPSRC}
.s.a:
${COMPILE.s} ${.IMPSRC}
${AR} ${ARFLAGS} $@ $*.o
rm -f $*.o
.S:
${LINK.S} -o ${.TARGET} ${.IMPSRC} ${LDLIBS}
.S.o:
${COMPILE.S} ${.IMPSRC}
.S.a:
${COMPILE.S} ${.IMPSRC}
${AR} ${ARFLAGS} $@ $*.o
rm -f $*.o
# Lex
.l:
${LEX.l} ${.IMPSRC}
${LINK.c} -o ${.TARGET} lex.yy.c ${LDLIBS} -ll
rm -f lex.yy.c
.l.c:
${LEX.l} ${.IMPSRC}
mv lex.yy.c ${.TARGET}
.l.o:
${LEX.l} ${.IMPSRC}
${COMPILE.c} -o ${.TARGET} lex.yy.c
rm -f lex.yy.c
# Yacc
.y:
${YACC.y} ${.IMPSRC}
${LINK.c} -o ${.TARGET} y.tab.c ${LDLIBS}
rm -f y.tab.c
.y.c:
${YACC.y} ${.IMPSRC}
mv y.tab.c ${.TARGET}
.y.o:
${YACC.y} ${.IMPSRC}
${COMPILE.c} -o ${.TARGET} y.tab.c
rm -f y.tab.c
# Shell
.sh:
rm -f ${.TARGET}
cp ${.IMPSRC} ${.TARGET}
chmod a+x ${.TARGET}