sdk tarball/Windows: Fixed build by removing call to escspaces
[sdk] / ear / extract / Makefile
1 .PHONY: all objdir clean realclean distclean
2
3 # CORE VARIABLES
4
5 MODULE := extract
6 CONFIG := release
7 ifndef COMPILER
8 COMPILER := default
9 endif
10
11 TARGET_TYPE = executable
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 ifdef EXECUTABLE_TARGET
29 CONSOLE = -mwindows
30 endif
31
32 # INCLUDES
33
34 _CF_DIR = ../../
35
36 include $(_CF_DIR)crossplatform.mk
37 include $(_CF_DIR)include.mk
38
39 # CUSTOM TOOLCHAIN / COMPILER CONFIG
40
41 export LD_LIBRARY_PATH = ../../obj/$(PLATFORM)/lib/
42 export DYLD_LIBRARY_PATH = ../../obj/$(PLATFORM)/lib/
43 ECP := $(call psep,../../compiler/bootstrap/obj/bin.$(PLATFORM)/ecp)
44 ECC := $(call psep,../../compiler/bootstrap/obj/bin.$(PLATFORM)/ecc)
45 ECS := $(call psep,../../compiler/bootstrap/obj/bin.$(PLATFORM)/ecs)
46 EAR := $(call psep,../../obj/$(PLATFORM)/bin/ear)
47
48 # END OF CUSTOM TOOLCHAIN / COMPILER CONFIG
49
50 # POST-INCLUDES VARIABLES
51
52 OBJ = obj/$(CONFIG).$(PLATFORM)/
53
54 RES = 
55
56 TARGET = obj/$(CONFIG).$(PLATFORM)/extract$(E)
57
58 _ECSOURCES = \
59         extract.ec
60
61 ECSOURCES = $(call shwspace,$(_ECSOURCES))
62
63 COBJECTS = $(call shwspace,$(addprefix $(OBJ),$(patsubst %.ec,%$(C),$(notdir $(_ECSOURCES)))))
64
65 SYMBOLS = $(call shwspace,$(addprefix $(OBJ),$(patsubst %.ec,%$(S),$(notdir $(_ECSOURCES)))))
66
67 IMPORTS = $(call shwspace,$(addprefix $(OBJ),$(patsubst %.ec,%$(I),$(notdir $(_ECSOURCES)))))
68
69 ECOBJECTS = $(call shwspace,$(addprefix $(OBJ),$(patsubst %.ec,%$(O),$(notdir $(_ECSOURCES)))))
70
71 BOWLS = $(call shwspace,$(addprefix $(OBJ),$(patsubst %.ec,%$(B),$(notdir $(_ECSOURCES)))))
72
73 OBJECTS = $(ECOBJECTS) $(OBJ)$(MODULE).main$(O)
74
75 SOURCES = $(ECSOURCES)
76
77 RESOURCES = $(RESOURCES1) $(RESOURCES2)
78 RESOURCES1 = \
79         ../../ecere/res/vanilla/ecere/actions/folderNew.png \
80         ../../ecere/res/vanilla/ecere/actions/goUp.png \
81         ../../ecere/res/vanilla/ecere/devices/computer.png \
82         ../../ecere/res/vanilla/ecere/devices/driveHardDisk.png \
83         ../../ecere/res/vanilla/ecere/devices/driveRemovableMedia.png \
84         ../../ecere/res/vanilla/ecere/devices/mediaFloppy.png \
85         ../../ecere/res/vanilla/ecere/devices/mediaOptical.png \
86         ../../ecere/res/vanilla/ecere/elements/areaClose.png \
87         ../../ecere/res/vanilla/ecere/elements/areaMaximize.png \
88         ../../ecere/res/vanilla/ecere/elements/areaMinimize.png \
89         ../../ecere/res/vanilla/ecere/elements/areaRestore.png \
90         ../../ecere/res/vanilla/ecere/elements/arrowDown.png \
91         ../../ecere/res/vanilla/ecere/elements/arrowLeft.png \
92         ../../ecere/res/vanilla/ecere/elements/arrowRight.png \
93         ../../ecere/res/vanilla/ecere/elements/arrowUp.png \
94         ../../ecere/res/vanilla/ecere/elements/optionBoxDisabledSelected.png \
95         ../../ecere/res/vanilla/ecere/elements/optionBoxDown.png \
96         ../../ecere/res/vanilla/ecere/elements/optionBoxSelected.png \
97         ../../ecere/res/vanilla/ecere/elements/optionBoxSelectedDown.png \
98         ../../ecere/res/vanilla/ecere/elements/optionBoxUp.png \
99         ../../ecere/res/vanilla/ecere/places/driveRemote.png \
100         ../../ecere/res/vanilla/ecere/places/folder.png \
101         ../../ecere/res/vanilla/ecere/places/folderRemote.png \
102         ../../ecere/res/vanilla/ecere/places/networkServer.png \
103         ../../ecere/res/vanilla/ecere/places/networkWorkgroup.png \
104         ../../ecere/res/vanilla/ecere/status/folderOpen.png \
105         locale/zh_CN/LC_MESSAGES/extract.mo
106 RESOURCES2 = \
107         locale/es_ES/LC_MESSAGES/extract.mo
108
109 LIBS += $(SHAREDLIB) $(EXECUTABLE) $(LINKOPT)
110
111 ifndef STATIC_LIBRARY_TARGET
112 LIBS += \
113         $(call _L,ecereVanilla) \
114         $(call _L,z)
115 endif
116
117 CFLAGS += \
118          $(if $(DEBIAN_PACKAGE),$(CPPFLAGS),) $(if $(DEBUG), -D_DEBUG,) \
119          $(if $(DEBUG), -g, -Os) $(FORCE_32_BIT) $(FPIC) -w \
120                          -DECERE_STATIC
121
122
123 ECFLAGS += \
124          -nolinenumbers
125
126
127 # PLATFORM-SPECIFIC OPTIONS
128
129 ifdef WINDOWS_TARGET
130
131 ifndef STATIC_LIBRARY_TARGET
132 LIBS += \
133         $(call _L,mpr) \
134         $(call _L,winmm) \
135         $(call _L,imm32)
136 endif
137
138 else
139 ifdef LINUX_TARGET
140
141 ifndef STATIC_LIBRARY_TARGET
142 OFLAGS += \
143          -L/usr/X11R6/lib
144 LIBS += \
145         $(call _L,fontconfig) \
146         $(call _L,freetype) \
147         $(call _L,Xrender) \
148         $(call _L,Xext) \
149         $(call _L,ncurses) \
150         $(call _L,m) \
151         $(call _L,dl) \
152         $(call _L,pthread) \
153         $(call _L,X11)
154 endif
155
156 else
157 ifdef OSX_TARGET
158
159 ifndef STATIC_LIBRARY_TARGET
160 OFLAGS += \
161          -L/usr/X11R6/lib
162 LIBS += \
163         $(call _L,fontconfig) \
164         $(call _L,freetype) \
165         $(call _L,Xrender) \
166         $(call _L,Xext) \
167         $(call _L,ncurses) \
168         $(call _L,m) \
169         $(call _L,dl) \
170         $(call _L,pthread) \
171         $(call _L,X11)
172 endif
173
174 endif
175 endif
176 endif
177
178
179
180 CECFLAGS += -cpp $(CPP)
181
182 ifndef STATIC_LIBRARY_TARGET
183 OFLAGS += $(FORCE_32_BIT) \
184          -L../../ecere/obj/vanilla.$(PLATFORM) \
185          -L../../deps/zlib/obj/release.$(PLATFORM)
186 OFLAGS += $(LDFLAGS)
187 endif
188
189 # TARGETS
190
191 all: objdir $(TARGET)
192
193 objdir:
194         $(if $(wildcard $(OBJ)),,$(call mkdirq,$(OBJ)))
195
196 $(OBJ)$(MODULE).main.ec: $(SYMBOLS) $(COBJECTS)
197         $(ECS) $(ECSLIBOPT) $(SYMBOLS) $(IMPORTS) -symbols obj/$(CONFIG).$(PLATFORM) -o $(OBJ)$(MODULE).main.ec
198
199 $(OBJ)$(MODULE).main.c: $(OBJ)$(MODULE).main.ec
200         $(ECP) $(CECFLAGS) $(ECFLAGS) $(CFLAGS) -c $(OBJ)$(MODULE).main.ec -o $(OBJ)$(MODULE).main.sym -symbols $(OBJ)
201         $(ECC) $(CECFLAGS) $(ECFLAGS) $(CFLAGS) $(FVISIBILITY) -c $(OBJ)$(MODULE).main.ec -o $(OBJ)$(MODULE).main.c -symbols $(OBJ)
202
203 $(SYMBOLS): | objdir
204 $(OBJECTS): | objdir
205 $(TARGET): $(SOURCES) $(RESOURCES) $(SYMBOLS) $(OBJECTS) | objdir
206 ifndef STATIC_LIBRARY_TARGET
207         $(CC) $(OFLAGS) $(OBJECTS) $(LIBS) -o $(TARGET) $(INSTALLNAME)
208 ifndef NOSTRIP
209         $(STRIP) $(STRIPOPT) $(TARGET)
210 endif
211 ifndef WINDOWS_TARGET
212 ifdef EXECUTABLE_TARGET
213         @-$(call psep,$(UPX) $(UPXFLAGS) $(TARGET)) || $(call echo,upx not installed; not compressing.)
214 endif
215 else
216         @-$(call psep,$(UPX) $(UPXFLAGS) $(TARGET)) || $(call echo,upx not installed; not compressing.)
217 endif
218         $(EAR) $(EARFLAGS) $(TARGET) ../../ecere/res/vanilla/ecere/actions/folderNew.png ../../ecere/res/vanilla/ecere/actions/goUp.png "ecere/actions"
219         $(EAR) $(EARFLAGS) $(TARGET) ../../ecere/res/vanilla/ecere/devices/computer.png ../../ecere/res/vanilla/ecere/devices/driveHardDisk.png ../../ecere/res/vanilla/ecere/devices/driveRemovableMedia.png ../../ecere/res/vanilla/ecere/devices/mediaFloppy.png ../../ecere/res/vanilla/ecere/devices/mediaOptical.png "ecere/devices"
220         $(EAR) $(EARFLAGS) $(TARGET) ../../ecere/res/vanilla/ecere/elements/areaClose.png ../../ecere/res/vanilla/ecere/elements/areaMaximize.png ../../ecere/res/vanilla/ecere/elements/areaMinimize.png ../../ecere/res/vanilla/ecere/elements/areaRestore.png ../../ecere/res/vanilla/ecere/elements/arrowDown.png ../../ecere/res/vanilla/ecere/elements/arrowLeft.png ../../ecere/res/vanilla/ecere/elements/arrowRight.png ../../ecere/res/vanilla/ecere/elements/arrowUp.png ../../ecere/res/vanilla/ecere/elements/optionBoxDisabledSelected.png ../../ecere/res/vanilla/ecere/elements/optionBoxDown.png "ecere/elements"
221         $(EAR) $(EARFLAGS) $(TARGET) ../../ecere/res/vanilla/ecere/elements/optionBoxSelected.png ../../ecere/res/vanilla/ecere/elements/optionBoxSelectedDown.png ../../ecere/res/vanilla/ecere/elements/optionBoxUp.png "ecere/elements"
222         $(EAR) $(EARFLAGS) $(TARGET) ../../ecere/res/vanilla/ecere/places/driveRemote.png ../../ecere/res/vanilla/ecere/places/folder.png ../../ecere/res/vanilla/ecere/places/folderRemote.png ../../ecere/res/vanilla/ecere/places/networkServer.png ../../ecere/res/vanilla/ecere/places/networkWorkgroup.png "ecere/places"
223         $(EAR) $(EARFLAGS) $(TARGET) ../../ecere/res/vanilla/ecere/status/folderOpen.png "ecere/status"
224         $(EAR) $(EARFLAGS) $(TARGET) locale/zh_CN/LC_MESSAGES/extract.mo "locale/zh_CN/LC_MESSAGES"
225         $(EAR) $(EARFLAGS) $(TARGET) locale/es_ES/LC_MESSAGES/extract.mo "locale/es_ES/LC_MESSAGES"
226 else
227         $(AR) rcs $(TARGET) $(OBJECTS) $(LIBS)
228 endif
229
230 # SYMBOL RULES
231
232 $(OBJ)extract.sym: extract.ec
233         $(ECP) $(CECFLAGS) $(ECFLAGS) $(CFLAGS) -c extract.ec -o $(OBJ)extract.sym
234
235 # C OBJECT RULES
236
237 $(OBJ)extract.c: extract.ec $(OBJ)extract.sym | $(SYMBOLS)
238         $(ECC) $(CECFLAGS) $(ECFLAGS) $(CFLAGS) $(FVISIBILITY) -c extract.ec -o $(OBJ)extract.c -symbols $(OBJ)
239
240 # OBJECT RULES
241
242 $(OBJ)extract.o: $(OBJ)extract.c
243         $(CC) $(CFLAGS) $(FVISIBILITY) -c $(OBJ)extract.c -o $(OBJ)extract.o
244
245 $(OBJ)$(MODULE).main$(O): $(OBJ)$(MODULE).main.c
246         $(CC) $(CFLAGS) $(FVISIBILITY) -c $(OBJ)$(MODULE).main.c -o $(OBJ)$(MODULE).main$(O)
247
248 clean: objdir
249         $(call rmq,$(OBJ)$(MODULE).main.o $(OBJ)$(MODULE).main.c $(OBJ)$(MODULE).main.ec $(OBJ)$(MODULE).main$(I) $(OBJ)$(MODULE).main$(S) $(TARGET))
250         $(call rmq,$(_OBJECTS))
251         $(call rmq,$(ECOBJECTS))
252         $(call rmq,$(COBJECTS))
253         $(call rmq,$(BOWLS))
254         $(call rmq,$(IMPORTS))
255         $(call rmq,$(SYMBOLS))
256
257 realclean: clean
258         $(call rmrq,$(OBJ))
259
260 distclean:
261         $(call rmrq,obj/)