build system / makefiles / ide: added support for ccache and distcc
[sdk] / compiler / bootstrap / libec / Makefile
1 .PHONY: all objdir clean realclean distclean
2
3 # CONTENT
4
5 MODULE := ec
6 CONFIG := bootstrap
7 COMPILER := default
8 TARGET_TYPE = staticlib
9
10 OBJ = obj/$(CONFIG).$(PLATFORM)/
11
12 RES = 
13
14 TARGET = obj/$(CONFIG).$(PLATFORM)/$(LP)ecBootstrap$(A)
15
16 OBJECTS = $(OBJ)ast.o $(OBJ)copy.o $(OBJ)dbpass.o $(OBJ)ec.main.o $(OBJ)ecdefs.o \
17         $(OBJ)expression.o $(OBJ)firstPass.o $(OBJ)freeAst.o $(OBJ)grammar.o $(OBJ)lexer.o \
18         $(OBJ)loadSymbols.o $(OBJ)output.o $(OBJ)pass0.o $(OBJ)pass1.o $(OBJ)pass15.o $(OBJ)pass16.o \
19         $(OBJ)pass2.o $(OBJ)pass3.o $(OBJ)shortcuts.o $(OBJ)type.o $(OBJ)bsl.o
20
21 SOURCES = bootstrap/ast.c bootstrap/copy.c bootstrap/dbpass.c bootstrap/ec.main.c \
22         bootstrap/ecdefs.c bootstrap/expression.c bootstrap/firstPass.c bootstrap/freeAst.c \
23         bootstrap/grammar.c bootstrap/lexer.c bootstrap/loadSymbols.c bootstrap/output.c bootstrap/pass0.c \
24         bootstrap/pass1.c bootstrap/pass15.c bootstrap/pass16.c bootstrap/pass2.c bootstrap/pass3.c \
25         bootstrap/shortcuts.c bootstrap/type.c ../bsl.c
26
27 # CROSS-PLATFORM MAGIC
28
29 include ../../../include.mk
30
31 # FLAGS
32
33 CFLAGS = -fmessage-length=0 -O2 -ffast-math -m32 $(FPIC) -w \
34          -DYYTOKENTYPE -DECERE_STATIC
35
36 CECFLAGS =
37
38 ECFLAGS = -nolinenumbers
39
40 LIBS = $(SHAREDLIB) $(EXECUTABLE) $(LINKOPT)
41
42 UPXFLAGS = -9 -q
43
44 # TARGETS
45
46 all: objdir $(TARGET)
47
48 objdir:
49         $(if $(wildcard $(OBJ)),,$(call mkdirq,$(OBJ)))
50
51 $(TARGET): $(SOURCES) $(RESOURCES) | objdir $(SYMBOLS) $(OBJECTS)
52         $(AR) rcs $(TARGET) $(OBJECTS) $(LIBS)
53
54 $(OBJ)ast.o: bootstrap/ast.c
55         $(CC) $(CFLAGS) $(FVISIBILITY) -c bootstrap/ast.c -o $(OBJ)ast.o
56
57 $(OBJ)copy.o: bootstrap/copy.c
58         $(CC) $(CFLAGS) $(FVISIBILITY) -c bootstrap/copy.c -o $(OBJ)copy.o
59
60 $(OBJ)dbpass.o: bootstrap/dbpass.c
61         $(CC) $(CFLAGS) $(FVISIBILITY) -c bootstrap/dbpass.c -o $(OBJ)dbpass.o
62
63 $(OBJ)ec.main.o: bootstrap/ec.main.c
64         $(CC) $(CFLAGS) $(FVISIBILITY) -c bootstrap/ec.main.c -o $(OBJ)ec.main.o
65
66 $(OBJ)ecdefs.o: bootstrap/ecdefs.c
67         $(CC) $(CFLAGS) $(FVISIBILITY) -c bootstrap/ecdefs.c -o $(OBJ)ecdefs.o
68
69 $(OBJ)expression.o: bootstrap/expression.c
70         $(CC) $(CFLAGS) $(FVISIBILITY) -c bootstrap/expression.c -o $(OBJ)expression.o
71
72 $(OBJ)firstPass.o: bootstrap/firstPass.c
73         $(CC) $(CFLAGS) $(FVISIBILITY) -c bootstrap/firstPass.c -o $(OBJ)firstPass.o
74
75 $(OBJ)freeAst.o: bootstrap/freeAst.c
76         $(CC) $(CFLAGS) $(FVISIBILITY) -c bootstrap/freeAst.c -o $(OBJ)freeAst.o
77
78 $(OBJ)grammar.o: bootstrap/grammar.c
79         $(CC) $(CFLAGS) $(FVISIBILITY) -c bootstrap/grammar.c -o $(OBJ)grammar.o
80
81 $(OBJ)lexer.o: bootstrap/lexer.c
82         $(CC) $(CFLAGS) $(FVISIBILITY) -c bootstrap/lexer.c -o $(OBJ)lexer.o
83
84 $(OBJ)loadSymbols.o: bootstrap/loadSymbols.c
85         $(CC) $(CFLAGS) $(FVISIBILITY) -c bootstrap/loadSymbols.c -o $(OBJ)loadSymbols.o
86
87 $(OBJ)output.o: bootstrap/output.c
88         $(CC) $(CFLAGS) $(FVISIBILITY) -c bootstrap/output.c -o $(OBJ)output.o
89
90 $(OBJ)pass0.o: bootstrap/pass0.c
91         $(CC) $(CFLAGS) $(FVISIBILITY) -c bootstrap/pass0.c -o $(OBJ)pass0.o
92
93 $(OBJ)pass1.o: bootstrap/pass1.c
94         $(CC) $(CFLAGS) $(FVISIBILITY) -c bootstrap/pass1.c -o $(OBJ)pass1.o
95
96 $(OBJ)pass15.o: bootstrap/pass15.c
97         $(CC) $(CFLAGS) $(FVISIBILITY) -c bootstrap/pass15.c -o $(OBJ)pass15.o
98
99 $(OBJ)pass16.o: bootstrap/pass16.c
100         $(CC) $(CFLAGS) $(FVISIBILITY) -c bootstrap/pass16.c -o $(OBJ)pass16.o
101
102 $(OBJ)pass2.o: bootstrap/pass2.c
103         $(CC) $(CFLAGS) $(FVISIBILITY) -c bootstrap/pass2.c -o $(OBJ)pass2.o
104
105 $(OBJ)pass3.o: bootstrap/pass3.c
106         $(CC) $(CFLAGS) $(FVISIBILITY) -c bootstrap/pass3.c -o $(OBJ)pass3.o
107
108 $(OBJ)shortcuts.o: bootstrap/shortcuts.c
109         $(CC) $(CFLAGS) $(FVISIBILITY) -c bootstrap/shortcuts.c -o $(OBJ)shortcuts.o
110
111 $(OBJ)type.o: bootstrap/type.c
112         $(CC) $(CFLAGS) $(FVISIBILITY) -c bootstrap/type.c -o $(OBJ)type.o
113
114 $(OBJ)bsl.o: ../bsl.c
115         $(CC) $(CFLAGS) $(FVISIBILITY) -c ../bsl.c -o $(OBJ)bsl.o
116
117 clean: objdir
118         $(call rmq,$(TARGET))
119         $(call rmq,$(OBJECTS))
120
121 realclean:
122         $(call rmrq,$(OBJ))
123
124 distclean:
125         $(call rmrq,obj/)