01984faebcccf90fe2f394e67f4ed78af44c7f42
[sdk] / compiler / bootstrap / ecere / Makefile
1 .PHONY: all objdir clean realclean distclean
2
3 # CORE VARIABLES
4
5 MODULE := ecere
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 endif
19 CECFLAGS =
20 OFLAGS =
21 LDFLAGS =
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 = res/
42
43 TARGET = obj/$(CONFIG).$(PLATFORM)$(COMPILER_SUFFIX)$(DEBUG_SUFFIX)/$(LP)ecereBootstrap$(A)
44
45 OBJECTS = \
46         $(OBJ)Array.o \
47         $(OBJ)AVLTree.o \
48         $(OBJ)BinaryTree.o \
49         $(OBJ)BTNode.o \
50         $(OBJ)BufferedFile.o \
51         $(OBJ)BuiltInContainer.o \
52         $(OBJ)Container.o \
53         $(OBJ)CustomAVLTree.o \
54         $(OBJ)dataTypes.o \
55         $(OBJ)DualPipe.o \
56         $(OBJ)ecere.main.o \
57         $(OBJ)File.o \
58         $(OBJ)instance.o \
59         $(OBJ)LinkList.o \
60         $(OBJ)List.o \
61         $(OBJ)Map.o \
62         $(OBJ)memory.o \
63         $(OBJ)OldList.o \
64         $(OBJ)String.o \
65         $(OBJ)System.o \
66         $(OBJ)TempFile.o \
67         $(OBJ)instance.c.o \
68         $(OBJ)DualPipe.c.o \
69         $(OBJ)File.c.o \
70         $(OBJ)System.c.o \
71         $(OBJ)i18n.o
72
73 SOURCES = \
74         bootstrap/Array.c \
75         bootstrap/AVLTree.c \
76         bootstrap/BinaryTree.c \
77         bootstrap/i18n.c \
78         bootstrap/BTNode.c \
79         bootstrap/BufferedFile.c \
80         bootstrap/BuiltInContainer.c \
81         bootstrap/Container.c \
82         bootstrap/CustomAVLTree.c \
83         bootstrap/dataTypes.c \
84         bootstrap/DualPipe.c \
85         bootstrap/ecere.main.c \
86         bootstrap/File.c \
87         bootstrap/instance.c \
88         bootstrap/LinkList.c \
89         bootstrap/List.c \
90         bootstrap/Map.c \
91         bootstrap/memory.c \
92         bootstrap/OldList.c \
93         bootstrap/String.c \
94         bootstrap/System.c \
95         bootstrap/TempFile.c \
96         ../../../ecere/src/com/instance.c \
97         ../../../ecere/src/sys/DualPipe.c \
98         ../../../ecere/src/sys/File.c \
99         ../../../ecere/src/sys/System.c
100
101 LIBS += $(SHAREDLIB) $(EXECUTABLE) $(LINKOPT)
102
103 ifndef STATIC_LIBRARY_TARGET
104 LIBS +=
105 endif
106
107 CFLAGS += \
108          $(if $(DEBIAN_PACKAGE),$(CPPFLAGS),) $(if $(DEBUG), -D_DEBUG,) \
109          $(if $(DEBUG), -g, -O2 -ffast-math) $(FORCE_32_BIT) $(FPIC) -w \
110          -DBUILDING_ECERE_COM -DECERE_STATIC -DECERE_BOOTSTRAP
111 ECFLAGS += \
112          -nolinenumbers -defaultns ecere
113
114
115
116
117 CECFLAGS += -cpp $(_CPP)
118
119 ifndef STATIC_LIBRARY_TARGET
120 OFLAGS += $(FORCE_32_BIT)
121 OFLAGS += $(LDFLAGS)
122 endif
123
124 # TARGETS
125
126 all: objdir $(TARGET)
127
128 objdir:
129         $(if $(wildcard $(OBJ)),,$(call mkdirq,$(OBJ)))
130
131 $(TARGET): $(SOURCES) $(RESOURCES) | objdir $(SYMBOLS) $(OBJECTS)
132         $(AR) rcs $(TARGET) $(OBJECTS) $(LIBS)
133
134 # OBJECT RULES
135
136 $(OBJ)BufferedFile.o: bootstrap/BufferedFile.c
137         $(CC) $(CFLAGS) $(FVISIBILITY) -c bootstrap/BufferedFile.c -o $(OBJ)BufferedFile.o
138
139 $(OBJ)DualPipe.o: bootstrap/DualPipe.c
140         $(CC) $(CFLAGS) $(FVISIBILITY) -c bootstrap/DualPipe.c -o $(OBJ)DualPipe.o
141
142 $(OBJ)File.o: bootstrap/File.c
143         $(CC) $(CFLAGS) $(FVISIBILITY) -c bootstrap/File.c -o $(OBJ)File.o
144
145 $(OBJ)memory.o: bootstrap/memory.c
146         $(CC) $(CFLAGS) $(FVISIBILITY) -c bootstrap/memory.c -o $(OBJ)memory.o
147
148 $(OBJ)System.o: bootstrap/System.c
149         $(CC) $(CFLAGS) $(FVISIBILITY) -c bootstrap/System.c -o $(OBJ)System.o
150
151 $(OBJ)TempFile.o: bootstrap/TempFile.c
152         $(CC) $(CFLAGS) $(FVISIBILITY) -c bootstrap/TempFile.c -o $(OBJ)TempFile.o
153
154 $(OBJ)File.c.o: ../../../ecere/src/sys/File.c
155         $(CC) $(CFLAGS) $(FVISIBILITY) -c ../../../ecere/src/sys/File.c -o $(OBJ)File.c.o
156
157 $(OBJ)DualPipe.c.o: ../../../ecere/src/sys/DualPipe.c
158         $(CC) $(CFLAGS) $(FVISIBILITY) -c ../../../ecere/src/sys/DualPipe.c -o $(OBJ)DualPipe.c.o
159
160 $(OBJ)System.c.o: ../../../ecere/src/sys/System.c
161         $(CC) $(CFLAGS) $(FVISIBILITY) -c ../../../ecere/src/sys/System.c -o $(OBJ)System.c.o
162
163 $(OBJ)i18n.o: bootstrap/i18n.c
164         $(CC) $(CFLAGS) $(FVISIBILITY) -c bootstrap/i18n.c -o $(OBJ)i18n.o
165
166 $(OBJ)Array.o: bootstrap/Array.c
167         $(CC) $(CFLAGS) $(FVISIBILITY) -c bootstrap/Array.c -o $(OBJ)Array.o
168
169 $(OBJ)AVLTree.o: bootstrap/AVLTree.c
170         $(CC) $(CFLAGS) $(FVISIBILITY) -c bootstrap/AVLTree.c -o $(OBJ)AVLTree.o
171
172 $(OBJ)BuiltInContainer.o: bootstrap/BuiltInContainer.c
173         $(CC) $(CFLAGS) $(FVISIBILITY) -c bootstrap/BuiltInContainer.c -o $(OBJ)BuiltInContainer.o
174
175 $(OBJ)Container.o: bootstrap/Container.c
176         $(CC) $(CFLAGS) $(FVISIBILITY) -c bootstrap/Container.c -o $(OBJ)Container.o
177
178 $(OBJ)CustomAVLTree.o: bootstrap/CustomAVLTree.c
179         $(CC) $(CFLAGS) $(FVISIBILITY) -c bootstrap/CustomAVLTree.c -o $(OBJ)CustomAVLTree.o
180
181 $(OBJ)LinkList.o: bootstrap/LinkList.c
182         $(CC) $(CFLAGS) $(FVISIBILITY) -c bootstrap/LinkList.c -o $(OBJ)LinkList.o
183
184 $(OBJ)List.o: bootstrap/List.c
185         $(CC) $(CFLAGS) $(FVISIBILITY) -c bootstrap/List.c -o $(OBJ)List.o
186
187 $(OBJ)Map.o: bootstrap/Map.c
188         $(CC) $(CFLAGS) $(FVISIBILITY) -c bootstrap/Map.c -o $(OBJ)Map.o
189
190 $(OBJ)BinaryTree.o: bootstrap/BinaryTree.c
191         $(CC) $(CFLAGS) $(FVISIBILITY) -c bootstrap/BinaryTree.c -o $(OBJ)BinaryTree.o
192
193 $(OBJ)BTNode.o: bootstrap/BTNode.c
194         $(CC) $(CFLAGS) $(FVISIBILITY) -c bootstrap/BTNode.c -o $(OBJ)BTNode.o
195
196 $(OBJ)dataTypes.o: bootstrap/dataTypes.c
197         $(CC) $(CFLAGS) $(FVISIBILITY) -c bootstrap/dataTypes.c -o $(OBJ)dataTypes.o
198
199 $(OBJ)instance.o: bootstrap/instance.c
200         $(CC) $(CFLAGS) $(FVISIBILITY) -c bootstrap/instance.c -o $(OBJ)instance.o
201
202 $(OBJ)String.o: bootstrap/String.c
203         $(CC) $(CFLAGS) $(FVISIBILITY) -c bootstrap/String.c -o $(OBJ)String.o
204
205 $(OBJ)OldList.o: bootstrap/OldList.c
206         $(CC) $(CFLAGS) $(FVISIBILITY) -c bootstrap/OldList.c -o $(OBJ)OldList.o
207
208 $(OBJ)instance.c.o: ../../../ecere/src/com/instance.c
209         $(CC) $(CFLAGS) $(FVISIBILITY) -c ../../../ecere/src/com/instance.c -o $(OBJ)instance.c.o
210
211 $(OBJ)$(MODULE).main$(O): bootstrap/$(MODULE).main.c
212         $(CC) $(CFLAGS) $(FVISIBILITY) -c bootstrap/$(MODULE).main.c -o $(OBJ)$(MODULE).main$(O)
213
214 clean: objdir
215         $(call rmq,$(TARGET))
216         $(call rmq,$(OBJECTS))
217
218 realclean: clean
219         $(call rmrq,$(OBJ))
220
221 distclean:
222         $(call rmrq,obj/)