xref: /freebsd/usr.bin/awk/Makefile (revision 5bf5ca772c6de2d53344a78cf461447cc322ccea)
1# $FreeBSD$
2
3.include <src.opts.mk>
4
5AWKSRC=	${SRCTOP}/contrib/one-true-awk
6.PATH: ${AWKSRC}
7
8PROG=	awk
9SRCS=	awkgram.y b.c lex.c lib.c main.c parse.c proctab.c run.c tran.c ytab.h
10
11CFLAGS+= -DHAS_ISBLANK -I. -I${AWKSRC} -DFOPEN_MAX=64
12
13WARNS?=	1
14
15LIBADD=	m
16
17LINKS=	${BINDIR}/awk ${BINDIR}/nawk
18MLINKS=	awk.1 nawk.1
19
20CLEANFILES= maketab proctab.c ytab.h
21
22# XXX: awkgram.c isn't really needed here but it is added to keep
23# awkgram.h: .NOMETA respected.
24ytab.h: awkgram.c awkgram.h .NOMETA
25	ln -sf ${.ALLSRC:M*.h} ${.TARGET}
26
27proctab.c: maketab
28	${BTOOLSPATH:U.}/maketab > proctab.c
29
30build-tools: maketab
31maketab: ytab.h maketab.c ${BUILD_TOOLS_META}
32
33# awk needs some work before we can connect these tests to the build
34#HAS_TESTS=
35#SUBDIR.${MK_TESTS}+= tests
36
37.include <bsd.prog.mk>
38