Makefiles: Tweaks for Debian
[sdk] / compiler / bootstrap / ecere / Makefile
1 .PHONY: all objdir clean realclean distclean
2
3 # CONTENT
4
5 MODULE := ecereBootstrap
6 CONFIG := bootstrap
7 COMPILER := default
8 TARGET_TYPE = staticlib
9
10 OBJ = obj/$(CONFIG).$(PLATFORM)/
11
12 RES = res/
13
14 TARGET = obj/$(CONFIG).$(PLATFORM)/$(LP)ecereBootstrap$(A)
15
16 OBJECTS = \
17         $(OBJ)Array.o \
18         $(OBJ)AVLTree.o \
19         $(OBJ)BinaryTree.o \
20         $(OBJ)BTNode.o \
21         $(OBJ)BufferedFile.o \
22         $(OBJ)BuiltInContainer.o \
23         $(OBJ)Container.o \
24         $(OBJ)CustomAVLTree.o \
25         $(OBJ)dataTypes.o \
26         $(OBJ)DualPipe.o \
27         $(OBJ)ecere.main.o \
28         $(OBJ)File.o \
29         $(OBJ)instance.o \
30         $(OBJ)LinkList.o \
31         $(OBJ)List.o \
32         $(OBJ)Map.o \
33         $(OBJ)memory.o \
34         $(OBJ)OldList.o \
35         $(OBJ)String.o \
36         $(OBJ)System.o \
37         $(OBJ)TempFile.o \
38         $(OBJ)instance.c.o \
39         $(OBJ)DualPipe.c.o \
40         $(OBJ)File.c.o \
41         $(OBJ)System.c.o \
42         $(OBJ)i18n.o
43
44 SOURCES = \
45         bootstrap/Array.c \
46         bootstrap/AVLTree.c \
47         bootstrap/BinaryTree.c \
48         bootstrap/i18n.c \
49         bootstrap/BTNode.c \
50         bootstrap/BufferedFile.c \
51         bootstrap/BuiltInContainer.c \
52         bootstrap/Container.c \
53         bootstrap/CustomAVLTree.c \
54         bootstrap/dataTypes.c \
55         bootstrap/DualPipe.c \
56         bootstrap/ecere.main.c \
57         bootstrap/File.c \
58         bootstrap/instance.c \
59         bootstrap/LinkList.c \
60         bootstrap/List.c \
61         bootstrap/Map.c \
62         bootstrap/memory.c \
63         bootstrap/OldList.c \
64         bootstrap/String.c \
65         bootstrap/System.c \
66         bootstrap/TempFile.c \
67         ../../../ecere/src/com/instance.c \
68         ../../../ecere/src/sys/DualPipe.c \
69         ../../../ecere/src/sys/File.c \
70         ../../../ecere/src/sys/System.c
71
72 ifndef DEBIAN_PACKAGE
73 CFLAGS =
74 endif
75 OFLAGS =
76
77 # CROSS-PLATFORM MAGIC
78
79 include ../../../include.mk
80
81 # FLAGS
82
83 CFLAGS += -fmessage-length=0 -O2 -ffast-math -m32 $(FPIC) -w \
84          -DBUILDING_ECERE_COM -DECERE_STATIC -DECERE_BOOTSTRAP
85
86 CECFLAGS =
87
88 ECFLAGS = -defaultns ecere -nolinenumbers
89
90 LIBS = $(SHAREDLIB) $(EXECUTABLE) $(LINKOPT)
91
92 UPXFLAGS = -9 -q
93
94 # HARD CODED PLATFORM-SPECIFIC OPTIONS
95 ifdef LINUX
96 OFLAGS += -Wl,--no-undefined
97 endif
98
99 # TARGETS
100
101 all: objdir $(TARGET)
102
103 objdir:
104         $(if $(wildcard $(OBJ)),,$(call mkdirq,$(OBJ)))
105
106 $(TARGET): $(SOURCES) $(RESOURCES) | objdir $(SYMBOLS) $(OBJECTS)
107         $(AR) rcs $(TARGET) $(OBJECTS) $(LIBS)
108
109 $(OBJ)Array.o: bootstrap/Array.c
110         $(CC) $(CFLAGS) $(FVISIBILITY) -c bootstrap/Array.c -o $(OBJ)Array.o
111
112 $(OBJ)AVLTree.o: bootstrap/AVLTree.c
113         $(CC) $(CFLAGS) $(FVISIBILITY) -c bootstrap/AVLTree.c -o $(OBJ)AVLTree.o
114
115 $(OBJ)BinaryTree.o: bootstrap/BinaryTree.c
116         $(CC) $(CFLAGS) $(FVISIBILITY) -c bootstrap/BinaryTree.c -o $(OBJ)BinaryTree.o
117
118 $(OBJ)BTNode.o: bootstrap/BTNode.c
119         $(CC) $(CFLAGS) $(FVISIBILITY) -c bootstrap/BTNode.c -o $(OBJ)BTNode.o
120
121 $(OBJ)BufferedFile.o: bootstrap/BufferedFile.c
122         $(CC) $(CFLAGS) $(FVISIBILITY) -c bootstrap/BufferedFile.c -o $(OBJ)BufferedFile.o
123
124 $(OBJ)BuiltInContainer.o: bootstrap/BuiltInContainer.c
125         $(CC) $(CFLAGS) $(FVISIBILITY) -c bootstrap/BuiltInContainer.c -o $(OBJ)BuiltInContainer.o
126
127 $(OBJ)Container.o: bootstrap/Container.c
128         $(CC) $(CFLAGS) $(FVISIBILITY) -c bootstrap/Container.c -o $(OBJ)Container.o
129
130 $(OBJ)CustomAVLTree.o: bootstrap/CustomAVLTree.c
131         $(CC) $(CFLAGS) $(FVISIBILITY) -c bootstrap/CustomAVLTree.c -o $(OBJ)CustomAVLTree.o
132
133 $(OBJ)dataTypes.o: bootstrap/dataTypes.c
134         $(CC) $(CFLAGS) $(FVISIBILITY) -c bootstrap/dataTypes.c -o $(OBJ)dataTypes.o
135
136 $(OBJ)DualPipe.o: bootstrap/DualPipe.c
137         $(CC) $(CFLAGS) $(FVISIBILITY) -c bootstrap/DualPipe.c -o $(OBJ)DualPipe.o
138
139 $(OBJ)ecere.main.o: bootstrap/ecere.main.c
140         $(CC) $(CFLAGS) $(FVISIBILITY) -c bootstrap/ecere.main.c -o $(OBJ)ecere.main.o
141
142 $(OBJ)File.o: bootstrap/File.c
143         $(CC) $(CFLAGS) $(FVISIBILITY) -c bootstrap/File.c -o $(OBJ)File.o
144
145 $(OBJ)instance.o: bootstrap/instance.c
146         $(CC) $(CFLAGS) $(FVISIBILITY) -c bootstrap/instance.c -o $(OBJ)instance.o
147
148 $(OBJ)i18n.o: bootstrap/i18n.c
149         $(CC) $(CFLAGS) $(FVISIBILITY) -c bootstrap/i18n.c -o $(OBJ)i18n.o
150
151 $(OBJ)LinkList.o: bootstrap/LinkList.c
152         $(CC) $(CFLAGS) $(FVISIBILITY) -c bootstrap/LinkList.c -o $(OBJ)LinkList.o
153
154 $(OBJ)List.o: bootstrap/List.c
155         $(CC) $(CFLAGS) $(FVISIBILITY) -c bootstrap/List.c -o $(OBJ)List.o
156
157 $(OBJ)Map.o: bootstrap/Map.c
158         $(CC) $(CFLAGS) $(FVISIBILITY) -c bootstrap/Map.c -o $(OBJ)Map.o
159
160 $(OBJ)memory.o: bootstrap/memory.c
161         $(CC) $(CFLAGS) $(FVISIBILITY) -c bootstrap/memory.c -o $(OBJ)memory.o
162
163 $(OBJ)OldList.o: bootstrap/OldList.c
164         $(CC) $(CFLAGS) $(FVISIBILITY) -c bootstrap/OldList.c -o $(OBJ)OldList.o
165
166 $(OBJ)String.o: bootstrap/String.c
167         $(CC) $(CFLAGS) $(FVISIBILITY) -c bootstrap/String.c -o $(OBJ)String.o
168
169 $(OBJ)System.o: bootstrap/System.c
170         $(CC) $(CFLAGS) $(FVISIBILITY) -c bootstrap/System.c -o $(OBJ)System.o
171
172 $(OBJ)TempFile.o: bootstrap/TempFile.c
173         $(CC) $(CFLAGS) $(FVISIBILITY) -c bootstrap/TempFile.c -o $(OBJ)TempFile.o
174
175 $(OBJ)instance.c.o: ../../../ecere/src/com/instance.c
176         $(CC) $(CFLAGS) $(FVISIBILITY) -c ../../../ecere/src/com/instance.c -o $(OBJ)instance.c.o
177
178 $(OBJ)DualPipe.c.o: ../../../ecere/src/sys/DualPipe.c
179         $(CC) $(CFLAGS) $(FVISIBILITY) -c ../../../ecere/src/sys/DualPipe.c -o $(OBJ)DualPipe.c.o
180
181 $(OBJ)File.c.o: ../../../ecere/src/sys/File.c
182         $(CC) $(CFLAGS) $(FVISIBILITY) -c ../../../ecere/src/sys/File.c -o $(OBJ)File.c.o
183
184 $(OBJ)System.c.o: ../../../ecere/src/sys/System.c
185         $(CC) $(CFLAGS) $(FVISIBILITY) -c ../../../ecere/src/sys/System.c -o $(OBJ)System.c.o
186
187 clean: objdir
188         $(call rmq,$(TARGET))
189         $(call rmq,$(OBJECTS))
190
191 realclean:
192         $(call rmrq,$(OBJ))
193
194 distclean:
195         $(call rmrq,obj/)