freebsd-dev/usr.bin/bmake/Makefile

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

180 lines
3.6 KiB
Makefile
Raw Normal View History

# This is a generated file, do NOT edit!
# See contrib/bmake/bsd.after-import.mk
#
# $FreeBSD$
SRCTOP?= ${.CURDIR:H:H}
# look here first for config.h
CFLAGS+= -I${.CURDIR}
# for after-import
CLEANDIRS+= FreeBSD
CLEANFILES+= bootstrap
# $Id: Makefile,v 1.124 2023/02/25 20:27:44 sjg Exp $
PROG?= ${.CURDIR:T}
SRCS= \
arch.c \
buf.c \
compat.c \
cond.c \
dir.c \
for.c \
hash.c \
job.c \
lst.c \
main.c \
make.c \
make_malloc.c \
meta.c \
2015-10-23 17:38:01 +00:00
metachar.c \
parse.c \
str.c \
suff.c \
targ.c \
trace.c \
util.c \
var.c
Merge 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 22:25:46 +00:00
.sinclude "Makefile.inc"
# this file gets generated by configure
.sinclude "Makefile.config"
.if !empty(LIBOBJS)
SRCS+= ${LIBOBJS:T:.o=.c}
.endif
# just in case
prefix?= /usr
srcdir?= ${.CURDIR}
2014-01-27 17:47:21 +00:00
DEFAULT_SYS_PATH?= ${prefix}/share/mk
CPPFLAGS+= -DUSE_META
CFLAGS+= ${CPPFLAGS}
CFLAGS+= -D_PATH_DEFSYSPATH=\"${DEFAULT_SYS_PATH}\"
CFLAGS+= -I. -I${srcdir} ${XDEFS} -DMAKE_NATIVE
CFLAGS+= ${COPTS.${.ALLSRC:M*.c:T:u}}
COPTS.main.c+= "-DMAKE_VERSION=\"${_MAKE_VERSION}\""
.for x in FORCE_MACHINE FORCE_MACHINE_ARCH
.ifdef $x
COPTS.main.c+= "-D$x=\"${$x}\""
.endif
.endfor
Merge 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 22:25:46 +00:00
# meta mode can be useful even without filemon
# should be set by now
USE_FILEMON ?= no
.if ${USE_FILEMON:tl} != "no"
.PATH: ${srcdir}/filemon
SRCS+= filemon_${USE_FILEMON}.c
COPTS.meta.c+= -DUSE_FILEMON -DUSE_FILEMON_${USE_FILEMON:tu}
COPTS.job.c+= ${COPTS.meta.c}
.if ${USE_FILEMON} == "dev"
FILEMON_H ?= /usr/include/dev/filemon/filemon.h
.if exists(${FILEMON_H}) && ${FILEMON_H:T} == "filemon.h"
Merge 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 22:25:46 +00:00
COPTS.filemon_dev.c += -DHAVE_FILEMON_H -I${FILEMON_H:H}
.endif
Merge 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 22:25:46 +00:00
.endif # USE_FILEMON == dev
.endif # USE_FILEMON
.PATH: ${srcdir}
.if make(obj) || make(clean)
SUBDIR+= unit-tests
.endif
MAN= ${PROG}.1
MAN1= ${MAN}
2021-12-18 18:14:39 +00:00
.if ${PROG} != "make"
CLEANFILES+= my.history
.if make(${MAN}) || !exists(${srcdir}/${MAN})
my.history:
@(echo ".Nm"; \
echo "is derived from NetBSD"; \
echo ".Xr make 1 ."; \
echo "It uses autoconf to facilitate portability to other platforms."; \
echo ".Pp") > $@
.NOPATH: ${MAN}
${MAN}: make.1 my.history
@echo making $@
2016-12-19 23:38:07 +00:00
@sed \
-e '/^.Dt/s/MAKE/${PROG:tu}/' \
-e 's/^.Nx/NetBSD/' \
-e '/^.Nm/s/make/${PROG}/' \
-e '/^.Sh HISTORY/rmy.history' \
-e '/^.Sh HISTORY/,$$s,^.Nm,make,' ${srcdir}/make.1 > $@
all beforeinstall: ${MAN}
_mfromdir=.
.endif
.endif
MANTARGET?= cat
MANDEST?= ${MANDIR}/${MANTARGET}1
.if ${MANTARGET} == "cat"
_mfromdir=${srcdir}
.endif
.include <bsd.prog.mk>
CPPFLAGS+= -DMAKE_NATIVE -DHAVE_CONFIG_H
COPTS.var.c += -Wno-cast-qual
COPTS.job.c += -Wno-format-nonliteral
COPTS.parse.c += -Wno-format-nonliteral
COPTS.var.c += -Wno-format-nonliteral
# Force these
2015-04-21 04:40:38 +00:00
SHAREDIR= ${SHAREDIR.bmake:U${prefix}/share}
BINDIR= ${BINDIR.bmake:U${prefix}/bin}
MANDIR= ${MANDIR.bmake:U${SHAREDIR}/man}
${OBJS}: config.h
# A simple unit-test driver to help catch regressions
TEST_MAKE ?= ${.OBJDIR}/${PROG:T}
accept test: .NOMETA
cd ${.CURDIR}/unit-tests && \
MAKEFLAGS= ${TEST_MAKE} -r -m / ${.TARGET} ${TESTS:DTESTS=${TESTS:Q}}
.if make(test) && ${MK_AUTO_OBJ} == "yes"
# The test target above visits unit-tests with -r -m /
# which prevents MK_AUTO_OBJ doing its job
# so do it here
.if defined(MAKEOBJDIRPREFIX) || ${MAKEOBJDIR:U:M*/*} != ""
_utobj = ${.OBJDIR}/unit-tests
.else
_utobj = ${.CURDIR}/unit-tests/${MAKEOBJDIR:Uobj}
.endif
utobj: .NOMETA
@test -d ${_utobj} && exit 0; \
echo "[Creating ${_utobj}...]"; \
umask ${OBJDIR_UMASK:U002}; \
mkdir -p ${_utobj}
test: utobj
.endif
# override some simple things
BINDIR= /usr/bin
MANDIR= /usr/share/man/man
# make sure we get this
CFLAGS+= ${COPTS.${.IMPSRC:T}}
after-import: ${SRCTOP}/contrib/bmake/bsd.after-import.mk
cd ${.CURDIR} && ${.MAKE} -f ${SRCTOP}/contrib/bmake/bsd.after-import.mk