buildsystem,makefiles,tarball: improve distclean targets to remove .configs/, *.ews...
[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) $(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 # TARGETS
120
121 all: objdir $(TARGET)
122
123 objdir:
124         $(if $(wildcard $(OBJ)),,$(call mkdir,$(OBJ)))
125
126 $(TARGET): $(SOURCES) $(RESOURCES) | objdir $(SYMBOLS) $(OBJECTS)
127         $(AR) rcs $(TARGET) $(OBJECTS) $(LIBS)
128
129 # OBJECT RULES
130
131 $(OBJ)BufferedFile.o: bootstrap/BufferedFile.c
132         $(CC) $(CFLAGS) $(PRJ_CFLAGS) $(FVISIBILITY) -c bootstrap/BufferedFile.c -o $(OBJ)BufferedFile.o
133
134 $(OBJ)DualPipe.o: bootstrap/DualPipe.c
135         $(CC) $(CFLAGS) $(PRJ_CFLAGS) $(FVISIBILITY) -c bootstrap/DualPipe.c -o $(OBJ)DualPipe.o
136
137 $(OBJ)File.o: bootstrap/File.c
138         $(CC) $(CFLAGS) $(PRJ_CFLAGS) $(FVISIBILITY) -c bootstrap/File.c -o $(OBJ)File.o
139
140 $(OBJ)memory.o: bootstrap/memory.c
141         $(CC) $(CFLAGS) $(PRJ_CFLAGS) $(FVISIBILITY) -c bootstrap/memory.c -o $(OBJ)memory.o
142
143 $(OBJ)System.o: bootstrap/System.c
144         $(CC) $(CFLAGS) $(PRJ_CFLAGS) $(FVISIBILITY) -c bootstrap/System.c -o $(OBJ)System.o
145
146 $(OBJ)TempFile.o: bootstrap/TempFile.c
147         $(CC) $(CFLAGS) $(PRJ_CFLAGS) $(FVISIBILITY) -c bootstrap/TempFile.c -o $(OBJ)TempFile.o
148
149 $(OBJ)File.c.o: ../../../ecere/src/sys/File.c
150         $(CC) $(CFLAGS) $(PRJ_CFLAGS) $(FVISIBILITY) -c ../../../ecere/src/sys/File.c -o $(OBJ)File.c.o
151
152 $(OBJ)DualPipe.c.o: ../../../ecere/src/sys/DualPipe.c
153         $(CC) $(CFLAGS) $(PRJ_CFLAGS) $(FVISIBILITY) -c ../../../ecere/src/sys/DualPipe.c -o $(OBJ)DualPipe.c.o
154
155 $(OBJ)System.c.o: ../../../ecere/src/sys/System.c
156         $(CC) $(CFLAGS) $(PRJ_CFLAGS) $(FVISIBILITY) -c ../../../ecere/src/sys/System.c -o $(OBJ)System.c.o
157
158 $(OBJ)i18n.o: bootstrap/i18n.c
159         $(CC) $(CFLAGS) $(PRJ_CFLAGS) $(FVISIBILITY) -c bootstrap/i18n.c -o $(OBJ)i18n.o
160
161 $(OBJ)Array.o: bootstrap/Array.c
162         $(CC) $(CFLAGS) $(PRJ_CFLAGS) $(FVISIBILITY) -c bootstrap/Array.c -o $(OBJ)Array.o
163
164 $(OBJ)AVLTree.o: bootstrap/AVLTree.c
165         $(CC) $(CFLAGS) $(PRJ_CFLAGS) $(FVISIBILITY) -c bootstrap/AVLTree.c -o $(OBJ)AVLTree.o
166
167 $(OBJ)BuiltInContainer.o: bootstrap/BuiltInContainer.c
168         $(CC) $(CFLAGS) $(PRJ_CFLAGS) $(FVISIBILITY) -c bootstrap/BuiltInContainer.c -o $(OBJ)BuiltInContainer.o
169
170 $(OBJ)Container.o: bootstrap/Container.c
171         $(CC) $(CFLAGS) $(PRJ_CFLAGS) $(FVISIBILITY) -c bootstrap/Container.c -o $(OBJ)Container.o
172
173 $(OBJ)CustomAVLTree.o: bootstrap/CustomAVLTree.c
174         $(CC) $(CFLAGS) $(PRJ_CFLAGS) $(FVISIBILITY) -c bootstrap/CustomAVLTree.c -o $(OBJ)CustomAVLTree.o
175
176 $(OBJ)LinkList.o: bootstrap/LinkList.c
177         $(CC) $(CFLAGS) $(PRJ_CFLAGS) $(FVISIBILITY) -c bootstrap/LinkList.c -o $(OBJ)LinkList.o
178
179 $(OBJ)List.o: bootstrap/List.c
180         $(CC) $(CFLAGS) $(PRJ_CFLAGS) $(FVISIBILITY) -c bootstrap/List.c -o $(OBJ)List.o
181
182 $(OBJ)Map.o: bootstrap/Map.c
183         $(CC) $(CFLAGS) $(PRJ_CFLAGS) $(FVISIBILITY) -c bootstrap/Map.c -o $(OBJ)Map.o
184
185 $(OBJ)BinaryTree.o: bootstrap/BinaryTree.c
186         $(CC) $(CFLAGS) $(PRJ_CFLAGS) $(FVISIBILITY) -c bootstrap/BinaryTree.c -o $(OBJ)BinaryTree.o
187
188 $(OBJ)BTNode.o: bootstrap/BTNode.c
189         $(CC) $(CFLAGS) $(PRJ_CFLAGS) $(FVISIBILITY) -c bootstrap/BTNode.c -o $(OBJ)BTNode.o
190
191 $(OBJ)dataTypes.o: bootstrap/dataTypes.c
192         $(CC) $(CFLAGS) $(PRJ_CFLAGS) $(FVISIBILITY) -c bootstrap/dataTypes.c -o $(OBJ)dataTypes.o
193
194 $(OBJ)instance.o: bootstrap/instance.c
195         $(CC) $(CFLAGS) $(PRJ_CFLAGS) $(FVISIBILITY) -c bootstrap/instance.c -o $(OBJ)instance.o
196
197 $(OBJ)String.o: bootstrap/String.c
198         $(CC) $(CFLAGS) $(PRJ_CFLAGS) $(FVISIBILITY) -c bootstrap/String.c -o $(OBJ)String.o
199
200 $(OBJ)OldList.o: bootstrap/OldList.c
201         $(CC) $(CFLAGS) $(PRJ_CFLAGS) $(FVISIBILITY) -c bootstrap/OldList.c -o $(OBJ)OldList.o
202
203 $(OBJ)instance.c.o: ../../../ecere/src/com/instance.c
204         $(CC) $(CFLAGS) $(PRJ_CFLAGS) $(FVISIBILITY) -c ../../../ecere/src/com/instance.c -o $(OBJ)instance.c.o
205
206 $(OBJ)$(MODULE).main$(O): bootstrap/$(MODULE).main.c
207         $(CC) $(CFLAGS) $(PRJ_CFLAGS) $(FVISIBILITY) -c bootstrap/$(MODULE).main.c -o $(OBJ)$(MODULE).main$(O)
208
209 clean: objdir
210         $(call rm,$(TARGET))
211         $(call rm,$(OBJECTS))
212
213 realclean: objdir
214         $(call rmr,$(OBJ))
215
216 distclean:
217         $(_MAKE) -f $(_CF_DIR)Cleanfile distclean distclean_all_subdirs
218
219 Makefile: ;
220 $(_CF_DIR)crossplatform.mk: ;
221 $(_CF_DIR)default.cf: ;