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