mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-09 04:13:03 +00:00
Convert some of the READMEs to Markdown, which is now more common, and nicely displayed in some git hosting services. Add missing READMEs and Makefiles. Generate XML, HTML and Dot files. Be sure to ship the test files. Complete CLEANFILES to remove all generated files. * examples/calc++: Move into... * examples/c++: here. * examples/mfcalc, examples/rpcalc: Move into... * examples/c: here. * examples/README.md, examples/c++/calc++/Makefile, examples/c/local.mk, * examples/c/mfcalc/Makefile, examples/c/rpcalc/Makefile, * examples/d/README.md, examples/java/README.md: New files. * examples/test (medir): Be robust to deeper directory nesting.
42 lines
867 B
Makefile
42 lines
867 B
Makefile
# This Makefile is designed to be simple and readable. It does not
|
|
# aim at portability. It requires GNU Make.
|
|
|
|
BASE = calc++
|
|
BISON = bison
|
|
CXX = g++
|
|
FLEX = flex
|
|
XSLTPROC = xsltproc
|
|
|
|
all: $(BASE)
|
|
|
|
%.cc %.hh %.xml %.gv: %.yy
|
|
$(BISON) $(BISONFLAGS) --xml --graph=$*.gv -o $*.cc $<
|
|
|
|
%.cc: %.ll
|
|
$(FLEX) $(FLEXFLAGS) -o$@ $<
|
|
|
|
%.o: %.cc
|
|
$(CXX) $(CXXFLAGS) -c -o$@ $<
|
|
|
|
$(BASE): $(BASE).o driver.o parser.o scanner.o
|
|
$(CXX) -o $@ $^
|
|
|
|
$(BASE).o: parser.hh
|
|
parser.o: parser.hh
|
|
scanner.o: parser.hh
|
|
|
|
run: $(BASE)
|
|
@echo "Type arithmetic expressions. Quit with ctrl-d."
|
|
./$< -
|
|
|
|
html: parser.html
|
|
%.html: %.xml
|
|
$(XSLTPROC) $(XSLTPROCFLAGS) -o $@ $$($(BISON) --print-datadir)/xslt/xml2xhtml.xsl $<
|
|
|
|
CLEANFILES = \
|
|
$(BASE) *.o \
|
|
parser.hh parser.cc parser.output parser.xml parser.html parser.gv location.hh \
|
|
scanner.cc
|
|
clean:
|
|
rm -f $(CLEANFILES)
|