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