Makefile revision 1.71
1# $NetBSD: Makefile,v 1.71 2021/06/22 12:58:28 martin Exp $ 2 3.include <bsd.own.mk> 4 5PROG= lint1 6SRCS= cgram.y \ 7 ckbool.c ckctype.c ckgetopt.c \ 8 decl.c emit.c emit1.c err.c func.c init.c inittyp.c lex.c \ 9 main1.c mem.c mem1.c oper.c print.c scan.l tree.c tyname.c 10 11MAN= lint.7 12YHEADER= 13#DBG= -g 14#CPPFLAGS+= -DYYDEBUG=1 15#YFLAGS+= -v 16#LFLAGS+= -d 17 18CWARNFLAGS.clang+= -Wno-error=implicit-int-float-conversion 19LINTFLAGS+= -T 20LOBJS.${PROG}+= ${SRCS:M*.y:.y=.ln} 21#LOBJS.${PROG}+= ${SRCS:M*.l:.l=.ln} 22LINTFLAGS.scan.c= -X 107,330,331,333 23 24CPPFLAGS+= -DIS_LINT1 25CPPFLAGS+= -I${.CURDIR} 26CPPFLAGS+= ${DEBUG:D-DDEBUG} 27 28COPTS.err.c+= ${${ACTIVE_CC} == "clang":? -Wno-format-nonliteral :} 29 30.if ${HAVE_GCC} == 9 && \ 31 (${MACHINE_ARCH} == "sh3el" || ${MACHINE_ARCH} == "sh3eb") 32COPTS.lex.c+= -O0 33.endif 34 35BINDIR= /usr/libexec 36 37CLEANFILES+= ${MAN} 38CLEANFILES+= *.gcno *.gcda *.gcov 39 40.if ${USETOOLS} == "yes" 41LINT1= ${TOOLDIR}/libexec/${MACHINE_GNU_PLATFORM}-lint1 42.endif 43LINT1?= ./${PROG} 44 45${MAN}: makeman ${LINT1:C/^\.\///} Makefile 46 ${_MKTARGET_CREATE} 47 ${HOST_SH} ${.ALLSRC:M*makeman} ${LINT1} -m >${.TARGET} 48 49LDADD+= -lm 50.ifndef HOSTPROG 51DPADD+= ${LIBM} 52 53LDADD+= -ll 54DPADD+= ${LIBL} 55.endif 56 57.include "Makefile.err-msgs-h" 58${SRCS:Nerr.c}: err-msgs.h 59 60add-test: .PHONY 61 @set -eu; \ 62 test=${NAME:Q}; \ 63 [ "$$test" ] || { \ 64 echo "usage: ${MAKE} add-test NAME=<name>"; \ 65 exit; \ 66 }; \ 67 \ 68 cd '../../../tests/usr.bin/xlint/lint1'; \ 69 if [ -f "$$test.c" ]; then \ 70 echo "error: test $$test already exists in $$PWD."; \ 71 exit 1; \ 72 fi; \ 73 \ 74 echo "=> Adding test $$test"; \ 75 printf '%s\n' \ 76 '/* $$''NetBSD$$ */' \ 77 "# 3 \"$$test.c\"" \ 78 '' \ 79 '/*' \ 80 ' * TODO: Explain the purpose of the test.' \ 81 ' */' \ 82 '' \ 83 '/* lint1-extra-flags: -p */' \ 84 '' \ 85 '// TODO: Add some code that passes.' \ 86 '// TODO: Add some code that fails.' \ 87 > "$$test.c"; \ 88 > "$$test.exp"; \ 89 cvs add "$$test.c" "$$test.exp"; \ 90 printf '%s\n' \ 91 '/^FILES+=/i' \ 92 "FILES+= $$test.c" \ 93 "FILES+= $$test.exp" \ 94 '.' 'w' 'q' \ 95 | ed Makefile; \ 96 ${MAKE} sync-mi; \ 97 printf '%s\n' '/^test_case /i' "test_case $$test" '.' 'w' 'q' \ 98 | ed t_integration.sh 99 100.include <bsd.prog.mk> 101