1 # $NetBSD: Makefile,v 1.70 2020/07/25 20:41:58 rillig 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 SRCS+= make.c make_malloc.c metachar.c parse.c 7 SRCS+= str.c strlist.c suff.c targ.c trace.c var.c util.c 8 SRCS+= lstAppend.c lstAtEnd.c lstAtFront.c lstClose.c lstConcat.c 9 SRCS+= lstDatum.c lstDeQueue.c lstDestroy.c lstDupl.c lstEnQueue.c 10 SRCS+= lstFind.c lstFindFrom.c lstFirst.c lstForEach.c lstForEachFrom.c 11 SRCS+= lstInit.c lstInsert.c lstIsAtEnd.c lstIsEmpty.c lstLast.c lstMember.c 12 SRCS+= lstNext.c lstOpen.c lstPrev.c lstRemove.c lstReplace.c lstSucc.c 13 14 USE_META ?= yes 15 .if ${USE_META:tl} != "no" 16 17 SRCS+= meta.c 18 CPPFLAGS+= -DUSE_META 19 20 USE_FILEMON ?= ktrace 21 .if ${USE_FILEMON:tl} != "no" 22 23 .PATH: ${.CURDIR}/filemon 24 SRCS+= filemon_${USE_FILEMON}.c 25 CPPFLAGS+= -DUSE_FILEMON -DUSE_FILEMON_${USE_FILEMON:tu} 26 27 .if ${USE_FILEMON} == "dev" 28 FILEMON_H ?= /usr/include/dev/filemon/filemon.h 29 .if exists(${FILEMON_H}) && ${FILEMON_H:T} == "filemon.h" 30 COPTS.filemon_dev.c += -DHAVE_FILEMON_H -I${FILEMON_H:H} 31 .endif 32 .endif # USE_FILEMON == dev 33 34 .endif # USE_FILEMON 35 36 .endif # USE_META 37 38 .PATH: ${.CURDIR}/lst.lib 39 SUBDIR.roff+= PSD.doc 40 .if make(obj) || make(clean) 41 SUBDIR+= unit-tests 42 .endif 43 44 .include <bsd.prog.mk> 45 .include <bsd.subdir.mk> 46 47 CPPFLAGS+= -DMAKE_NATIVE 48 COPTS.var.c += -Wno-cast-qual 49 COPTS.job.c += -Wno-format-nonliteral 50 COPTS.parse.c += -Wno-format-nonliteral 51 COPTS.var.c += -Wno-format-nonliteral 52 53 .ifdef TOOLDIR 54 # this is a native netbsd build, 55 # use libutil rather than the local emalloc etc. 56 CPPFLAGS+= -DUSE_EMALLOC 57 LDADD+=-lutil 58 DPADD+=${LIBUTIL} 59 .endif 60 61 COPTS.arch.c+= ${GCC_NO_FORMAT_TRUNCATION} 62 COPTS.dir.c+= ${GCC_NO_FORMAT_TRUNCATION} 63 COPTS.main.c+= ${GCC_NO_FORMAT_TRUNCATION} ${GCC_NO_STRINGOP_TRUNCATION} 64 COPTS.meta.c+= ${GCC_NO_FORMAT_TRUNCATION} 65 COPTS.parse.c+= ${GCC_NO_FORMAT_TRUNCATION} 66 67 # A simple unit-test driver to help catch regressions 68 accept test: .MAKE 69 cd ${.CURDIR}/unit-tests && MAKEFLAGS= ${.MAKE} -r -m / TEST_MAKE=${TEST_MAKE:U${.OBJDIR}/${PROG:T}} ${.TARGET} 70