examples/c/mfcalc/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 | BASE = mfcalc |
| 5 | BISON = bison |
| 6 | |
| 7 | all: $(BASE) |
| 8 | |
| 9 | %.c %.html %.gv: %.y |
| 10 | $(BISON) $(BISONFLAGS) --html --graph -o $*.c $< |
| 11 | |
| 12 | %: %.c |
| 13 | $(CC) $(CFLAGS) -o $@ $< |
| 14 | |
| 15 | run: $(BASE) |
| 16 | @echo "Type arithmetic expressions. Quit with ctrl-d." |
| 17 | ./$< |
| 18 | |
| 19 | clean: |
| 20 | rm -f $(BASE) $(BASE).c $(BASE).html $(BASE).xml $(BASE).gv $(BASE).output |