summaryrefslogtreecommitdiffstats
path: root/usr.bin/awk/Makefile
blob: f6be9313d6e4d67a81bb424b1400c5db789447dc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# $FreeBSD$

AWKSRC=	${.CURDIR}/../../contrib/one-true-awk
.PATH: ${AWKSRC}

PROG=	nawk
SRCS=	b.c lex.c lib.c main.c parse.c proctab.c run.c tran.c ytab.c ytab.h

CFLAGS+= -I. -I${AWKSRC}

DPADD=	${LIBM}
LDADD=	-lm

.if ${MACHINE_ARCH} == "sparc64"
LINKS+=	${BINDIR}/nawk ${BINDIR}/awk
MLINKS+=	nawk.1 awk.1
.endif

CLEANFILES+=	maketab proctab.c ytab.c ytab.h

.ORDER:	ytab.c ytab.h proctab.c
ytab.c ytab.h: ${AWKSRC}/awkgram.y
	@echo Expect 42 reduce/shift conflicts and 83 reduce/reduce conflicts
	${YACC} -d ${AWKSRC}/awkgram.y
	mv -f y.tab.c ytab.c
	mv -f y.tab.h ytab.h

proctab.c: maketab
	./maketab > proctab.c

build-tools: maketab
maketab: ytab.h ${AWKSRC}/maketab.c
	${CC} ${CFLAGS} ${AWKSRC}/maketab.c -o maketab

CLEANFILES+=	nawk.1
nawk.1: awk.1
	ln -sf ${.ALLSRC} ${.TARGET}

.include <bsd.prog.mk>
OpenPOWER on IntegriCloud