xref: /minix/tools/m4/bootstrap/Makefile (revision ebfedea0)
1# $NetBSD: Makefile,v 1.2 2009/11/03 22:52:59 christos Exp $
2
3FILES=parser.h parser.c tokenizer.c
4
5all: ${FILES}
6
7.include <bsd.own.mk>
8
9DIST=${NETBSDSRCDIR}/usr.bin/m4
10
11parser.c parser.h: ${DIST}/parser.y
12	${YACC} -d ${DIST}/parser.y
13	sed -e 's/\$$''NetBSD:\([^$$]*\)\ \$$/NetBSD:\1/' < y.tab.c > parser.c
14	rm -f y.tab.c
15	mv y.tab.h parser.h
16
17tokenizer.c:	${DIST}/tokenizer.l
18	${LEX} ${DIST}/tokenizer.l
19	sed -e 's/\$$''NetBSD:\([^$$]*\)\ \$$/NetBSD:\1/' < lex.yy.c > ${.TARGET}
20	rm -f lex.yy.c
21
22clean::
23	rm -f ${FILES}
24
25