mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-09 12:23:04 +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.
26 lines
580 B
Makefile
26 lines
580 B
Makefile
# This Makefile is designed to be simple and readable. It does not
|
|
# aim at portability. It requires GNU Make.
|
|
|
|
BASE = rpcalc
|
|
BISON = bison
|
|
XSLTPROC = xsltproc
|
|
|
|
all: $(BASE)
|
|
|
|
%.c %.xml %.gv: %.y
|
|
$(BISON) $(BISONFLAGS) --xml --graph=$*.gv -o $*.c $<
|
|
|
|
%: %.c
|
|
$(CC) $(CFLAGS) -o $@ $<
|
|
|
|
run: $(BASE)
|
|
@echo "Type arithmetic expressions in Reverse Polish Notation. Quit with ctrl-d."
|
|
./$<
|
|
|
|
html: $(BASE).html
|
|
%.html: %.xml
|
|
$(XSLTPROC) $(XSLTPROCFLAGS) -o $@ $$($(BISON) --print-datadir)/xslt/xml2xhtml.xsl $<
|
|
|
|
clean:
|
|
rm -f $(BASE) $(BASE).c $(BASE).html $(BASE).xml $(BASE).gv
|