xref: /freebsd/usr.bin/m4/Makefile (revision 19fae0f66023a97a9b464b3beeeabb2081f575b3)
1#	$OpenBSD: Makefile,v 1.13 2014/05/12 19:11:19 espie Exp $
2# $FreeBSD$
3
4# -DEXTENDED
5# 	if you want the paste & spaste macros.
6
7.include <src.opts.mk>
8
9PROG=	m4
10CFLAGS+=-DEXTENDED -I${.CURDIR} -I${SRCTOP}/lib/libopenbsd
11LIBADD=	m openbsd
12
13NO_WMISSING_VARIABLE_DECLARATIONS=
14
15SRCS=	eval.c expr.c look.c main.c misc.c gnum4.c trace.c parser.y
16.if target(bootstrap_m4_tokenizer)
17# When crossbuilding on non-FreeBSD we need to first build m4 with pre-generated
18# tokenizer files and the build the real m4 once we have lex+yacc.
19SRCS+=	tokenizer.c
20.else
21SRCS+=	tokenizer.l
22.endif
23
24GENFILES=	tokenizer.c parser.c parser.h
25WARNS?=	3
26
27tokenizer.o: parser.h
28
29CLEANFILES+=	parser.c parser.h tokenizer.o tokenizer.c
30
31HAS_TESTS=
32SUBDIR.${MK_TESTS}+= tests
33
34.include <bsd.prog.mk>
35