xref: /freebsd/usr.bin/bmake/Makefile (revision 273c26a3c3bea87a241d6879abd4f991db180bf0)
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.72 2016/08/18 23:02:26 sjg Exp $
18
19# Base version on src date
20_MAKE_VERSION= 20160818
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 -e 's/^.Nx/NetBSD/' -e '/^.Nm/s/make/${PROG}/' \
128	-e '/^.Sh HISTORY/rmy.history' \
129	-e '/^.Sh HISTORY/,$$s,^.Nm,make,' ${srcdir}/make.1 > $@
130
131all beforeinstall: ${MAN}
132_mfromdir=.
133.endif
134.endif
135
136MANTARGET?= cat
137MANDEST?= ${MANDIR}/${MANTARGET}1
138
139.if ${MANTARGET} == "cat"
140_mfromdir=${srcdir}
141.endif
142
143.include <bsd.prog.mk>
144
145CPPFLAGS+= -DMAKE_NATIVE -DHAVE_CONFIG_H
146COPTS.var.c += -Wno-cast-qual
147COPTS.job.c += -Wno-format-nonliteral
148COPTS.parse.c += -Wno-format-nonliteral
149COPTS.var.c += -Wno-format-nonliteral
150
151# Force these
152SHAREDIR= ${SHAREDIR.bmake:U${prefix}/share}
153BINDIR= ${BINDIR.bmake:U${prefix}/bin}
154MANDIR= ${MANDIR.bmake:U${SHAREDIR}/man}
155
156.if !exists(.depend)
157${OBJS}: config.h
158.endif
159
160# make sure that MAKE_VERSION gets updated.
161main.o: ${SRCS} ${MAKEFILE}
162
163
164# A simple unit-test driver to help catch regressions
165accept test:
166	cd ${.CURDIR}/unit-tests && MAKEFLAGS= ${.MAKE} -r -m / TEST_MAKE=${TEST_MAKE:U${.OBJDIR}/${PROG:T}} ${.TARGET}
167
168# override some simple things
169BINDIR= /usr/bin
170MANDIR= /usr/share/man/man
171
172# make sure we get this
173CFLAGS+= ${COPTS.${.IMPSRC:T}}
174
175after-import: ${SRCTOP}/contrib/bmake/bsd.after-import.mk
176	cd ${.CURDIR} && ${.MAKE} -f ${SRCTOP}/contrib/bmake/bsd.after-import.mk
177
178