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