aboutsummaryrefslogtreecommitdiff
path: root/makefile
diff options
context:
space:
mode:
authorArnold D. Robbins <arnold@skeeve.com>2020-07-30 17:12:45 +0300
committerArnold D. Robbins <arnold@skeeve.com>2020-07-30 17:12:45 +0300
commit07f04384230b0c4cb8c47da7b5a6aebdea992b1e (patch)
tree22af51caba40b72a11f63cef4cf85fe12a4e4632 /makefile
parent453ce8642b69943dee03e89fb7666a80f7c84bcf (diff)
downloadone-true-awk-07f04384230b0c4cb8c47da7b5a6aebdea992b1e.tar.gz
Move exclusively to bison as parser generator.
Diffstat (limited to 'makefile')
-rw-r--r--makefile43
1 files changed, 16 insertions, 27 deletions
diff --git a/makefile b/makefile
index d7d4bd2..5133698 100644
--- a/makefile
+++ b/makefile
@@ -34,54 +34,43 @@ CFLAGS = -O2
HOSTCC = gcc -g -Wall -pedantic -Wcast-qual
CC = $(HOSTCC) # change this is cross-compiling.
-# yacc options. pick one; this varies a lot by system.
-#YFLAGS = -d -S
+# By fiat, to make our lives easier, yacc is now defined to be bison.
+# If you want something else, you're on your own.
YACC = bison -d
-#YACC = yacc -d
-# -S uses sprintf in yacc parser instead of sprint
OFILES = b.o main.o parse.o proctab.o tran.o lib.o run.o lex.o
-SOURCE = awk.h ytab.c ytab.h proto.h awkgram.y lex.c b.c main.c \
+SOURCE = awk.h awkgram.tab.c awkgram.tab.h proto.h awkgram.y lex.c b.c main.c \
maketab.c parse.c lib.c run.c tran.c proctab.c
LISTING = awk.h proto.h awkgram.y lex.c b.c main.c maketab.c parse.c \
lib.c run.c tran.c
-SHIP = README LICENSE FIXES $(SOURCE) ytab[ch].bak makefile \
+SHIP = README LICENSE FIXES $(SOURCE) awkgram.tab.[ch].bak makefile \
awk.1
-a.out: ytab.o $(OFILES)
- $(CC) $(CFLAGS) ytab.o $(OFILES) $(ALLOC) -lm
+a.out: awkgram.tab.o $(OFILES)
+ $(CC) $(CFLAGS) awkgram.tab.o $(OFILES) $(ALLOC) -lm
-$(OFILES): awk.h ytab.h proto.h
+$(OFILES): awk.h awkgram.tab.h proto.h
-# Clear dependency for parallel build: (make -j)
-# Depending if we used yacc or bison we can be generating different names
-# ({awkgram,y}.tab.{c,h}) so try to move both. We could be using -p to
-# specify the output prefix, but older yacc's don't support it.
-ytab.c ytab.h: awk.h proto.h awkgram.y
+awkgram.tab.c awkgram.tab.h: awk.h proto.h awkgram.y
$(YACC) $(YFLAGS) awkgram.y
- -@for i in c h; do for j in awkgram y; do \
- if [ -f "$$j.tab.$$i" ]; then mv $$j.tab.$$i ytab.$$i; fi; \
- done; done
-
-ytab.h: ytab.c
proctab.c: maketab
- ./maketab ytab.h >proctab.c
+ ./maketab awkgram.tab.h >proctab.c
-maketab: ytab.h maketab.c
+maketab: awkgram.tab.h maketab.c
$(HOSTCC) $(CFLAGS) maketab.c -o maketab
bundle:
- @cp ytab.h ytabh.bak
- @cp ytab.c ytabc.bak
+ @cp awkgram.tab.h awkgram.tab.h.bak
+ @cp awkgram.tab.c awkgram.tab.c.bak
@bundle $(SHIP)
tar:
- @cp ytab.h ytabh.bak
- @cp ytab.c ytabc.bak
+ @cp awkgram.tab.h awkgram.tab.h.bak
+ @cp awkgram.tab.c awkgram.tab.c.bak
@bundle $(SHIP) >awk.shar
@tar cf awk.tar $(SHIP)
gzip awk.tar
@@ -110,7 +99,7 @@ clean: testclean
rm -f a.out *.o *.obj maketab maketab.exe *.bb *.bbg *.da *.gcov *.gcno *.gcda # proctab.c
cleaner: testclean
- rm -f a.out *.o *.obj maketab maketab.exe *.bb *.bbg *.da *.gcov *.gcno *.gcda proctab.c ytab*
+ rm -f a.out *.o *.obj maketab maketab.exe *.bb *.bbg *.da *.gcov *.gcno *.gcda proctab.c awkgram.tab.*
# This is a bit of a band-aid until we can invest some more time
# in the test suite.
@@ -119,4 +108,4 @@ testclean:
glop glop1 glop2 lilly.diff tempbig tempsmall time
# For the habits of GNU maintainers:
-distclean: clean
+distclean: cleaner