1##
2# Special Targets
3##
4
5.SUFFIXES: .o .c .y .l .a .sh
6
7##
8# Macros
9##
10
11AR = ar
12ARFLAGS = -rv
13YACC = yacc
14YFLAGS =
15LEX = lex
16LFLAGS =
17LDFLAGS =
18CC = cc # TODO: use cc17 here
19CFLAGS = -O1
20
21##
22# Single Suffix Rules
23##
24
25.c:
26 $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $<
27
28.sh:
29 cp $< $@
30 chmod a+x $@
31
32##
33# Double Suffix Rules
34##
35
36.c.o:
37 $(CC) $(CFLAGS) -c $<
38
39.y.o:
40 $(YACC) $(YFLAGS) $<
41 $(CC) $(CFLAGS) -c y.tab.c
42 rm -f y.tab.c
43 mv y.tab.o $@
44
45.l.o:
46 $(LEX) $(LFLAGS) $<
47 $(CC) $(CFLAGS) -c lex.yy.c
48 rm -f lex.yy.c
49 mv lex.yy.o $@
50
51.y.c:
52 $(YACC) $(YFLAGS) $<
53 mv y.tab.c $@
54
55.l.c:
56 $(LEX) $(LFLAGS) $<
57 mv lex.yy.c $@