examples/c++/Makefile
raw| 1 | # This Makefile is designed to be simple and readable. It does not |
| 2 | # aim at portability. It requires GNU Make. |
| 3 | |
| 4 | BISON = bison |
| 5 | CXX = g++ |
| 6 | CXXFLAGS = |
| 7 | PROGS = simple variant variant-11 |
| 8 | |
| 9 | simple: CXXFLAGS = -std=c++14 |
| 10 | variant-11: CXXFLAGS = -std=c++11 |
| 11 | |
| 12 | all: $(PROGS) |
| 13 | |
| 14 | %.cc %.hh %.html %.gv: %.yy |
| 15 | $(BISON) $(BISONFLAGS) --html --graph -o $*.cc $< |
| 16 | |
| 17 | %: %.cc |
| 18 | $(CXX) $(CXXFLAGS) -o$@ $< |
| 19 | |
| 20 | clean: |
| 21 | rm -f $(PROGS:=.cc) $(PROGS) |