author | Markus Bröker <mbroeker@largo.dyndns.tv> |
Mon, 21 Jun 2010 21:58:00 +0200 | |
changeset 136 | d82f65e902d0 |
parent 66 | 2b4f786d9073 |
permissions | -rw-r--r-- |
66
2b4f786d9073
Common Makefile Style NAME += OBJECT
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
39
diff
changeset
|
1 |
CC = gcc |
2b4f786d9073
Common Makefile Style NAME += OBJECT
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
39
diff
changeset
|
2 |
LD = ld |
2b4f786d9073
Common Makefile Style NAME += OBJECT
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
39
diff
changeset
|
3 |
YACC = bison -y |
2b4f786d9073
Common Makefile Style NAME += OBJECT
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
39
diff
changeset
|
4 |
FLEX = flex |
2b4f786d9073
Common Makefile Style NAME += OBJECT
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
39
diff
changeset
|
5 |
CFLAGS = -Wall -O2 -ansi -D_XOPEN_SOURCE=500 |
2b4f786d9073
Common Makefile Style NAME += OBJECT
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
39
diff
changeset
|
6 |
LDFLAGS = |
2b4f786d9073
Common Makefile Style NAME += OBJECT
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
39
diff
changeset
|
7 |
INCLUDE = -Iinclude |
2b4f786d9073
Common Makefile Style NAME += OBJECT
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
39
diff
changeset
|
8 |
|
2b4f786d9073
Common Makefile Style NAME += OBJECT
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
39
diff
changeset
|
9 |
OBJECTS = main.o |
2b4f786d9073
Common Makefile Style NAME += OBJECT
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
39
diff
changeset
|
10 |
OBJECTS += parser.o |
2b4f786d9073
Common Makefile Style NAME += OBJECT
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
39
diff
changeset
|
11 |
OBJECTS += lexer.o |
2b4f786d9073
Common Makefile Style NAME += OBJECT
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
39
diff
changeset
|
12 |
|
2b4f786d9073
Common Makefile Style NAME += OBJECT
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
39
diff
changeset
|
13 |
TARGET = calc |
37 | 14 |
|
38
48f6f3918b82
Project Split finished
Markus Bröker <mbroeker@largo.localnet>
parents:
37
diff
changeset
|
15 |
.SUFFIXES: .c .y .l |
37 | 16 |
|
39 | 17 |
.c.o: |
66
2b4f786d9073
Common Makefile Style NAME += OBJECT
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
39
diff
changeset
|
18 |
$(CC) -c $(CFLAGS) $(INCLUDE) $(CONFIG) $< |
37 | 19 |
|
38
48f6f3918b82
Project Split finished
Markus Bröker <mbroeker@largo.localnet>
parents:
37
diff
changeset
|
20 |
.y.c: |
37 | 21 |
$(YACC) -d $< -o $@ |
22 |
||
38
48f6f3918b82
Project Split finished
Markus Bröker <mbroeker@largo.localnet>
parents:
37
diff
changeset
|
23 |
.l.c: |
37 | 24 |
$(FLEX) -o $@ $< |
25 |
||
26 |
all: $(TARGET) |
|
27 |
||
28 |
||
29 |
$(TARGET): $(OBJECTS) |
|
30 |
$(CC) $(CFLAGS) $(LDFLAGS) $(OBJECTS) -o $@ |
|
31 |
||
32 |
.PHONY: distclean clean |
|
33 |
||
34 |
clean: |
|
35 |
rm -f *.[oae]; |
|
36 |
rm -f *~; |
|
38
48f6f3918b82
Project Split finished
Markus Bröker <mbroeker@largo.localnet>
parents:
37
diff
changeset
|
37 |
rm -f parser.h |
37 | 38 |
|
39 |
distclean: |
|
40 |
make clean |
|
41 |
rm -f $(TARGET) |