Website Summary Files Commits Branches @commit @diff @stats
path: root / demo / bison / calc / Makefile
diff options
context:
space:
mode:
1 files changed, 14 insertions, 4 deletions
-rw-r--r--demo/bison/calc/Makefile18
diff --git a/demo/bison/calc/Makefile b/demo/bison/calc/Makefile
index ba07ca1..4f417cf 100644
--- a/demo/bison/calc/Makefile
+++ b/demo/bison/calc/Makefile
@@ -1,13 +1,23 @@
all: calc
+BISON_DATA_DIR=$(shell bison --print-datadir)
+
lex.yy.c: lexer.lex
flex lexer.lex
parser.tab.c: parser.y
- bison ${DEBUG} -v -d parser.y
+ bison ${DEBUG} -x -d parser.y
+
+parser.tab.h: parser.tab.c
+
+parser.html: parser.tab.c
+ xsltproc ${BISON_DATA_DIR}/xslt/xml2xhtml.xsl parser.xml > parser.html
+
+parser.dot: parser.tab.c
+ xsltproc ${BISON_DATA_DIR}/xslt/xml2dot.xsl parser.xml > parser.dot
-parser.tab.h: parser.y
- bison ${DEBUG} -v -d parser.y
+parser.svg: parser.dot
+ dot -Tsvg parser.dot > parser.svg
calc: lex.yy.c parser.tab.c parser.tab.h
- ${CC} lex.yy.c parser.tab.c -o calc
+ ${CC} ${CFLAGS} lex.yy.c parser.tab.c -o calc