Makefile revision 1.70
11.70Srillig#	$NetBSD: Makefile,v 1.70 2020/07/25 20:41:58 rillig Exp $
21.8Schristos#	@(#)Makefile	5.2 (Berkeley) 12/28/90
31.1Scgd
41.1ScgdPROG=	make
51.70SrilligSRCS=	arch.c buf.c compat.c cond.c dir.c for.c hash.c job.c main.c
61.70SrilligSRCS+=	make.c make_malloc.c metachar.c parse.c
71.70SrilligSRCS+=	str.c strlist.c suff.c targ.c trace.c var.c util.c 
81.70SrilligSRCS+=	lstAppend.c lstAtEnd.c lstAtFront.c lstClose.c lstConcat.c
91.70SrilligSRCS+=	lstDatum.c lstDeQueue.c lstDestroy.c lstDupl.c lstEnQueue.c
101.70SrilligSRCS+=	lstFind.c lstFindFrom.c lstFirst.c lstForEach.c lstForEachFrom.c
111.70SrilligSRCS+=	lstInit.c lstInsert.c lstIsAtEnd.c lstIsEmpty.c lstLast.c lstMember.c
121.70SrilligSRCS+=	lstNext.c lstOpen.c lstPrev.c lstRemove.c lstReplace.c lstSucc.c
131.40Sdsl
141.59SsjgUSE_META ?= yes
151.51Ssjg.if ${USE_META:tl} != "no"
161.68Sriastrad
171.51SsjgSRCS+=	meta.c
181.51SsjgCPPFLAGS+= -DUSE_META
191.68Sriastrad
201.67SriastradUSE_FILEMON ?= ktrace
211.66Sriastrad.if ${USE_FILEMON:tl} != "no"
221.68Sriastrad
231.67Sriastrad.PATH:	${.CURDIR}/filemon
241.67SriastradSRCS+=	filemon_${USE_FILEMON}.c
251.69SsjgCPPFLAGS+= -DUSE_FILEMON -DUSE_FILEMON_${USE_FILEMON:tu}
261.68Sriastrad
271.68Sriastrad.if ${USE_FILEMON} == "dev"
281.68SriastradFILEMON_H ?= /usr/include/dev/filemon/filemon.h
291.68Sriastrad.if exists(${FILEMON_H}) && ${FILEMON_H:T} == "filemon.h"
301.68SriastradCOPTS.filemon_dev.c += -DHAVE_FILEMON_H -I${FILEMON_H:H}
311.65Smaxv.endif
321.68Sriastrad.endif				# USE_FILEMON == dev
331.68Sriastrad
341.68Sriastrad.endif				# USE_FILEMON
351.68Sriastrad
361.68Sriastrad.endif				# USE_META
371.51Ssjg
381.14Sgwr.PATH:	${.CURDIR}/lst.lib
391.60SchristosSUBDIR.roff+=	PSD.doc
401.29Ssjg.if make(obj) || make(clean)
411.29SsjgSUBDIR+= unit-tests
421.29Ssjg.endif
431.1Scgd
441.1Scgd.include <bsd.prog.mk>
451.16Smycroft.include <bsd.subdir.mk>
461.24Ssjg
471.47SperryCPPFLAGS+= -DMAKE_NATIVE
481.55SchristosCOPTS.var.c += -Wno-cast-qual
491.55SchristosCOPTS.job.c += -Wno-format-nonliteral
501.55SchristosCOPTS.parse.c += -Wno-format-nonliteral
511.55SchristosCOPTS.var.c += -Wno-format-nonliteral
521.29Ssjg
531.41Ssjg.ifdef TOOLDIR
541.41Ssjg# this is a native netbsd build, 
551.41Ssjg# use libutil rather than the local emalloc etc.
561.44SjoergCPPFLAGS+= -DUSE_EMALLOC
571.37SchristosLDADD+=-lutil
581.37SchristosDPADD+=${LIBUTIL}
591.38Schristos.endif
601.37Schristos
611.63SmrgCOPTS.arch.c+=	${GCC_NO_FORMAT_TRUNCATION}
621.63SmrgCOPTS.dir.c+=	${GCC_NO_FORMAT_TRUNCATION}
631.63SmrgCOPTS.main.c+=	${GCC_NO_FORMAT_TRUNCATION} ${GCC_NO_STRINGOP_TRUNCATION}
641.63SmrgCOPTS.meta.c+=	${GCC_NO_FORMAT_TRUNCATION}
651.63SmrgCOPTS.parse.c+=	${GCC_NO_FORMAT_TRUNCATION}
661.61Smrg
671.29Ssjg# A simple unit-test driver to help catch regressions
681.69Ssjgaccept test: .MAKE
691.56Ssjg	cd ${.CURDIR}/unit-tests && MAKEFLAGS= ${.MAKE} -r -m / TEST_MAKE=${TEST_MAKE:U${.OBJDIR}/${PROG:T}} ${.TARGET}
70