Debian Codegraph @

examples/c/lexcalc/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 = lexcalc
5 BISON = bison
6 FLEX = flex
7
8 all: $(BASE)
9
10 %.c %.h %.html %.xml %.gv: %.y
11 $(BISON) $(BISONFLAGS) --header --html --graph -o $*.c $<
12
13 %.c: %.l
14 $(FLEX) $(FLEXFLAGS) -o$@ $<
15
16 scan.o: parse.h
17 $(BASE): parse.o scan.o
18 $(CC) $(CFLAGS) -o $@ $^
19
20 run: $(BASE)
21 @echo "Type arithmetic expressions. Quit with ctrl-d."
22 ./$<
23
24 CLEANFILES = \
25 $(BASE) *.o \
26 parse.[ch] parse.output parse.xml parse.html parse.gv \
27 scan.c
28 clean:
29 rm -f $(CLEANFILES)