1 1.62 rillig # $NetBSD: Makefile,v 1.62 2021/02/20 18:10:22 rillig Exp $ 2 1.17 thorpej 3 1.17 thorpej .include <bsd.own.mk> 4 1.1 cgd 5 1.21 tv PROG= lint1 6 1.60 rillig SRCS= cgram.y ckgetopt.c decl.c emit.c emit1.c err.c \ 7 1.60 rillig func.c init.c inittyp.c lex.c \ 8 1.57 rillig main1.c mem.c mem1.c oper.c print.c scan.l tree.c tyname.c 9 1.48 christos 10 1.21 tv MAN= lint.7 11 1.21 tv YHEADER= 12 1.47 christos #DBG=-g 13 1.43 christos #CPPFLAGS+=-DYYDEBUG=1 14 1.47 christos #YFLAGS+=-v 15 1.51 christos #LFLAGS+=-d 16 1.19 thorpej 17 1.53 joerg CWARNFLAGS.clang+= -Wno-error=implicit-int-float-conversion 18 1.53 joerg 19 1.35 christos CPPFLAGS+= -I${.CURDIR} -I. -DPASS=\"${PROG}.h\" 20 1.62 rillig CPPFLAGS+= ${DEBUG:D-DDEBUG} 21 1.17 thorpej 22 1.21 tv BINDIR= /usr/libexec 23 1.9 christos 24 1.21 tv CLEANFILES+= ${MAN} 25 1.61 rillig CLEANFILES+= *.gcno *.gcda *.gcov 26 1.22 tv 27 1.22 tv .if ${USETOOLS} == "yes" 28 1.22 tv LINT1= ${TOOLDIR}/libexec/${MACHINE_GNU_PLATFORM}-lint1 29 1.22 tv .endif 30 1.22 tv LINT1?= ./${PROG} 31 1.22 tv 32 1.22 tv ${MAN}: makeman ${LINT1:C/^\.\///} Makefile 33 1.34 lukem ${_MKTARGET_CREATE} 34 1.33 lukem ${HOST_SH} ${.ALLSRC:M*makeman} ${LINT1} -m >${.TARGET} 35 1.1 cgd 36 1.26 lukem LDADD+= -lm 37 1.27 dbj .ifndef HOSTPROG 38 1.26 lukem DPADD+= ${LIBM} 39 1.26 lukem 40 1.26 lukem LDADD+= -ll 41 1.26 lukem DPADD+= ${LIBL} 42 1.28 lukem .endif 43 1.24 tv 44 1.57 rillig oper.o: ops.def 45 1.56 rillig 46 1.55 rillig .include "Makefile.err-msgs-h" 47 1.56 rillig ${SRCS:Nerr.c}: err-msgs.h 48 1.46 christos 49 1.58 rillig add-test: .PHONY 50 1.58 rillig @set -eu; \ 51 1.58 rillig test=${NAME:Q}; \ 52 1.58 rillig [ "$$test" ] || { \ 53 1.58 rillig echo "usage: ${MAKE} add-test NAME=<name>"; \ 54 1.58 rillig exit; \ 55 1.58 rillig }; \ 56 1.58 rillig \ 57 1.58 rillig cd '../../../tests/usr.bin/xlint/lint1'; \ 58 1.58 rillig if [ -f "$$test.c" ]; then \ 59 1.58 rillig echo "error: test $$test already exists in $$PWD."; \ 60 1.58 rillig exit 1; \ 61 1.58 rillig fi; \ 62 1.58 rillig \ 63 1.58 rillig echo "=> Adding test $$test"; \ 64 1.58 rillig printf '%s\n' \ 65 1.58 rillig '/* $$''NetBSD$$ */' \ 66 1.58 rillig "# 3 \"$$test.c\"" \ 67 1.58 rillig '' \ 68 1.58 rillig '/*' \ 69 1.58 rillig ' * TODO: Explain the purpose of the test.' \ 70 1.58 rillig '*/' \ 71 1.58 rillig '' \ 72 1.58 rillig '/* lint1-extra-flags: -p */' \ 73 1.58 rillig '' \ 74 1.58 rillig '// TODO: Add some code that passes.' \ 75 1.58 rillig '// TODO: Add some code that fails.' \ 76 1.58 rillig > "$$test.c"; \ 77 1.58 rillig > "$$test.exp"; \ 78 1.58 rillig cvs add "$$test.c" "$$test.exp"; \ 79 1.58 rillig printf '%s\n' \ 80 1.58 rillig '/^FILES+=/i' \ 81 1.58 rillig "FILES+= $$test.c" \ 82 1.58 rillig "FILES+= $$test.exp" \ 83 1.58 rillig '.' 'w' 'q' \ 84 1.58 rillig | ed Makefile; \ 85 1.58 rillig ${MAKE} sync-mi; \ 86 1.58 rillig printf '%s\n' '/^test_case /i' "test_case $$test" '.' 'w' 'q' \ 87 1.58 rillig | ed t_integration.sh 88 1.58 rillig 89 1.1 cgd .include <bsd.prog.mk> 90