1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-12 09:58:36 +00:00

Sprinkled with ${.CURDIR} to get the builds of gram.c and tokdefs.h

correct.
This commit is contained in:
L Jonas Olsson 1994-01-29 00:48:19 +00:00
parent f657493cee
commit 0f47f4199d
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=1031

View File

@ -3,7 +3,7 @@
PROG= f2c
g = -O -g
CFLAGS = $g -DANSI_Libraries
CFLAGS = $g -DANSI_Libraries -I${.CURDIR} -I.
SHELL = /bin/sh
SRCSd = main.c init.c gram.c lex.c proc.c equiv.c data.c format.c \
@ -12,16 +12,19 @@ SRCSd = main.c init.c gram.c lex.c proc.c equiv.c data.c format.c \
parse_args.c niceprintf.c cds.c sysdep.c version.c
SRCS = $(SRCSd) malloc.c
gram.c: gram.head gram.dcl gram.expr gram.exec gram.io defs.h tokdefs.h
( sed <tokdefs.h "s/#define/%token/" ;\
cat gram.head gram.dcl gram.expr gram.exec gram.io ) >gram.in
GRAMFILES = ${.CURDIR}/gram.head ${.CURDIR}/gram.dcl ${.CURDIR}/gram.expr\
${.CURDIR}/gram.exec ${.CURDIR}/gram.io
gram.c: ${GRAMFILES} ${.CURDIR}/defs.h tokdefs.h
(sed < tokdefs.h "s/#define/%token/" ; \
cat ${GRAMFILES}) > gram.in
$(YACC) $(YFLAGS) gram.in
echo "(expect 4 shift/reduce)"
sed 's/^# line.*/\/* & *\//' y.tab.c >gram.c
rm -f gram.in y.tab.c
tokdefs.h: tokens
grep -n . <tokens | sed "s/\([^:]*\):\(.*\)/#define \2 \1/" >tokdefs.h
tokdefs.h: ${.CURDIR}/tokens
grep -n . <${.CURDIR}/tokens | sed "s/\([^:]*\):\(.*\)/#define \2 \1/" >tokdefs.h
CLEANFILES+=\
gram.c tokdefs.h