xref: /freebsd/usr.bin/bmake/Makefile (revision 0572ccaa4543b0abef8ef81e384c1d04de9f3da1)
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
109MAN= ${PROG}.1
110MAN1= ${MAN}
111
112.if (${PROG} != "make")
113CLEANFILES+= my.history
114.if make(${MAN}) || !exists(${srcdir}/${MAN})
115my.history: ${MAKEFILE}
116	@(echo ".Nm"; \
117	echo "is derived from NetBSD"; \
118	echo ".Xr make 1 ."; \
119	echo "It uses autoconf to facilitate portability to other platforms."; \
120	echo ".Pp") > $@
121
122.NOPATH: ${MAN}
123${MAN}:	make.1 my.history
124	@echo making $@
125	@sed -e 's/^.Nx/NetBSD/' -e '/^.Nm/s/make/${PROG}/' \
126	-e '/^.Sh HISTORY/rmy.history' \
127	-e '/^.Sh HISTORY/,$$s,^.Nm,make,' ${srcdir}/make.1 > $@
128
129all beforeinstall: ${MAN}
130_mfromdir=.
131.endif
132.endif
133
134MANTARGET?= cat
135MANDEST?= ${MANDIR}/${MANTARGET}1
136
137.if ${MANTARGET} == "cat"
138_mfromdir=${srcdir}
139.endif
140
141.include <bsd.prog.mk>
142
143CPPFLAGS+= -DMAKE_NATIVE -DHAVE_CONFIG_H
144COPTS.var.c += -Wno-cast-qual
145COPTS.job.c += -Wno-format-nonliteral
146COPTS.parse.c += -Wno-format-nonliteral
147COPTS.var.c += -Wno-format-nonliteral
148
149# Force these
150SHAREDIR= ${prefix}/share
151BINDIR= ${prefix}/bin
152MANDIR= ${SHAREDIR}/man
153
154.if !exists(.depend)
155${OBJS}: config.h
156.endif
157
158# make sure that MAKE_VERSION gets updated.
159main.o: ${SRCS} ${MAKEFILE}
160
161
162# A simple unit-test driver to help catch regressions
163accept test:
164	cd ${.CURDIR}/unit-tests && MAKEFLAGS= ${.MAKE} -r -m / TEST_MAKE=${TEST_MAKE:U${.OBJDIR}/${PROG:T}} ${.TARGET}
165
166# override some simple things
167BINDIR= /usr/bin
168MANDIR= /usr/share/man/man
169DEFAULT_SYS_PATH= /usr/share/mk
170
171# make sure we get this
172CFLAGS+= ${COPTS.${.IMPSRC:T}}
173
174after-import: ${SRCTOP}/contrib/bmake/bsd.after-import.mk
175	cd ${.CURDIR} && ${.MAKE} -f ${SRCTOP}/contrib/bmake/bsd.after-import.mk
176
177