summaryrefslogtreecommitdiff
path: root/usr.bin/awk/Makefile
blob: 40aa292f19ce642aa8dc81183b880fd14cff9879 (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
#	$OpenBSD: Makefile,v 1.3 1996/10/12 10:25:42 deraadt Exp $

PROG=	awk
LINKS=	${BINDIR}/awk ${BINDIR}/nawk
SRCS=	awkgram.c awklex.c b.c main.c parse.c proctab.c tran.c lib.c run.c
LDADD=	-ll -lm
DPADD=	${LIBL} ${LIBM}
CLEANFILES+=awkgram.c awkgram.h awklex.c awklex.h proctab.c maketab prevawkgram.h
CFLAGS+=-I. -I${.CURDIR}
MLINKS=	awk.1 nawk.1

awkgram.c awkgram.h prevawkgram.h: awkgram.y
	${YACC} -d ${.IMPSRC}
	mv y.tab.c awkgram.c
	mv y.tab.h awkgram.h
	cmp -s awkgram.h prevawkgram.h || cp awkgram.h prevawkgram.h

awklex.c: awklex.l
	lex ${.IMPSRC}
	mv lex.yy.c awklex.c

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

maketab: prevawkgram.h
	${HOSTCC} ${CFLAGS} ${.CURDIR}/maketab.c -o $@

.include <bsd.prog.mk>