1241279Smarcel# This is a generated file, do NOT edit!
2241279Smarcel# See contrib/bmake/bsd.after-import.mk
3241279Smarcel#
4241279Smarcel# $FreeBSD$
5241279Smarcel
6241279Smarcel.sinclude "Makefile.inc"
7241279Smarcel
8241279SmarcelSRCTOP?= ${.CURDIR:H:H}
9241279Smarcel
10241279Smarcel# look here first for config.h
11241279SmarcelCFLAGS+= -I${.CURDIR}
12241279Smarcel
13246223Ssjg# for after-import
14246223SsjgCLEANDIRS+= FreeBSD
15246223SsjgCLEANFILES+= bootstrap
16241279Smarcel
17255253Ssjg#	$Id: Makefile,v 1.20 2013/09/04 15:42:03 sjg Exp $
18241279Smarcel
19246223Ssjg# Base version on src date
20255253SsjgMAKE_VERSION= 20130904
21246223Ssjg
22241279SmarcelPROG?=	${.CURDIR:T}
23241279Smarcel
24246223SsjgSRCS= \
25246223Ssjg	arch.c \
26246223Ssjg	buf.c \
27246223Ssjg	compat.c \
28246223Ssjg	cond.c \
29246223Ssjg	dir.c \
30246223Ssjg	for.c \
31246223Ssjg	hash.c \
32246223Ssjg	job.c \
33246223Ssjg	main.c \
34246223Ssjg	make.c \
35246223Ssjg	make_malloc.c \
36246223Ssjg	meta.c \
37246223Ssjg	parse.c \
38246223Ssjg	str.c \
39246223Ssjg	strlist.c \
40246223Ssjg	suff.c \
41246223Ssjg	targ.c \
42246223Ssjg	trace.c \
43246223Ssjg	util.c \
44246223Ssjg	var.c
45241279Smarcel
46246223Ssjg# from lst.lib/
47246223SsjgSRCS+= \
48246223Ssjg	lstAppend.c \
49246223Ssjg	lstAtEnd.c \
50246223Ssjg	lstAtFront.c \
51246223Ssjg	lstClose.c \
52246223Ssjg	lstConcat.c \
53246223Ssjg	lstDatum.c \
54246223Ssjg	lstDeQueue.c \
55246223Ssjg	lstDestroy.c \
56246223Ssjg	lstDupl.c \
57246223Ssjg	lstEnQueue.c \
58246223Ssjg	lstFind.c \
59246223Ssjg	lstFindFrom.c \
60246223Ssjg	lstFirst.c \
61246223Ssjg	lstForEach.c \
62246223Ssjg	lstForEachFrom.c \
63246223Ssjg	lstInit.c \
64246223Ssjg	lstInsert.c \
65246223Ssjg	lstIsAtEnd.c \
66246223Ssjg	lstIsEmpty.c \
67246223Ssjg	lstLast.c \
68246223Ssjg	lstMember.c \
69246223Ssjg	lstNext.c \
70246223Ssjg	lstOpen.c \
71246223Ssjg	lstPrev.c \
72246223Ssjg	lstRemove.c \
73246223Ssjg	lstReplace.c \
74246223Ssjg	lstSucc.c
75241279Smarcel
76246223Ssjg# this file gets generated by configure
77246223Ssjg.sinclude "Makefile.config"
78241279Smarcel
79241279Smarcel.if !empty(LIBOBJS)
80241279SmarcelSRCS+= ${LIBOBJS:T:.o=.c}
81241279Smarcel.endif
82241279Smarcel
83246223Ssjg# just in case
84246223Ssjgprefix?= /usr
85246223Ssjgsrcdir?= ${.CURDIR}
86246223Ssjg
87246223SsjgDEFAULT_SYS_PATH?= .../share/mk:${prefix}/share/mk
88246223Ssjg
89241279SmarcelCPPFLAGS+= -DUSE_META
90246223SsjgCFLAGS+= ${CPPFLAGS}
91246223SsjgCFLAGS+= -D_PATH_DEFSYSPATH=\"${DEFAULT_SYS_PATH}\"
92246223SsjgCFLAGS+= -I. -I${srcdir} ${XDEFS} -DMAKE_NATIVE
93246223SsjgCFLAGS+= ${COPTS.${.ALLSRC:M*.c:T:u}}
94246223SsjgCOPTS.main.c+= "-DMAKE_VERSION=\"${MAKE_VERSION}\""
95246223Ssjg
96246223Ssjg# meta mode can be useful even without filemon 
97241279SmarcelFILEMON_H ?= /usr/include/dev/filemon/filemon.h
98241279Smarcel.if exists(${FILEMON_H}) && ${FILEMON_H:T} == "filemon.h"
99241279SmarcelCOPTS.meta.c += -DHAVE_FILEMON_H -I${FILEMON_H:H}
100241279Smarcel.endif
101241279Smarcel
102241279Smarcel.PATH:	${srcdir}
103241279Smarcel.PATH:	${srcdir}/lst.lib
104241279Smarcel
105241279Smarcel.if make(obj) || make(clean)
106241279SmarcelSUBDIR+= unit-tests
107241279Smarcel.endif
108241279Smarcel
109241279Smarcel
110246223SsjgMAN= ${PROG}.1
111246223SsjgMAN1= ${MAN}
112241279Smarcel
113241279Smarcel.if (${PROG} != "make")
114246223SsjgCLEANFILES+= my.history
115246223Ssjg.if make(${MAN}) || !exists(${srcdir}/${MAN})
116242102Ssjgmy.history: ${MAKEFILE}
117242102Ssjg	@(echo ".Nm"; \
118241279Smarcel	echo "is derived from NetBSD"; \
119241279Smarcel	echo ".Xr make 1 ."; \
120242102Ssjg	echo "It uses autoconf to facilitate portability to other platforms."; \
121242102Ssjg	echo ".Pp") > $@
122241279Smarcel
123246223Ssjg.NOPATH: ${MAN}
124242102Ssjg${MAN}:	make.1 my.history
125246223Ssjg	@echo making $@
126242102Ssjg	@sed -e 's/^.Nx/NetBSD/' -e '/^.Nm/s/make/${PROG}/' \
127242102Ssjg	-e '/^.Sh HISTORY/rmy.history' \
128242102Ssjg	-e '/^.Sh HISTORY/,$$s,^.Nm,make,' ${srcdir}/make.1 > $@
129242102Ssjg
130246223Ssjgall beforeinstall: ${MAN}
131246223Ssjg_mfromdir=.
132241279Smarcel.endif
133241279Smarcel.endif
134241279Smarcel
135241279SmarcelMANTARGET?= cat
136241279SmarcelMANDEST?= ${MANDIR}/${MANTARGET}1
137241279Smarcel
138241279Smarcel.if ${MANTARGET} == "cat"
139241279Smarcel_mfromdir=${srcdir}
140241279Smarcel.endif
141241279Smarcel
142246223Ssjg.include <bsd.prog.mk>
143241279Smarcel
144246223SsjgCPPFLAGS+= -DMAKE_NATIVE -DHAVE_CONFIG_H
145241279SmarcelCOPTS.var.c += -Wno-cast-qual
146241279SmarcelCOPTS.job.c += -Wno-format-nonliteral
147241279SmarcelCOPTS.parse.c += -Wno-format-nonliteral
148241279SmarcelCOPTS.var.c += -Wno-format-nonliteral
149241279Smarcel
150241279Smarcel# Force these
151246223SsjgSHAREDIR= ${prefix}/share
152241279SmarcelBINDIR= ${prefix}/bin
153246223SsjgMANDIR= ${SHAREDIR}/man
154241279Smarcel
155246223Ssjg.if !exists(.depend)
156246223Ssjg${OBJS}: config.h
157246223Ssjg.endif
158246223Ssjg
159241279Smarcel# make sure that MAKE_VERSION gets updated.
160241279Smarcelmain.o: ${SRCS} ${MAKEFILE}
161241279Smarcel
162241279Smarcel
163241279Smarcel# A simple unit-test driver to help catch regressions
164241279Smarcelaccept test:
165241279Smarcel	cd ${.CURDIR}/unit-tests && MAKEFLAGS= ${.MAKE} -r -m / TEST_MAKE=${TEST_MAKE:U${.OBJDIR}/${PROG:T}} ${.TARGET}
166241279Smarcel
167241279Smarcel# override some simple things
168241279SmarcelBINDIR= /usr/bin
169241279SmarcelMANDIR= /usr/share/man/man
170255463SsjgDEFAULT_SYS_PATH= /usr/share/mk
171241279Smarcel
172241279Smarcel# make sure we get this
173241279SmarcelCFLAGS+= ${COPTS.${.IMPSRC:T}}
174241279Smarcel
175241279Smarcelafter-import: ${SRCTOP}/contrib/bmake/bsd.after-import.mk
176241279Smarcel	cd ${.CURDIR} && ${.MAKE} -f ${SRCTOP}/contrib/bmake/bsd.after-import.mk
177241279Smarcel
178