2012-10-06 19:19:21 +00:00
|
|
|
# This is a generated file, do NOT edit!
|
|
|
|
# See contrib/bmake/bsd.after-import.mk
|
|
|
|
#
|
|
|
|
# $FreeBSD$
|
|
|
|
|
|
|
|
.sinclude "Makefile.inc"
|
|
|
|
|
|
|
|
SRCTOP?= ${.CURDIR:H:H}
|
|
|
|
|
|
|
|
# look here first for config.h
|
|
|
|
CFLAGS+= -I${.CURDIR}
|
|
|
|
|
2013-02-01 22:55:27 +00:00
|
|
|
# for after-import
|
|
|
|
CLEANDIRS+= FreeBSD
|
|
|
|
CLEANFILES+= bootstrap
|
2012-10-06 19:19:21 +00:00
|
|
|
|
2016-06-08 17:51:21 +00:00
|
|
|
# $Id: Makefile,v 1.67 2016/06/07 00:46:12 sjg Exp $
|
2012-10-06 19:19:21 +00:00
|
|
|
|
|
|
|
# Base version on src date
|
2016-06-08 17:51:21 +00:00
|
|
|
_MAKE_VERSION= 20160606
|
2012-10-06 19:19:21 +00:00
|
|
|
|
2013-02-01 22:55:27 +00:00
|
|
|
PROG?= ${.CURDIR:T}
|
|
|
|
|
|
|
|
SRCS= \
|
|
|
|
arch.c \
|
|
|
|
buf.c \
|
|
|
|
compat.c \
|
|
|
|
cond.c \
|
|
|
|
dir.c \
|
|
|
|
for.c \
|
|
|
|
hash.c \
|
|
|
|
job.c \
|
|
|
|
main.c \
|
|
|
|
make.c \
|
|
|
|
make_malloc.c \
|
|
|
|
meta.c \
|
2015-10-23 17:38:01 +00:00
|
|
|
metachar.c \
|
2013-02-01 22:55:27 +00:00
|
|
|
parse.c \
|
|
|
|
str.c \
|
|
|
|
strlist.c \
|
|
|
|
suff.c \
|
|
|
|
targ.c \
|
|
|
|
trace.c \
|
|
|
|
util.c \
|
|
|
|
var.c
|
|
|
|
|
|
|
|
# from lst.lib/
|
|
|
|
SRCS+= \
|
|
|
|
lstAppend.c \
|
|
|
|
lstAtEnd.c \
|
|
|
|
lstAtFront.c \
|
|
|
|
lstClose.c \
|
|
|
|
lstConcat.c \
|
|
|
|
lstDatum.c \
|
|
|
|
lstDeQueue.c \
|
|
|
|
lstDestroy.c \
|
|
|
|
lstDupl.c \
|
|
|
|
lstEnQueue.c \
|
|
|
|
lstFind.c \
|
|
|
|
lstFindFrom.c \
|
|
|
|
lstFirst.c \
|
|
|
|
lstForEach.c \
|
|
|
|
lstForEachFrom.c \
|
|
|
|
lstInit.c \
|
|
|
|
lstInsert.c \
|
|
|
|
lstIsAtEnd.c \
|
|
|
|
lstIsEmpty.c \
|
|
|
|
lstLast.c \
|
|
|
|
lstMember.c \
|
|
|
|
lstNext.c \
|
|
|
|
lstOpen.c \
|
|
|
|
lstPrev.c \
|
|
|
|
lstRemove.c \
|
|
|
|
lstReplace.c \
|
|
|
|
lstSucc.c
|
|
|
|
|
|
|
|
# this file gets generated by configure
|
|
|
|
.sinclude "Makefile.config"
|
2012-10-06 19:19:21 +00:00
|
|
|
|
|
|
|
.if !empty(LIBOBJS)
|
|
|
|
SRCS+= ${LIBOBJS:T:.o=.c}
|
|
|
|
.endif
|
|
|
|
|
2013-02-01 22:55:27 +00:00
|
|
|
# just in case
|
|
|
|
prefix?= /usr
|
|
|
|
srcdir?= ${.CURDIR}
|
|
|
|
|
2014-01-27 17:47:21 +00:00
|
|
|
DEFAULT_SYS_PATH?= ${prefix}/share/mk
|
2013-02-01 22:55:27 +00:00
|
|
|
|
2012-10-06 19:19:21 +00:00
|
|
|
CPPFLAGS+= -DUSE_META
|
2013-02-01 22:55:27 +00:00
|
|
|
CFLAGS+= ${CPPFLAGS}
|
|
|
|
CFLAGS+= -D_PATH_DEFSYSPATH=\"${DEFAULT_SYS_PATH}\"
|
|
|
|
CFLAGS+= -I. -I${srcdir} ${XDEFS} -DMAKE_NATIVE
|
|
|
|
CFLAGS+= ${COPTS.${.ALLSRC:M*.c:T:u}}
|
2016-03-11 04:09:50 +00:00
|
|
|
COPTS.main.c+= "-DMAKE_VERSION=\"${_MAKE_VERSION}\""
|
2013-02-01 22:55:27 +00:00
|
|
|
|
|
|
|
# meta mode can be useful even without filemon
|
2012-10-06 19:19:21 +00:00
|
|
|
FILEMON_H ?= /usr/include/dev/filemon/filemon.h
|
|
|
|
.if exists(${FILEMON_H}) && ${FILEMON_H:T} == "filemon.h"
|
|
|
|
COPTS.meta.c += -DHAVE_FILEMON_H -I${FILEMON_H:H}
|
|
|
|
.endif
|
|
|
|
|
|
|
|
.PATH: ${srcdir}
|
|
|
|
.PATH: ${srcdir}/lst.lib
|
|
|
|
|
|
|
|
.if make(obj) || make(clean)
|
|
|
|
SUBDIR+= unit-tests
|
|
|
|
.endif
|
|
|
|
|
2014-07-08 22:27:50 +00:00
|
|
|
|
2013-02-01 22:55:27 +00:00
|
|
|
MAN= ${PROG}.1
|
|
|
|
MAN1= ${MAN}
|
2012-10-06 19:19:21 +00:00
|
|
|
|
|
|
|
.if (${PROG} != "make")
|
2013-02-01 22:55:27 +00:00
|
|
|
CLEANFILES+= my.history
|
|
|
|
.if make(${MAN}) || !exists(${srcdir}/${MAN})
|
2012-10-25 20:31:22 +00:00
|
|
|
my.history: ${MAKEFILE}
|
|
|
|
@(echo ".Nm"; \
|
2012-10-06 19:19:21 +00:00
|
|
|
echo "is derived from NetBSD"; \
|
|
|
|
echo ".Xr make 1 ."; \
|
2012-10-25 20:31:22 +00:00
|
|
|
echo "It uses autoconf to facilitate portability to other platforms."; \
|
|
|
|
echo ".Pp") > $@
|
|
|
|
|
2013-02-01 22:55:27 +00:00
|
|
|
.NOPATH: ${MAN}
|
2012-10-25 20:31:22 +00:00
|
|
|
${MAN}: make.1 my.history
|
2013-02-01 22:55:27 +00:00
|
|
|
@echo making $@
|
2012-10-25 20:31:22 +00:00
|
|
|
@sed -e 's/^.Nx/NetBSD/' -e '/^.Nm/s/make/${PROG}/' \
|
|
|
|
-e '/^.Sh HISTORY/rmy.history' \
|
2012-10-25 23:18:05 +00:00
|
|
|
-e '/^.Sh HISTORY/,$$s,^.Nm,make,' ${srcdir}/make.1 > $@
|
2012-10-06 19:19:21 +00:00
|
|
|
|
2013-02-01 22:55:27 +00:00
|
|
|
all beforeinstall: ${MAN}
|
|
|
|
_mfromdir=.
|
2012-10-06 19:19:21 +00:00
|
|
|
.endif
|
|
|
|
.endif
|
|
|
|
|
|
|
|
MANTARGET?= cat
|
|
|
|
MANDEST?= ${MANDIR}/${MANTARGET}1
|
|
|
|
|
|
|
|
.if ${MANTARGET} == "cat"
|
|
|
|
_mfromdir=${srcdir}
|
|
|
|
.endif
|
|
|
|
|
2013-02-01 22:55:27 +00:00
|
|
|
.include <bsd.prog.mk>
|
2012-10-06 19:19:21 +00:00
|
|
|
|
2013-02-01 22:55:27 +00:00
|
|
|
CPPFLAGS+= -DMAKE_NATIVE -DHAVE_CONFIG_H
|
2012-10-06 19:19:21 +00:00
|
|
|
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}
|
2013-02-01 22:55:27 +00:00
|
|
|
|
|
|
|
.if !exists(.depend)
|
|
|
|
${OBJS}: config.h
|
|
|
|
.endif
|
2012-10-06 19:19:21 +00:00
|
|
|
|
|
|
|
# make sure that MAKE_VERSION gets updated.
|
|
|
|
main.o: ${SRCS} ${MAKEFILE}
|
|
|
|
|
|
|
|
|
|
|
|
# A simple unit-test driver to help catch regressions
|
|
|
|
accept test:
|
|
|
|
cd ${.CURDIR}/unit-tests && MAKEFLAGS= ${.MAKE} -r -m / TEST_MAKE=${TEST_MAKE:U${.OBJDIR}/${PROG:T}} ${.TARGET}
|
|
|
|
|
|
|
|
# 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
|
|
|
|
|