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