Makefile revision 1.68
11.68Sriastrad#	$NetBSD: Makefile,v 1.68 2020/01/19 19:50:54 riastradh Exp $
21.8Schristos#	@(#)Makefile	5.2 (Berkeley) 12/28/90
31.1Scgd
41.1ScgdPROG=	make
51.4ScgdSRCS=	arch.c buf.c compat.c cond.c dir.c for.c hash.c job.c main.c \
61.58Schristos	make.c metachar.c parse.c str.c suff.c targ.c trace.c var.c util.c 
71.45SdslSRCS+=  strlist.c
81.46SdslSRCS+=  make_malloc.c
91.1ScgdSRCS+=	lstAppend.c lstAtEnd.c lstAtFront.c lstClose.c lstConcat.c \
101.1Scgd	lstDatum.c lstDeQueue.c lstDestroy.c lstDupl.c lstEnQueue.c \
111.1Scgd	lstFind.c lstFindFrom.c lstFirst.c lstForEach.c lstForEachFrom.c \
121.1Scgd	lstInit.c lstInsert.c lstIsAtEnd.c lstIsEmpty.c lstLast.c \
131.1Scgd	lstMember.c lstNext.c lstOpen.c lstRemove.c lstReplace.c lstSucc.c
141.40SdslSRCS += lstPrev.c
151.40Sdsl
161.59SsjgUSE_META ?= yes
171.51Ssjg.if ${USE_META:tl} != "no"
181.68Sriastrad
191.51SsjgSRCS+=	meta.c
201.51SsjgCPPFLAGS+= -DUSE_META
211.68Sriastrad
221.67SriastradUSE_FILEMON ?= ktrace
231.66Sriastrad.if ${USE_FILEMON:tl} != "no"
241.68Sriastrad
251.67Sriastrad.PATH:	${.CURDIR}/filemon
261.67SriastradSRCS+=	filemon_${USE_FILEMON}.c
271.66SriastradCPPFLAGS+= -DUSE_FILEMON
281.68Sriastrad
291.68Sriastrad.if ${USE_FILEMON} == "dev"
301.68SriastradFILEMON_H ?= /usr/include/dev/filemon/filemon.h
311.68Sriastrad.if exists(${FILEMON_H}) && ${FILEMON_H:T} == "filemon.h"
321.68SriastradCOPTS.filemon_dev.c += -DHAVE_FILEMON_H -I${FILEMON_H:H}
331.65Smaxv.endif
341.68Sriastrad.endif				# USE_FILEMON == dev
351.68Sriastrad
361.68Sriastrad.endif				# USE_FILEMON
371.68Sriastrad
381.68Sriastrad.endif				# USE_META
391.51Ssjg
401.14Sgwr.PATH:	${.CURDIR}/lst.lib
411.60SchristosSUBDIR.roff+=	PSD.doc
421.29Ssjg.if make(obj) || make(clean)
431.29SsjgSUBDIR+= unit-tests
441.29Ssjg.endif
451.1Scgd
461.1Scgd.include <bsd.prog.mk>
471.16Smycroft.include <bsd.subdir.mk>
481.24Ssjg
491.47SperryCPPFLAGS+= -DMAKE_NATIVE
501.55SchristosCOPTS.var.c += -Wno-cast-qual
511.55SchristosCOPTS.job.c += -Wno-format-nonliteral
521.55SchristosCOPTS.parse.c += -Wno-format-nonliteral
531.55SchristosCOPTS.var.c += -Wno-format-nonliteral
541.29Ssjg
551.41Ssjg.ifdef TOOLDIR
561.41Ssjg# this is a native netbsd build, 
571.41Ssjg# use libutil rather than the local emalloc etc.
581.44SjoergCPPFLAGS+= -DUSE_EMALLOC
591.37SchristosLDADD+=-lutil
601.37SchristosDPADD+=${LIBUTIL}
611.38Schristos.endif
621.37Schristos
631.63SmrgCOPTS.arch.c+=	${GCC_NO_FORMAT_TRUNCATION}
641.63SmrgCOPTS.dir.c+=	${GCC_NO_FORMAT_TRUNCATION}
651.63SmrgCOPTS.main.c+=	${GCC_NO_FORMAT_TRUNCATION} ${GCC_NO_STRINGOP_TRUNCATION}
661.63SmrgCOPTS.meta.c+=	${GCC_NO_FORMAT_TRUNCATION}
671.63SmrgCOPTS.parse.c+=	${GCC_NO_FORMAT_TRUNCATION}
681.61Smrg
691.29Ssjg# A simple unit-test driver to help catch regressions
701.29Ssjgaccept test:
711.56Ssjg	cd ${.CURDIR}/unit-tests && MAKEFLAGS= ${.MAKE} -r -m / TEST_MAKE=${TEST_MAKE:U${.OBJDIR}/${PROG:T}} ${.TARGET}
72