xref: /freebsd/usr.bin/bmake/Makefile (revision bc3f5ec90bde2f3a5e4021d133c89793d68b8c73)
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.23 2014/01/02 22:20:52 sjg Exp $
18
19# Base version on src date
20MAKE_VERSION= 20140101
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	parse.c \
38	str.c \
39	strlist.c \
40	suff.c \
41	targ.c \
42	trace.c \
43	util.c \
44	var.c
45
46# from lst.lib/
47SRCS+= \
48	lstAppend.c \
49	lstAtEnd.c \
50	lstAtFront.c \
51	lstClose.c \
52	lstConcat.c \
53	lstDatum.c \
54	lstDeQueue.c \
55	lstDestroy.c \
56	lstDupl.c \
57	lstEnQueue.c \
58	lstFind.c \
59	lstFindFrom.c \
60	lstFirst.c \
61	lstForEach.c \
62	lstForEachFrom.c \
63	lstInit.c \
64	lstInsert.c \
65	lstIsAtEnd.c \
66	lstIsEmpty.c \
67	lstLast.c \
68	lstMember.c \
69	lstNext.c \
70	lstOpen.c \
71	lstPrev.c \
72	lstRemove.c \
73	lstReplace.c \
74	lstSucc.c
75
76# this file gets generated by configure
77.sinclude "Makefile.config"
78
79.if !empty(LIBOBJS)
80SRCS+= ${LIBOBJS:T:.o=.c}
81.endif
82
83# just in case
84prefix?= /usr
85srcdir?= ${.CURDIR}
86
87DEFAULT_SYS_PATH?= ${prefix}/share/mk
88
89CPPFLAGS+= -DUSE_META
90CFLAGS+= ${CPPFLAGS}
91CFLAGS+= -D_PATH_DEFSYSPATH=\"${DEFAULT_SYS_PATH}\"
92CFLAGS+= -I. -I${srcdir} ${XDEFS} -DMAKE_NATIVE
93CFLAGS+= ${COPTS.${.ALLSRC:M*.c:T:u}}
94COPTS.main.c+= "-DMAKE_VERSION=\"${MAKE_VERSION}\""
95
96# meta mode can be useful even without filemon
97FILEMON_H ?= /usr/include/dev/filemon/filemon.h
98.if exists(${FILEMON_H}) && ${FILEMON_H:T} == "filemon.h"
99COPTS.meta.c += -DHAVE_FILEMON_H -I${FILEMON_H:H}
100.endif
101
102.PATH:	${srcdir}
103.PATH:	${srcdir}/lst.lib
104
105.if make(obj) || make(clean)
106SUBDIR+= unit-tests
107.endif
108
109
110MAN= ${PROG}.1
111MAN1= ${MAN}
112
113.if (${PROG} != "make")
114CLEANFILES+= my.history
115.if make(${MAN}) || !exists(${srcdir}/${MAN})
116my.history: ${MAKEFILE}
117	@(echo ".Nm"; \
118	echo "is derived from NetBSD"; \
119	echo ".Xr make 1 ."; \
120	echo "It uses autoconf to facilitate portability to other platforms."; \
121	echo ".Pp") > $@
122
123.NOPATH: ${MAN}
124${MAN}:	make.1 my.history
125	@echo making $@
126	@sed -e 's/^.Nx/NetBSD/' -e '/^.Nm/s/make/${PROG}/' \
127	-e '/^.Sh HISTORY/rmy.history' \
128	-e '/^.Sh HISTORY/,$$s,^.Nm,make,' ${srcdir}/make.1 > $@
129
130all beforeinstall: ${MAN}
131_mfromdir=.
132.endif
133.endif
134
135MANTARGET?= cat
136MANDEST?= ${MANDIR}/${MANTARGET}1
137
138.if ${MANTARGET} == "cat"
139_mfromdir=${srcdir}
140.endif
141
142.include <bsd.prog.mk>
143
144CPPFLAGS+= -DMAKE_NATIVE -DHAVE_CONFIG_H
145COPTS.var.c += -Wno-cast-qual
146COPTS.job.c += -Wno-format-nonliteral
147COPTS.parse.c += -Wno-format-nonliteral
148COPTS.var.c += -Wno-format-nonliteral
149
150# Force these
151SHAREDIR= ${prefix}/share
152BINDIR= ${prefix}/bin
153MANDIR= ${SHAREDIR}/man
154
155.if !exists(.depend)
156${OBJS}: config.h
157.endif
158
159# make sure that MAKE_VERSION gets updated.
160main.o: ${SRCS} ${MAKEFILE}
161
162
163# A simple unit-test driver to help catch regressions
164accept test:
165	cd ${.CURDIR}/unit-tests && MAKEFLAGS= ${.MAKE} -r -m / TEST_MAKE=${TEST_MAKE:U${.OBJDIR}/${PROG:T}} ${.TARGET}
166
167# override some simple things
168BINDIR= /usr/bin
169MANDIR= /usr/share/man/man
170DEFAULT_SYS_PATH= /usr/share/mk
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