mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-24 03:33:03 +00:00
examples: calc++: a Makefile and a README
* examples/calc++/Makefile, examples/calc++/README: New. * examples/calc++/local.mk: Ship and install them. * doc/bison.texi: Formatting changes.
This commit is contained in:
27
examples/calc++/Makefile
Normal file
27
examples/calc++/Makefile
Normal file
@@ -0,0 +1,27 @@
|
||||
# This Makefile is designed to be simple and readable. It does not
|
||||
# aim at portability. It requires GNU Make.
|
||||
|
||||
BISON = bison
|
||||
CXX = g++
|
||||
FLEX = flex
|
||||
|
||||
all: calc++
|
||||
|
||||
%.cc %.hh: %.yy
|
||||
$(BISON) $(BISONFLAGS) -o $*.cc $<
|
||||
|
||||
%.cc: %.ll
|
||||
$(FLEX) $(FLEXFLAGS) -o$@ $<
|
||||
|
||||
%.o: %.cc
|
||||
$(CXX) $(CXXFLAGS) -c -o$@ $<
|
||||
|
||||
calc++: calc++.o driver.o parser.o scanner.o
|
||||
$(CXX) -o $@ $^
|
||||
|
||||
calc++.o: parser.hh
|
||||
parser.o: parser.hh
|
||||
scanner.o: parser.hh
|
||||
|
||||
clean:
|
||||
rm -f calc++ *.o parser.hh parser.cc scanner.cc
|
||||
Reference in New Issue
Block a user