mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-09 04:13:03 +00:00
Suggested by Askar Safin. http://lists.gnu.org/archive/html/bug-bison/2018-12/msg00003.html * examples/c/lexcalc/Makefile, examples/c/lexcalc/README.md, * examples/c/lexcalc/lexcalc.test, examples/c/lexcalc/local.mk, * examples/c/lexcalc/parse.y, examples/c/lexcalc/scan.l: New.
35 lines
719 B
Makefile
35 lines
719 B
Makefile
# This Makefile is designed to be simple and readable. It does not
|
|
# aim at portability. It requires GNU Make.
|
|
|
|
BASE = lexcalc
|
|
BISON = bison
|
|
FLEX = flex
|
|
XSLTPROC = xsltproc
|
|
|
|
all: $(BASE)
|
|
|
|
%.c %.h %.xml %.gv: %.y
|
|
$(BISON) $(BISONFLAGS) --defines --xml --graph=$*.gv -o $*.c $<
|
|
|
|
%.c: %.l
|
|
$(FLEX) $(FLEXFLAGS) -o$@ $<
|
|
|
|
scan.o: parse.h
|
|
lexcalc: parse.o scan.o
|
|
$(CC) $(CFLAGS) -o $@ $^
|
|
|
|
run: $(BASE)
|
|
@echo "Type arithmetic expressions. Quit with ctrl-d."
|
|
./$<
|
|
|
|
html: parse.html
|
|
%.html: %.xml
|
|
$(XSLTPROC) $(XSLTPROCFLAGS) -o $@ $$($(BISON) --print-datadir)/xslt/xml2xhtml.xsl $<
|
|
|
|
CLEANFILES = \
|
|
$(BASE) *.o \
|
|
parse.[ch] parse.output parse.xml parse.html parse.gv \
|
|
scan.c
|
|
clean:
|
|
rm -f $(CLEANFILES)
|