1#	$NetBSD: Makefile,v 1.59 2016/02/18 20:33:40 sjg Exp $
2#	@(#)Makefile	5.2 (Berkeley) 12/28/90
3
4PROG=	make
5SRCS=	arch.c buf.c compat.c cond.c dir.c for.c hash.c job.c main.c \
6	make.c metachar.c parse.c str.c suff.c targ.c trace.c var.c util.c
7SRCS+=  strlist.c
8SRCS+=  make_malloc.c
9SRCS+=	lstAppend.c lstAtEnd.c lstAtFront.c lstClose.c lstConcat.c \
10	lstDatum.c lstDeQueue.c lstDestroy.c lstDupl.c lstEnQueue.c \
11	lstFind.c lstFindFrom.c lstFirst.c lstForEach.c lstForEachFrom.c \
12	lstInit.c lstInsert.c lstIsAtEnd.c lstIsEmpty.c lstLast.c \
13	lstMember.c lstNext.c lstOpen.c lstRemove.c lstReplace.c lstSucc.c
14SRCS += lstPrev.c
15
16USE_META ?= yes
17.if ${USE_META:tl} != "no"
18SRCS+=	meta.c
19CPPFLAGS+= -DUSE_META
20FILEMON_H ?= ${.CURDIR:H:H}/sys/dev/filemon/filemon.h
21.if exists(${FILEMON_H}) && ${FILEMON_H:T} == "filemon.h"
22COPTS.meta.c += -DHAVE_FILEMON_H -I${FILEMON_H:H}
23.endif
24.endif
25
26.PATH:	${.CURDIR}/lst.lib
27SUBDIR=	PSD.doc
28.if make(obj) || make(clean)
29SUBDIR+= unit-tests
30.endif
31
32.include <bsd.prog.mk>
33.include <bsd.subdir.mk>
34
35CPPFLAGS+= -DMAKE_NATIVE
36COPTS.var.c += -Wno-cast-qual
37COPTS.job.c += -Wno-format-nonliteral
38COPTS.parse.c += -Wno-format-nonliteral
39COPTS.var.c += -Wno-format-nonliteral
40
41.ifdef TOOLDIR
42# this is a native netbsd build,
43# use libutil rather than the local emalloc etc.
44CPPFLAGS+= -DUSE_EMALLOC
45LDADD+=-lutil
46DPADD+=${LIBUTIL}
47.endif
48
49# A simple unit-test driver to help catch regressions
50accept test:
51	cd ${.CURDIR}/unit-tests && MAKEFLAGS= ${.MAKE} -r -m / TEST_MAKE=${TEST_MAKE:U${.OBJDIR}/${PROG:T}} ${.TARGET}
52