1 # $NetBSD: Makefile,v 1.60.2.3 2020/04/13 08:05:43 martin Exp $ 2 # @(#)Makefile 5.2 (Berkeley) 12/28/90 3 4 PROG= make 5 SRCS= 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 7 SRCS+= strlist.c 8 SRCS+= make_malloc.c 9 SRCS+= 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 14 SRCS += lstPrev.c 15 16 USE_META ?= yes 17 .if ${USE_META:tl} != "no" 18 19 SRCS+= meta.c 20 CPPFLAGS+= -DUSE_META 21 22 USE_FILEMON ?= ktrace 23 .if ${USE_FILEMON:tl} != "no" 24 25 .PATH: ${.CURDIR}/filemon 26 SRCS+= filemon_${USE_FILEMON}.c 27 CPPFLAGS+= -DUSE_FILEMON -DUSE_FILEMON_${USE_FILEMON:tu} 28 29 .if ${USE_FILEMON} == "dev" 30 FILEMON_H ?= /usr/include/dev/filemon/filemon.h 31 .if exists(${FILEMON_H}) && ${FILEMON_H:T} == "filemon.h" 32 COPTS.filemon_dev.c += -DHAVE_FILEMON_H -I${FILEMON_H:H} 33 .endif 34 .endif # USE_FILEMON == dev 35 36 .endif # USE_FILEMON 37 38 .endif # USE_META 39 40 .PATH: ${.CURDIR}/lst.lib 41 SUBDIR.roff+= PSD.doc 42 .if make(obj) || make(clean) 43 SUBDIR+= unit-tests 44 .endif 45 46 .include <bsd.prog.mk> 47 .include <bsd.subdir.mk> 48 49 CPPFLAGS+= -DMAKE_NATIVE 50 COPTS.var.c += -Wno-cast-qual 51 COPTS.job.c += -Wno-format-nonliteral 52 COPTS.parse.c += -Wno-format-nonliteral 53 COPTS.var.c += -Wno-format-nonliteral 54 55 .ifdef TOOLDIR 56 # this is a native netbsd build, 57 # use libutil rather than the local emalloc etc. 58 CPPFLAGS+= -DUSE_EMALLOC 59 LDADD+=-lutil 60 DPADD+=${LIBUTIL} 61 .endif 62 63 COPTS.arch.c+= ${GCC_NO_FORMAT_TRUNCATION} 64 COPTS.dir.c+= ${GCC_NO_FORMAT_TRUNCATION} 65 COPTS.main.c+= ${GCC_NO_FORMAT_TRUNCATION} ${GCC_NO_STRINGOP_TRUNCATION} 66 COPTS.meta.c+= ${GCC_NO_FORMAT_TRUNCATION} 67 COPTS.parse.c+= ${GCC_NO_FORMAT_TRUNCATION} 68 69 # A simple unit-test driver to help catch regressions 70 accept test: .MAKE 71 cd ${.CURDIR}/unit-tests && MAKEFLAGS= ${.MAKE} -r -m / TEST_MAKE=${TEST_MAKE:U${.OBJDIR}/${PROG:T}} ${.TARGET} 72