xref: /freebsd/usr.bin/awk/Makefile (revision 6be3386466ab79a84b48429ae66244f21526d3df)
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 awkgram.h > proctab.c
29
30DEPENDOBJS+= maketab
31build-tools: maketab
32maketab: ytab.h maketab.c ${BUILD_TOOLS_META}
33
34# awk needs some work before we can connect these tests to the build
35#HAS_TESTS=
36#SUBDIR.${MK_TESTS}+= tests
37
38.include <bsd.prog.mk>
39