| 1 |
# This Makefile is designed to be simple and readable. It does not |
| 2 |
# aim at portability. It requires GNU Make. |
| 3 |
|
| 4 |
BASE = calc |
| 5 |
BISON = bison |
| 6 |
|
| 7 |
all: $(BASE) |
| 8 |
|
| 9 |
%.c %.h %.html %.xml %.gv: %.y |
| 10 |
$(BISON) $(BISONFLAGS) --header --html --graph -o $*.c $< |
| 11 |
|
| 12 |
$(BASE): $(BASE).o |
| 13 |
$(CC) $(CFLAGS) -o $@ $^ |
| 14 |
|
| 15 |
run: $(BASE) |
| 16 |
@echo "Type arithmetic expressions. Quit with ctrl-d." |
| 17 |
./$< |
| 18 |
|
| 19 |
CLEANFILES = \ |
| 20 |
$(BASE) *.o $(BASE).[ch] $(BASE).output $(BASE).xml $(BASE).html $(BASE).gv |
| 21 |
|
| 22 |
clean: |
| 23 |
rm -f $(CLEANFILES) |