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