Files
bison/examples/c/rpcalc/Makefile
Akim Demaille d657da9fb4 examples: add a simple Flex+Bison example in C
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.
2018-12-09 15:30:25 +01:00

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