kernel: Remove some unused variables in the serial drivers.
[dragonfly.git] / contrib / bmake / Makefile.in
blob4cb55dd85fb522f8ecc41187b0a66308e8f1dab8
1 # $NetBSD: Makefile,v 1.56 2012/05/30 21:54:23 sjg Exp $
2 # @(#)Makefile 5.2 (Berkeley) 12/28/90
4 # $Id: Makefile.in,v 1.174 2012/10/10 18:46:24 sjg Exp $
6 PROG= bmake
7 SRCS= arch.c buf.c compat.c cond.c dir.c for.c hash.c job.c main.c \
8 make.c parse.c str.c suff.c targ.c trace.c var.c util.c
9 SRCS+= strlist.c
10 SRCS+= make_malloc.c
11 SRCS+= lstAppend.c lstAtEnd.c lstAtFront.c lstClose.c lstConcat.c \
12 lstDatum.c lstDeQueue.c lstDestroy.c lstDupl.c lstEnQueue.c \
13 lstFind.c lstFindFrom.c lstFirst.c lstForEach.c lstForEachFrom.c \
14 lstInit.c lstInsert.c lstIsAtEnd.c lstIsEmpty.c lstLast.c \
15 lstMember.c lstNext.c lstOpen.c lstRemove.c lstReplace.c lstSucc.c
16 SRCS += lstPrev.c
18 # you can use this Makefile if you have an earlier version of bmake.
19 prefix= @prefix@
20 srcdir= @srcdir@
21 CC?= @CC@
23 # Base version on src date
24 MAKE_VERSION= 20121010
25 MACHINE=@machine@
26 MACHINE_ARCH=@machine_arch@
27 DEFAULT_SYS_PATH = @default_sys_path@
29 CPPFLAGS+= @CPPFLAGS@
30 CFLAGS+= ${CPPFLAGS}
31 CFLAGS+= -D_PATH_DEFSYSPATH=\"${DEFAULT_SYS_PATH}\"
32 CFLAGS+= -I. -I${srcdir} @DEFS@ ${XDEFS} -DMAKE_NATIVE
33 CFLAGS+= ${CFLAGS_${.TARGET:T}}
34 CFLAGS+= ${COPTS.${.ALLSRC:M*.c:T:u}}
35 COPTS.main.c+= "-DMAKE_VERSION=\"${MAKE_VERSION}\""
36 LDFLAGS= @LDFLAGS@
37 LIBOBJS= @LIBOBJS@
38 LDADD= @LIBS@
40 .if !empty(LIBOBJS)
41 SRCS+= ${LIBOBJS:T:.o=.c}
42 .endif
44 USE_META = @use_meta@
45 .if ${USE_META} != "no"
46 SRCS+= meta.c
47 CPPFLAGS+= -DUSE_META
48 FILEMON_H ?= @filemon_h@
49 .if exists(${FILEMON_H}) && ${FILEMON_H:T} == "filemon.h"
50 COPTS.meta.c += -DHAVE_FILEMON_H -I${FILEMON_H:H}
51 .endif
52 .endif
54 .PATH: ${srcdir}
55 .PATH: ${srcdir}/lst.lib
57 OS!= uname -s
58 ARCH!= uname -p 2>/dev/null || uname -m
60 # list of OS's which are derrived from BSD4.4
61 isBSD44= NetBSD FreeBSD OpenBSD DragonFly
63 .if ${OS} == "NetBSD"
64 # Don't set these for anyone else since we don't know what the effect may be.
65 # On FreeBSD WARNS=2 sets a bunch of -W flags that make does not handle.
66 WFORMAT= 1
67 WARNS=4
68 .NOPATH: bmake.cat1
69 .if make(install) && exists(${DESTDIR}/usr/share/doc)
70 SUBDIR= PSD.doc
71 .endif
72 .endif
74 .if defined(.PARSEDIR)
75 # we cannot rely on anything but bmake to parse this correctly.
76 .if empty(isBSD44:M${OS})
77 MANTARGET=cat
78 INSTALL?=${srcdir}/install-sh
79 .if (${MACHINE} == "sun386")
80 # even I don't have one of these anymore :-)
81 CFLAGS+= -DPORTAR
82 .elif (${MACHINE} != "sunos")
83 SRCS+= sigcompat.c
84 CFLAGS+= -DSIGNAL_FLAGS=SA_RESTART
85 .endif
86 .endif
88 .if make(obj) || make(clean)
89 SUBDIR+= unit-tests
90 .endif
91 .endif
93 # many systems use gcc these days
94 CC_IS_GCC=@GCC@
95 .if ${CC_IS_GCC} == "yes"
96 # problem with gcc3
97 CFLAGS_var.o+= -Wno-cast-qual
98 .endif
100 CFLAGS_main.o+= "-D@force_machine@MACHINE=\"${MACHINE}\"" "-DMACHINE_ARCH=\"${MACHINE_ARCH}\""
102 EXTRACT_MAN=no
104 MAN=${PROG}.1
105 .if (${PROG} != "make")
106 my.history: ${MAKEFILE}
107 @(echo ".Nm"; \
108 echo "is derived from NetBSD"; \
109 echo ".Xr make 1 ."; \
110 echo "It uses autoconf to facilitate portability to other platforms."; \
111 echo ".Pp") > $@
113 ${MAN}: make.1 my.history
114 @echo making ${PROG}.1
115 @sed -e 's/^.Nx/NetBSD/' -e '/^.Nm/s/make/${PROG}/' \
116 -e '/^.Sh HISTORY/rmy.history' \
117 -e '/^.Sh HISTORY/,$$s,^.Nm,make,' ${.CURDIR}/make.1 > $@
119 .endif
121 .if !empty(isBSD44:M${OS})
122 .if "${OS}" != "NetBSD"
123 MAN1=${MAN}
124 .endif
125 MANTARGET?=man
126 .endif
128 MANTARGET?= cat
129 MANDEST?= ${MANDIR}/${MANTARGET}1
131 .if ${MANTARGET} == "cat"
132 _mfromdir=${srcdir}
133 .endif
135 .if exists(${srcdir}/../Makefile.inc)
136 .include "${srcdir}/../Makefile.inc"
137 .endif
138 .-include <bsd.prog.mk>
139 # sigh, FreeBSD at least includes bsd.subdir.mk via bsd.obj.mk
140 # so the inclusion below, results in complaints about re-defined
141 # targets. For NetBSD though we need to explicitly include it.
142 .if defined(.PARSEDIR)
143 .if defined(SUBDIR) && !target(${SUBDIR:[1]})
144 .-include <bsd.subdir.mk>
145 .endif
146 .endif
148 CPPFLAGS+= -DMAKE_NATIVE
149 COPTS.var.c += -Wno-cast-qual
150 COPTS.job.c += -Wno-format-nonliteral
151 COPTS.parse.c += -Wno-format-nonliteral
152 COPTS.var.c += -Wno-format-nonliteral
154 # Force these
155 BINDIR= ${prefix}/bin
156 MANDIR= ${prefix}/man
158 arch.o: config.h
159 # make sure that MAKE_VERSION gets updated.
160 main.o: ${SRCS} ${MAKEFILE}
162 MK?=${prefix}/share/mk
163 MKSRC?=@mksrc@
164 INSTALL?=${srcdir}/install-sh
166 beforeinstall:
167 test -d ${DESTDIR}${BINDIR} || ${INSTALL} -m 775 -d ${DESTDIR}${BINDIR}
168 test -d ${DESTDIR}${MANDEST} || ${INSTALL} -m 775 -d ${DESTDIR}${MANDEST}
170 # latest version of *.mk includes an installer.
171 # you should not need to set USE_OS
172 install-mk:
173 .if exists(${MKSRC}/install-mk)
174 test -d ${DESTDIR}${MK} || ${INSTALL} -m 775 -d ${DESTDIR}${MK}
175 ${MKSRC}/install-mk -v -m 644 ${DESTDIR}${MK} ${USE_OS}
176 .else
177 @echo need to unpack mk.tar.gz under ${srcdir} or set MKSRC; false
178 .endif
180 .ifdef TOOLDIR
181 # this is a native netbsd build,
182 # use libutil rather than the local emalloc etc.
183 CPPFLAGS+= -DUSE_EMALLOC
184 LDADD+=-lutil
185 DPADD+=${LIBUTIL}
186 .endif
188 # A simple unit-test driver to help catch regressions
189 accept test:
190 cd ${.CURDIR}/unit-tests && MAKEFLAGS= ${.MAKE} -r -m / TEST_MAKE=${TEST_MAKE:U${.OBJDIR}/${PROG:T}} ${.TARGET}