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