xref: /freebsd/usr.bin/bmake/Makefile (revision 48c5129f93c5eb5419c87b08e4677d51513f1dc0)
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#	$NetBSD: Makefile,v 1.56 2012/05/30 21:54:23 sjg Exp $
14#	@(#)Makefile	5.2 (Berkeley) 12/28/90
15
16#	$Id: Makefile.in,v 1.174 2012/10/10 18:46:24 sjg Exp $
17
18PROG?=	${.CURDIR:T}
19SRCS=	arch.c buf.c compat.c cond.c dir.c for.c hash.c job.c main.c \
20	make.c parse.c str.c suff.c targ.c trace.c var.c util.c
21SRCS+=  strlist.c
22SRCS+=  make_malloc.c
23SRCS+=	lstAppend.c lstAtEnd.c lstAtFront.c lstClose.c lstConcat.c \
24	lstDatum.c lstDeQueue.c lstDestroy.c lstDupl.c lstEnQueue.c \
25	lstFind.c lstFindFrom.c lstFirst.c lstForEach.c lstForEachFrom.c \
26	lstInit.c lstInsert.c lstIsAtEnd.c lstIsEmpty.c lstLast.c \
27	lstMember.c lstNext.c lstOpen.c lstRemove.c lstReplace.c lstSucc.c
28SRCS += lstPrev.c
29
30# you can use this Makefile if you have an earlier version of bmake.
31prefix= /usr
32srcdir= ${SRCTOP}/contrib/bmake
33CC?= gcc
34
35# Base version on src date
36MAKE_VERSION= 20121010
37DEFAULT_SYS_PATH = .../share/mk:/usr/share/mk
38
39CPPFLAGS+=
40CFLAGS+= ${CPPFLAGS}
41CFLAGS+= -D_PATH_DEFSYSPATH=\"${DEFAULT_SYS_PATH}\"
42CFLAGS+= -I. -I${srcdir} -DHAVE_CONFIG_H ${XDEFS} -DMAKE_NATIVE
43CFLAGS+= ${CFLAGS_${.TARGET:T}}
44CFLAGS+= ${COPTS.${.ALLSRC:M*.c:T:u}}
45COPTS.main.c+= "-DMAKE_VERSION=\"${MAKE_VERSION}\""
46LDFLAGS=
47LIBOBJS=  ${LIBOBJDIR}stresep$U.o
48LDADD=
49
50.if !empty(LIBOBJS)
51SRCS+= ${LIBOBJS:T:.o=.c}
52.endif
53
54USE_META = yes
55.if ${USE_META} != "no"
56SRCS+=	meta.c
57CPPFLAGS+= -DUSE_META
58FILEMON_H ?= /usr/include/dev/filemon/filemon.h
59.if exists(${FILEMON_H}) && ${FILEMON_H:T} == "filemon.h"
60COPTS.meta.c += -DHAVE_FILEMON_H -I${FILEMON_H:H}
61.endif
62.endif
63
64.PATH:	${srcdir}
65.PATH:	${srcdir}/lst.lib
66
67OS!= uname -s
68ARCH!= uname -p 2>/dev/null || uname -m
69
70# list of OS's which are derrived from BSD4.4
71isBSD44= NetBSD FreeBSD OpenBSD DragonFly
72
73.if ${OS} == "NetBSD"
74# Don't set these for anyone else since we don't know what the effect may be.
75# On FreeBSD WARNS=2 sets a bunch of -W flags that make does not handle.
76WFORMAT= 1
77WARNS=4
78.NOPATH: bmake.cat1
79.if make(install) && exists(${DESTDIR}/usr/share/doc)
80SUBDIR=	PSD.doc
81.endif
82.endif
83
84.if defined(.PARSEDIR)
85# we cannot rely on anything but bmake to parse this correctly.
86.if empty(isBSD44:M${OS})
87MANTARGET=cat
88INSTALL?=${srcdir}/install-sh
89.if (${MACHINE} == "sun386")
90# even I don't have one of these anymore :-)
91CFLAGS+= -DPORTAR
92.elif (${MACHINE} != "sunos")
93SRCS+= sigcompat.c
94CFLAGS+= -DSIGNAL_FLAGS=SA_RESTART
95.endif
96.endif
97
98.if make(obj) || make(clean)
99SUBDIR+= unit-tests
100.endif
101.endif
102
103# many systems use gcc these days
104CC_IS_GCC=yes
105.if ${CC_IS_GCC} == "yes"
106# problem with gcc3
107CFLAGS_var.o+= -Wno-cast-qual
108.endif
109
110CFLAGS_main.o+= "-DMACHINE=\"${MACHINE}\"" "-DMACHINE_ARCH=\"${MACHINE_ARCH}\""
111
112EXTRACT_MAN=no
113
114MAN=${PROG}.1
115.if (${PROG} != "make")
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${MAN}:	make.1 my.history
124	@echo making ${PROG}.1
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
129.endif
130
131.if !empty(isBSD44:M${OS})
132.if "${OS}" != "NetBSD"
133MAN1=${MAN}
134.endif
135MANTARGET?=man
136.endif
137
138MANTARGET?= cat
139MANDEST?= ${MANDIR}/${MANTARGET}1
140
141.if ${MANTARGET} == "cat"
142_mfromdir=${srcdir}
143.endif
144
145.if exists(${srcdir}/../Makefile.inc)
146.include "${srcdir}/../Makefile.inc"
147.endif
148.sinclude <bsd.prog.mk>
149# sigh, FreeBSD at least includes bsd.subdir.mk via bsd.obj.mk
150# so the inclusion below, results in complaints about re-defined
151# targets.  For NetBSD though we need to explicitly include it.
152.if defined(.PARSEDIR)
153.if defined(SUBDIR) && !target(${SUBDIR:[1]})
154.sinclude <bsd.subdir.mk>
155.endif
156.endif
157
158CPPFLAGS+= -DMAKE_NATIVE
159COPTS.var.c += -Wno-cast-qual
160COPTS.job.c += -Wno-format-nonliteral
161COPTS.parse.c += -Wno-format-nonliteral
162COPTS.var.c += -Wno-format-nonliteral
163
164# Force these
165BINDIR= ${prefix}/bin
166MANDIR= ${prefix}/man
167
168arch.o:	config.h
169# make sure that MAKE_VERSION gets updated.
170main.o: ${SRCS} ${MAKEFILE}
171
172MK?=${prefix}/share/mk
173MKSRC?=mk
174INSTALL?=${srcdir}/install-sh
175
176beforeinstall:
177	test -d ${DESTDIR}${BINDIR} || ${INSTALL} -m 775 -d ${DESTDIR}${BINDIR}
178	test -d ${DESTDIR}${MANDEST} || ${INSTALL} -m 775 -d ${DESTDIR}${MANDEST}
179
180# latest version of *.mk includes an installer.
181# you should not need to  set USE_OS
182install-mk:
183.if exists(${MKSRC}/install-mk)
184	test -d ${DESTDIR}${MK} || ${INSTALL} -m 775 -d ${DESTDIR}${MK}
185	${MKSRC}/install-mk -v -m 644 ${DESTDIR}${MK} ${USE_OS}
186.else
187	@echo need to unpack mk.tar.gz under ${srcdir} or set MKSRC; false
188.endif
189
190.ifdef TOOLDIR
191# this is a native netbsd build,
192# use libutil rather than the local emalloc etc.
193CPPFLAGS+= -DUSE_EMALLOC
194LDADD+=-lutil
195DPADD+=${LIBUTIL}
196.endif
197
198# A simple unit-test driver to help catch regressions
199accept test:
200	cd ${.CURDIR}/unit-tests && MAKEFLAGS= ${.MAKE} -r -m / TEST_MAKE=${TEST_MAKE:U${.OBJDIR}/${PROG:T}} ${.TARGET}
201
202# override some simple things
203BINDIR= /usr/bin
204MANDIR= /usr/share/man/man
205
206# make sure we get this
207CFLAGS+= ${COPTS.${.IMPSRC:T}}
208CLEANFILES+= bootstrap
209
210after-import: ${SRCTOP}/contrib/bmake/bsd.after-import.mk
211	cd ${.CURDIR} && ${.MAKE} -f ${SRCTOP}/contrib/bmake/bsd.after-import.mk
212
213