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