equal
deleted
inserted
replaced
1 CC=gcc |
1 CC=gcc |
2 LD=ld |
2 LD=ld |
3 YACC=bison -y |
3 YACC=bison -y |
4 FLEX=flex |
4 FLEX=flex |
5 CFLAGS=-Wall -O2 -ansi |
5 CFLAGS=-Wall -O2 -ansi -D_XOPEN_SOURCE=500 |
6 LDFLAGS= |
6 LDFLAGS= |
7 INCLUDE=include |
7 INCLUDE=include |
8 OBJECTS=main.o parser.o lexer.o |
8 OBJECTS=main.o parser.o lexer.o |
9 TARGET=parser |
9 TARGET=calc |
10 |
10 |
11 .SUFFIXES: .c .yy .ll |
11 .SUFFIXES: .c .y .l |
12 |
12 |
13 .c.o: |
13 .c.o: |
14 $(CC) -c $(CFLAGS) -I$(INCLUDE) $(CONFIG) $< |
14 $(CC) -c $(CFLAGS) -I$(INCLUDE) $(CONFIG) $< |
15 |
15 |
16 .yy.c: |
16 .y.c: |
17 $(YACC) -d $< -o $@ |
17 $(YACC) -d $< -o $@ |
18 |
18 |
19 .ll.c: |
19 .l.c: |
20 $(FLEX) -o $@ $< |
20 $(FLEX) -o $@ $< |
21 |
21 |
22 all: $(TARGET) |
22 all: $(TARGET) |
23 |
23 |
24 |
24 |
28 .PHONY: distclean clean |
28 .PHONY: distclean clean |
29 |
29 |
30 clean: |
30 clean: |
31 rm -f *.[oae]; |
31 rm -f *.[oae]; |
32 rm -f *~; |
32 rm -f *~; |
|
33 rm -f parser.h |
33 |
34 |
34 distclean: |
35 distclean: |
35 make clean |
36 make clean |
36 rm -f $(TARGET) |
37 rm -f $(TARGET) |