sdk/Build System: Synced up latest changes to makefiles
[sdk] / compiler / bootstrap / libec / Makefile
1 .PHONY: all objdir clean realclean distclean
2
3 # CORE VARIABLES
4
5 MODULE := ec
6 CONFIG := bootstrap
7 ifndef COMPILER
8 COMPILER := default
9 endif
10
11 TARGET_TYPE = staticlib
12
13 # FLAGS
14
15 ECFLAGS =
16 ifndef DEBIAN_PACKAGE
17 CFLAGS =
18 LDFLAGS =
19 endif
20 CECFLAGS =
21 OFLAGS =
22 LIBS =
23
24 ifdef DEBUG
25 NOSTRIP := y
26 endif
27
28 CONSOLE = -mwindows
29
30 # INCLUDES
31
32 _CF_DIR = ../../../
33
34 include $(_CF_DIR)crossplatform.mk
35 include $(_CF_DIR)default.cf
36
37 # POST-INCLUDES VARIABLES
38
39 OBJ = obj/$(CONFIG).$(PLATFORM)$(COMPILER_SUFFIX)$(DEBUG_SUFFIX)/
40
41 RES = 
42
43 TARGET = obj/$(CONFIG).$(PLATFORM)$(COMPILER_SUFFIX)$(DEBUG_SUFFIX)/$(LP)ecBootstrap$(A)
44
45 OBJECTS = \
46         $(OBJ)ast.o \
47         $(OBJ)copy.o \
48         $(OBJ)dbpass.o \
49         $(OBJ)ec.main.o \
50         $(OBJ)ecdefs.o \
51         $(OBJ)expression.o \
52         $(OBJ)firstPass.o \
53         $(OBJ)freeAst.o \
54         $(OBJ)grammar.o \
55         $(OBJ)lexer.o \
56         $(OBJ)loadSymbols.o \
57         $(OBJ)output.o \
58         $(OBJ)pass0.o \
59         $(OBJ)pass1.o \
60         $(OBJ)pass15.o \
61         $(OBJ)pass16.o \
62         $(OBJ)pass2.o \
63         $(OBJ)pass3.o \
64         $(OBJ)shortcuts.o \
65         $(OBJ)type.o \
66         $(OBJ)bsl.o
67
68 SOURCES = \
69         bootstrap/ast.c \
70         bootstrap/copy.c \
71         bootstrap/dbpass.c \
72         bootstrap/ec.main.c \
73         bootstrap/ecdefs.c \
74         bootstrap/expression.c \
75         bootstrap/firstPass.c \
76         bootstrap/freeAst.c \
77         bootstrap/grammar.c \
78         bootstrap/lexer.c \
79         bootstrap/loadSymbols.c \
80         bootstrap/output.c \
81         bootstrap/pass0.c \
82         bootstrap/pass1.c \
83         bootstrap/pass15.c \
84         bootstrap/pass16.c \
85         bootstrap/pass2.c \
86         bootstrap/pass3.c \
87         bootstrap/shortcuts.c \
88         bootstrap/type.c \
89         ../bsl.c
90
91 LIBS += $(SHAREDLIB) $(EXECUTABLE) $(LINKOPT)
92
93 ifndef STATIC_LIBRARY_TARGET
94 LIBS +=
95 endif
96
97 CFLAGS += \
98          $(if $(DEBUG), -g, -O2 -ffast-math) $(FORCE_32_BIT) $(FPIC) -w \
99                          -DECERE_STATIC
100 ECFLAGS += \
101          -nolinenumbers
102
103
104
105
106 CECFLAGS += -cpp $(_CPP)
107
108 ifndef STATIC_LIBRARY_TARGET
109 OFLAGS += $(FORCE_32_BIT)
110 endif
111
112 # TARGETS
113
114 all: objdir $(TARGET)
115
116 objdir:
117         $(if $(wildcard $(OBJ)),,$(call mkdirq,$(OBJ)))
118
119 $(TARGET): $(SOURCES) $(RESOURCES) | objdir $(SYMBOLS) $(OBJECTS)
120         $(AR) rcs $(TARGET) $(OBJECTS) $(LIBS)
121
122 # OBJECT RULES
123
124 $(OBJ)ast.o: bootstrap/ast.c
125         $(CC) $(CFLAGS) $(FVISIBILITY) -c bootstrap/ast.c -o $(OBJ)ast.o
126
127 $(OBJ)copy.o: bootstrap/copy.c
128         $(CC) $(CFLAGS) $(FVISIBILITY) -c bootstrap/copy.c -o $(OBJ)copy.o
129
130 $(OBJ)dbpass.o: bootstrap/dbpass.c
131         $(CC) $(CFLAGS) $(FVISIBILITY) -c bootstrap/dbpass.c -o $(OBJ)dbpass.o
132
133 $(OBJ)ec.main.o: bootstrap/ec.main.c
134         $(CC) $(CFLAGS) $(FVISIBILITY) -c bootstrap/ec.main.c -o $(OBJ)ec.main.o
135
136 $(OBJ)ecdefs.o: bootstrap/ecdefs.c
137         $(CC) $(CFLAGS) $(FVISIBILITY) -c bootstrap/ecdefs.c -o $(OBJ)ecdefs.o
138
139 $(OBJ)expression.o: bootstrap/expression.c
140         $(CC) $(CFLAGS) $(FVISIBILITY) -c bootstrap/expression.c -o $(OBJ)expression.o
141
142 $(OBJ)firstPass.o: bootstrap/firstPass.c
143         $(CC) $(CFLAGS) $(FVISIBILITY) -c bootstrap/firstPass.c -o $(OBJ)firstPass.o
144
145 $(OBJ)freeAst.o: bootstrap/freeAst.c
146         $(CC) $(CFLAGS) $(FVISIBILITY) -c bootstrap/freeAst.c -o $(OBJ)freeAst.o
147
148 $(OBJ)grammar.o: bootstrap/grammar.c
149         $(CC) $(CFLAGS) $(FVISIBILITY) -c bootstrap/grammar.c -o $(OBJ)grammar.o
150
151 $(OBJ)lexer.o: bootstrap/lexer.c
152         $(CC) $(CFLAGS) $(FVISIBILITY) -c bootstrap/lexer.c -o $(OBJ)lexer.o
153
154 $(OBJ)loadSymbols.o: bootstrap/loadSymbols.c
155         $(CC) $(CFLAGS) $(FVISIBILITY) -c bootstrap/loadSymbols.c -o $(OBJ)loadSymbols.o
156
157 $(OBJ)output.o: bootstrap/output.c
158         $(CC) $(CFLAGS) $(FVISIBILITY) -c bootstrap/output.c -o $(OBJ)output.o
159
160 $(OBJ)pass0.o: bootstrap/pass0.c
161         $(CC) $(CFLAGS) $(FVISIBILITY) -c bootstrap/pass0.c -o $(OBJ)pass0.o
162
163 $(OBJ)pass1.o: bootstrap/pass1.c
164         $(CC) $(CFLAGS) $(FVISIBILITY) -c bootstrap/pass1.c -o $(OBJ)pass1.o
165
166 $(OBJ)pass15.o: bootstrap/pass15.c
167         $(CC) $(CFLAGS) $(FVISIBILITY) -c bootstrap/pass15.c -o $(OBJ)pass15.o
168
169 $(OBJ)pass16.o: bootstrap/pass16.c
170         $(CC) $(CFLAGS) $(FVISIBILITY) -c bootstrap/pass16.c -o $(OBJ)pass16.o
171
172 $(OBJ)pass2.o: bootstrap/pass2.c
173         $(CC) $(CFLAGS) $(FVISIBILITY) -c bootstrap/pass2.c -o $(OBJ)pass2.o
174
175 $(OBJ)pass3.o: bootstrap/pass3.c
176         $(CC) $(CFLAGS) $(FVISIBILITY) -c bootstrap/pass3.c -o $(OBJ)pass3.o
177
178 $(OBJ)shortcuts.o: bootstrap/shortcuts.c
179         $(CC) $(CFLAGS) $(FVISIBILITY) -c bootstrap/shortcuts.c -o $(OBJ)shortcuts.o
180
181 $(OBJ)type.o: bootstrap/type.c
182         $(CC) $(CFLAGS) $(FVISIBILITY) -c bootstrap/type.c -o $(OBJ)type.o
183
184 $(OBJ)bsl.o: ../bsl.c
185         $(CC) $(CFLAGS) $(FVISIBILITY) -c ../bsl.c -o $(OBJ)bsl.o
186
187 clean: objdir
188         $(call rmq,$(TARGET))
189         $(call rmq,$(OBJECTS))
190
191 realclean: clean
192         $(call rmrq,$(OBJ))
193
194 distclean:
195         $(call rmrq,obj/)