1# This is a generated file, do NOT edit! 2# See contrib/bmake/bsd.after-import.mk 3# 4# $FreeBSD$ 5 6SRCTOP?= ${.CURDIR:H:H} 7 8# look here first for config.h 9CFLAGS+= -I${.CURDIR} 10 11# for after-import 12CLEANDIRS+= FreeBSD 13CLEANFILES+= bootstrap 14 15# $Id: Makefile,v 1.113 2020/10/26 17:55:09 sjg Exp $ 16 17PROG?= ${.CURDIR:T} 18 19SRCS= \ 20 arch.c \ 21 buf.c \ 22 compat.c \ 23 cond.c \ 24 dir.c \ 25 enum.c \ 26 for.c \ 27 hash.c \ 28 job.c \ 29 lst.c \ 30 main.c \ 31 make.c \ 32 make_malloc.c \ 33 meta.c \ 34 metachar.c \ 35 parse.c \ 36 str.c \ 37 suff.c \ 38 targ.c \ 39 trace.c \ 40 util.c \ 41 var.c 42 43.sinclude "Makefile.inc" 44 45# this file gets generated by configure 46.sinclude "Makefile.config" 47 48.if !empty(LIBOBJS) 49SRCS+= ${LIBOBJS:T:.o=.c} 50.endif 51 52# just in case 53prefix?= /usr 54srcdir?= ${.CURDIR} 55 56DEFAULT_SYS_PATH?= ${prefix}/share/mk 57 58CPPFLAGS+= -DUSE_META 59CFLAGS+= ${CPPFLAGS} 60CFLAGS+= -D_PATH_DEFSYSPATH=\"${DEFAULT_SYS_PATH}\" 61CFLAGS+= -I. -I${srcdir} ${XDEFS} -DMAKE_NATIVE 62CFLAGS+= ${COPTS.${.ALLSRC:M*.c:T:u}} 63COPTS.main.c+= "-DMAKE_VERSION=\"${_MAKE_VERSION}\"" 64 65# meta mode can be useful even without filemon 66# should be set by now 67USE_FILEMON ?= no 68.if ${USE_FILEMON:tl} != "no" 69.PATH: ${srcdir}/filemon 70SRCS+= filemon_${USE_FILEMON}.c 71COPTS.meta.c+= -DUSE_FILEMON -DUSE_FILEMON_${USE_FILEMON:tu} 72COPTS.job.c+= ${COPTS.meta.c} 73 74.if ${USE_FILEMON} == "dev" 75FILEMON_H ?= /usr/include/dev/filemon/filemon.h 76.if exists(${FILEMON_H}) && ${FILEMON_H:T} == "filemon.h" 77COPTS.filemon_dev.c += -DHAVE_FILEMON_H -I${FILEMON_H:H} 78.endif 79.endif # USE_FILEMON == dev 80 81.endif # USE_FILEMON 82 83.PATH: ${srcdir} 84 85.if make(obj) || make(clean) 86SUBDIR+= unit-tests 87.endif 88 89 90MAN= ${PROG}.1 91MAN1= ${MAN} 92 93.if (${PROG} != "make") 94CLEANFILES+= my.history 95.if make(${MAN}) || !exists(${srcdir}/${MAN}) 96my.history: 97 @(echo ".Nm"; \ 98 echo "is derived from NetBSD"; \ 99 echo ".Xr make 1 ."; \ 100 echo "It uses autoconf to facilitate portability to other platforms."; \ 101 echo ".Pp") > $@ 102 103.NOPATH: ${MAN} 104${MAN}: make.1 my.history 105 @echo making $@ 106 @sed \ 107 -e '/^.Dt/s/MAKE/${PROG:tu}/' \ 108 -e 's/^.Nx/NetBSD/' \ 109 -e '/^.Nm/s/make/${PROG}/' \ 110 -e '/^.Sh HISTORY/rmy.history' \ 111 -e '/^.Sh HISTORY/,$$s,^.Nm,make,' ${srcdir}/make.1 > $@ 112 113all beforeinstall: ${MAN} 114_mfromdir=. 115.endif 116.endif 117 118MANTARGET?= cat 119MANDEST?= ${MANDIR}/${MANTARGET}1 120 121.if ${MANTARGET} == "cat" 122_mfromdir=${srcdir} 123.endif 124 125.include <bsd.prog.mk> 126 127CPPFLAGS+= -DMAKE_NATIVE -DHAVE_CONFIG_H 128COPTS.var.c += -Wno-cast-qual 129COPTS.job.c += -Wno-format-nonliteral 130COPTS.parse.c += -Wno-format-nonliteral 131COPTS.var.c += -Wno-format-nonliteral 132 133# Force these 134SHAREDIR= ${SHAREDIR.bmake:U${prefix}/share} 135BINDIR= ${BINDIR.bmake:U${prefix}/bin} 136MANDIR= ${MANDIR.bmake:U${SHAREDIR}/man} 137 138.if !exists(.depend) 139${OBJS}: config.h 140.endif 141 142 143# A simple unit-test driver to help catch regressions 144TEST_MAKE ?= ${.OBJDIR}/${PROG:T} 145accept test: 146 cd ${.CURDIR}/unit-tests && \ 147 MAKEFLAGS= ${TEST_MAKE} -r -m / ${.TARGET} ${TESTS:DTESTS=${TESTS:Q}} 148 149 150# override some simple things 151BINDIR= /usr/bin 152MANDIR= /usr/share/man/man 153 154# make sure we get this 155CFLAGS+= ${COPTS.${.IMPSRC:T}} 156 157after-import: ${SRCTOP}/contrib/bmake/bsd.after-import.mk 158 cd ${.CURDIR} && ${.MAKE} -f ${SRCTOP}/contrib/bmake/bsd.after-import.mk 159 160