973dd5fe004119049bac54494a2e0db0922fa355
[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 LDFLAGS =
19 endif
20 PRJ_CFLAGS =
21 CECFLAGS =
22 OFLAGS =
23 LIBS =
24
25 ifdef DEBUG
26 NOSTRIP := y
27 endif
28
29 CONSOLE = -mwindows
30
31 # INCLUDES
32
33 _CF_DIR = ../../../
34
35 include $(_CF_DIR)crossplatform.mk
36 include $(_CF_DIR)default.cf
37
38 # POST-INCLUDES VARIABLES
39
40 OBJ = obj/$(CONFIG).$(PLATFORM)$(COMPILER_SUFFIX)$(DEBUG_SUFFIX)/
41
42 RES = res/
43
44 TARGET = obj/$(CONFIG).$(PLATFORM)$(COMPILER_SUFFIX)$(DEBUG_SUFFIX)/$(LP)ecereBootstrap$(A)
45
46 OBJECTS = \
47         $(OBJ)Array.o \
48         $(OBJ)AVLTree.o \
49         $(OBJ)BinaryTree.o \
50         $(OBJ)BTNode.o \
51         $(OBJ)BufferedFile.o \
52         $(OBJ)BuiltInContainer.o \
53         $(OBJ)Container.o \
54         $(OBJ)CustomAVLTree.o \
55         $(OBJ)dataTypes.o \
56         $(OBJ)DualPipe.o \
57         $(OBJ)ecere.main.o \
58         $(OBJ)File.o \
59         $(OBJ)instance.o \
60         $(OBJ)LinkList.o \
61         $(OBJ)List.o \
62         $(OBJ)Map.o \
63         $(OBJ)memory.o \
64         $(OBJ)OldList.o \
65         $(OBJ)String.o \
66         $(OBJ)System.o \
67         $(OBJ)TempFile.o \
68         $(OBJ)instance.c.o \
69         $(OBJ)DualPipe.c.o \
70         $(OBJ)File.c.o \
71         $(OBJ)System.c.o \
72         $(OBJ)i18n.o
73
74 SOURCES = \
75         bootstrap/Array.c \
76         bootstrap/AVLTree.c \
77         bootstrap/BinaryTree.c \
78         bootstrap/i18n.c \
79         bootstrap/BTNode.c \
80         bootstrap/BufferedFile.c \
81         bootstrap/BuiltInContainer.c \
82         bootstrap/Container.c \
83         bootstrap/CustomAVLTree.c \
84         bootstrap/dataTypes.c \
85         bootstrap/DualPipe.c \
86         bootstrap/ecere.main.c \
87         bootstrap/File.c \
88         bootstrap/instance.c \
89         bootstrap/LinkList.c \
90         bootstrap/List.c \
91         bootstrap/Map.c \
92         bootstrap/memory.c \
93         bootstrap/OldList.c \
94         bootstrap/String.c \
95         bootstrap/System.c \
96         bootstrap/TempFile.c \
97         ../../../ecere/src/com/instance.c \
98         ../../../ecere/src/sys/DualPipe.c \
99         ../../../ecere/src/sys/File.c \
100         ../../../ecere/src/sys/System.c
101
102 LIBS += $(SHAREDLIB) $(EXECUTABLE) $(LINKOPT)
103
104 ifndef STATIC_LIBRARY_TARGET
105 LIBS +=
106 endif
107
108 PRJ_CFLAGS += \
109          $(if $(DEBUG),-g) $(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 endif
122
123 # TARGETS
124
125 all: objdir $(TARGET)
126
127 objdir:
128         $(if $(wildcard $(OBJ)),,$(call mkdirq,$(OBJ)))
129
130 $(TARGET): $(SOURCES) $(RESOURCES) | objdir $(SYMBOLS) $(OBJECTS)
131         $(AR) rcs $(TARGET) $(OBJECTS) $(LIBS)
132
133 # OBJECT RULES
134
135 $(OBJ)BufferedFile.o: bootstrap/BufferedFile.c
136         $(CC) $(CFLAGS) $(PRJ_CFLAGS) $(FVISIBILITY) -c bootstrap/BufferedFile.c -o $(OBJ)BufferedFile.o
137
138 $(OBJ)DualPipe.o: bootstrap/DualPipe.c
139         $(CC) $(CFLAGS) $(PRJ_CFLAGS) $(FVISIBILITY) -c bootstrap/DualPipe.c -o $(OBJ)DualPipe.o
140
141 $(OBJ)File.o: bootstrap/File.c
142         $(CC) $(CFLAGS) $(PRJ_CFLAGS) $(FVISIBILITY) -c bootstrap/File.c -o $(OBJ)File.o
143
144 $(OBJ)memory.o: bootstrap/memory.c
145         $(CC) $(CFLAGS) $(PRJ_CFLAGS) $(FVISIBILITY) -c bootstrap/memory.c -o $(OBJ)memory.o
146
147 $(OBJ)System.o: bootstrap/System.c
148         $(CC) $(CFLAGS) $(PRJ_CFLAGS) $(FVISIBILITY) -c bootstrap/System.c -o $(OBJ)System.o
149
150 $(OBJ)TempFile.o: bootstrap/TempFile.c
151         $(CC) $(CFLAGS) $(PRJ_CFLAGS) $(FVISIBILITY) -c bootstrap/TempFile.c -o $(OBJ)TempFile.o
152
153 $(OBJ)File.c.o: ../../../ecere/src/sys/File.c
154         $(CC) $(CFLAGS) $(PRJ_CFLAGS) $(FVISIBILITY) -c ../../../ecere/src/sys/File.c -o $(OBJ)File.c.o
155
156 $(OBJ)DualPipe.c.o: ../../../ecere/src/sys/DualPipe.c
157         $(CC) $(CFLAGS) $(PRJ_CFLAGS) $(FVISIBILITY) -c ../../../ecere/src/sys/DualPipe.c -o $(OBJ)DualPipe.c.o
158
159 $(OBJ)System.c.o: ../../../ecere/src/sys/System.c
160         $(CC) $(CFLAGS) $(PRJ_CFLAGS) $(FVISIBILITY) -c ../../../ecere/src/sys/System.c -o $(OBJ)System.c.o
161
162 $(OBJ)i18n.o: bootstrap/i18n.c
163         $(CC) $(CFLAGS) $(PRJ_CFLAGS) $(FVISIBILITY) -c bootstrap/i18n.c -o $(OBJ)i18n.o
164
165 $(OBJ)Array.o: bootstrap/Array.c
166         $(CC) $(CFLAGS) $(PRJ_CFLAGS) $(FVISIBILITY) -c bootstrap/Array.c -o $(OBJ)Array.o
167
168 $(OBJ)AVLTree.o: bootstrap/AVLTree.c
169         $(CC) $(CFLAGS) $(PRJ_CFLAGS) $(FVISIBILITY) -c bootstrap/AVLTree.c -o $(OBJ)AVLTree.o
170
171 $(OBJ)BuiltInContainer.o: bootstrap/BuiltInContainer.c
172         $(CC) $(CFLAGS) $(PRJ_CFLAGS) $(FVISIBILITY) -c bootstrap/BuiltInContainer.c -o $(OBJ)BuiltInContainer.o
173
174 $(OBJ)Container.o: bootstrap/Container.c
175         $(CC) $(CFLAGS) $(PRJ_CFLAGS) $(FVISIBILITY) -c bootstrap/Container.c -o $(OBJ)Container.o
176
177 $(OBJ)CustomAVLTree.o: bootstrap/CustomAVLTree.c
178         $(CC) $(CFLAGS) $(PRJ_CFLAGS) $(FVISIBILITY) -c bootstrap/CustomAVLTree.c -o $(OBJ)CustomAVLTree.o
179
180 $(OBJ)LinkList.o: bootstrap/LinkList.c
181         $(CC) $(CFLAGS) $(PRJ_CFLAGS) $(FVISIBILITY) -c bootstrap/LinkList.c -o $(OBJ)LinkList.o
182
183 $(OBJ)List.o: bootstrap/List.c
184         $(CC) $(CFLAGS) $(PRJ_CFLAGS) $(FVISIBILITY) -c bootstrap/List.c -o $(OBJ)List.o
185
186 $(OBJ)Map.o: bootstrap/Map.c
187         $(CC) $(CFLAGS) $(PRJ_CFLAGS) $(FVISIBILITY) -c bootstrap/Map.c -o $(OBJ)Map.o
188
189 $(OBJ)BinaryTree.o: bootstrap/BinaryTree.c
190         $(CC) $(CFLAGS) $(PRJ_CFLAGS) $(FVISIBILITY) -c bootstrap/BinaryTree.c -o $(OBJ)BinaryTree.o
191
192 $(OBJ)BTNode.o: bootstrap/BTNode.c
193         $(CC) $(CFLAGS) $(PRJ_CFLAGS) $(FVISIBILITY) -c bootstrap/BTNode.c -o $(OBJ)BTNode.o
194
195 $(OBJ)dataTypes.o: bootstrap/dataTypes.c
196         $(CC) $(CFLAGS) $(PRJ_CFLAGS) $(FVISIBILITY) -c bootstrap/dataTypes.c -o $(OBJ)dataTypes.o
197
198 $(OBJ)instance.o: bootstrap/instance.c
199         $(CC) $(CFLAGS) $(PRJ_CFLAGS) $(FVISIBILITY) -c bootstrap/instance.c -o $(OBJ)instance.o
200
201 $(OBJ)String.o: bootstrap/String.c
202         $(CC) $(CFLAGS) $(PRJ_CFLAGS) $(FVISIBILITY) -c bootstrap/String.c -o $(OBJ)String.o
203
204 $(OBJ)OldList.o: bootstrap/OldList.c
205         $(CC) $(CFLAGS) $(PRJ_CFLAGS) $(FVISIBILITY) -c bootstrap/OldList.c -o $(OBJ)OldList.o
206
207 $(OBJ)instance.c.o: ../../../ecere/src/com/instance.c
208         $(CC) $(CFLAGS) $(PRJ_CFLAGS) $(FVISIBILITY) -c ../../../ecere/src/com/instance.c -o $(OBJ)instance.c.o
209
210 $(OBJ)$(MODULE).main$(O): bootstrap/$(MODULE).main.c
211         $(CC) $(CFLAGS) $(PRJ_CFLAGS) $(FVISIBILITY) -c bootstrap/$(MODULE).main.c -o $(OBJ)$(MODULE).main$(O)
212
213 clean: objdir
214         $(call rmq,$(TARGET))
215         $(call rmq,$(OBJECTS))
216
217 realclean: objdir
218         $(call rmrq,$(OBJ))
219
220 distclean: objdir
221         $(call rmrq,obj/)