misc; correct execute permissions for various files.
[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)/
42
43 RES = 
44
45 TARGET = obj/$(CONFIG).$(PLATFORM)/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         locale/zh_CN/LC_MESSAGES/extract.mo
95 RESOURCES2 = \
96         locale/es_ES/LC_MESSAGES/extract.mo
97
98 LIBS += $(SHAREDLIB) $(EXECUTABLE) $(LINKOPT)
99
100 ifndef STATIC_LIBRARY_TARGET
101 LIBS += \
102         $(call _L,ecereVanilla) \
103         $(call _L,z)
104 endif
105
106 PRJ_CFLAGS += \
107          $(if $(DEBUG), -g, -Os) $(FORCE_32_BIT) $(FPIC) -w \
108                          -DECERE_STATIC
109
110
111 ECFLAGS += \
112          -nolinenumbers
113
114
115 # PLATFORM-SPECIFIC OPTIONS
116
117 ifdef WINDOWS_TARGET
118
119 ifndef STATIC_LIBRARY_TARGET
120 LIBS += \
121         $(call _L,mpr) \
122         $(call _L,winmm) \
123         $(call _L,imm32) \
124         $(call _L,gdi32)
125 endif
126
127 else
128 ifdef LINUX_TARGET
129
130 ifndef STATIC_LIBRARY_TARGET
131 OFLAGS += \
132          -L/usr/X11R6/lib
133 LIBS += \
134         $(call _L,fontconfig) \
135         $(call _L,freetype) \
136         $(call _L,Xrender) \
137         $(call _L,Xext) \
138         $(call _L,ncurses) \
139         $(call _L,m) \
140         $(call _L,dl) \
141         $(call _L,pthread) \
142         $(call _L,X11)
143 endif
144
145 else
146 ifdef OSX_TARGET
147
148 ifndef STATIC_LIBRARY_TARGET
149 OFLAGS += \
150          -L/usr/X11R6/lib
151 LIBS += \
152         $(call _L,fontconfig) \
153         $(call _L,freetype) \
154         $(call _L,Xrender) \
155         $(call _L,Xext) \
156         $(call _L,ncurses) \
157         $(call _L,m) \
158         $(call _L,dl) \
159         $(call _L,pthread) \
160         $(call _L,X11)
161 endif
162
163 endif
164 endif
165 endif
166
167
168
169 CECFLAGS += -cpp $(_CPP)
170
171 ifndef STATIC_LIBRARY_TARGET
172 OFLAGS += $(FORCE_32_BIT) \
173          -L../../ecere/obj/vanilla.$(PLATFORM) \
174          -L../../deps/zlib/obj/release.$(PLATFORM)
175 endif
176
177 # TARGETS
178
179 all: objdir $(TARGET)
180
181 objdir:
182         $(if $(wildcard $(OBJ)),,$(call mkdirq,$(OBJ)))
183
184 $(OBJ)$(MODULE).main.ec: $(SYMBOLS) $(COBJECTS)
185         $(ECS) $(ECSLIBOPT) $(SYMBOLS) $(IMPORTS) -symbols obj/$(CONFIG).$(PLATFORM) -o $(OBJ)$(MODULE).main.ec
186
187 $(OBJ)$(MODULE).main.c: $(OBJ)$(MODULE).main.ec
188         $(ECP) $(CFLAGS) $(CECFLAGS) $(ECFLAGS) $(PRJ_CFLAGS) -c $(OBJ)$(MODULE).main.ec -o $(OBJ)$(MODULE).main.sym -symbols $(OBJ)
189         $(ECC) $(CFLAGS) $(CECFLAGS) $(ECFLAGS) $(PRJ_CFLAGS) $(FVISIBILITY) -c $(OBJ)$(MODULE).main.ec -o $(OBJ)$(MODULE).main.c -symbols $(OBJ)
190
191 $(SYMBOLS): | objdir
192 $(OBJECTS): | objdir
193 $(TARGET): $(SOURCES) $(RESOURCES) $(SYMBOLS) $(OBJECTS) | objdir
194 ifndef STATIC_LIBRARY_TARGET
195         $(CC) $(OFLAGS) $(OBJECTS) $(LIBS) -o $(TARGET) $(INSTALLNAME)
196 ifndef NOSTRIP
197         $(STRIP) $(STRIPOPT) $(TARGET)
198 endif
199 ifndef WINDOWS_TARGET
200 ifdef EXECUTABLE_TARGET
201         @-$(call psep,$(UPX) $(UPXFLAGS) $(TARGET)) || $(call echo,upx not installed; not compressing.)
202 endif
203 else
204         @-$(call psep,$(UPX) $(UPXFLAGS) $(TARGET)) || $(call echo,upx not installed; not compressing.)
205 endif
206         $(EAR) aw$(EARFLAGS) $(TARGET) ../../ecere/res/vanilla/ecere/actions/folderNew.png ../../ecere/res/vanilla/ecere/actions/goUp.png "ecere/actions"
207         $(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"
208         $(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"
209         $(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"
210         $(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"
211         $(EAR) aw$(EARFLAGS) $(TARGET) ../../ecere/res/vanilla/ecere/status/folderOpen.png "ecere/status"
212         $(EAR) aw$(EARFLAGS) $(TARGET) locale/zh_CN/LC_MESSAGES/extract.mo "locale/zh_CN/LC_MESSAGES"
213         $(EAR) aw$(EARFLAGS) $(TARGET) locale/es_ES/LC_MESSAGES/extract.mo "locale/es_ES/LC_MESSAGES"
214 else
215         $(AR) rcs $(TARGET) $(OBJECTS) $(LIBS)
216 endif
217
218 # SYMBOL RULES
219
220 $(OBJ)extract.sym: extract.ec
221         $(ECP) $(CFLAGS) $(CECFLAGS) $(ECFLAGS) $(PRJ_CFLAGS) -c extract.ec -o $(OBJ)extract.sym
222
223 # C OBJECT RULES
224
225 $(OBJ)extract.c: extract.ec $(OBJ)extract.sym | $(SYMBOLS)
226         $(ECC) $(CFLAGS) $(CECFLAGS) $(ECFLAGS) $(PRJ_CFLAGS) $(FVISIBILITY) -c extract.ec -o $(OBJ)extract.c -symbols $(OBJ)
227
228 # OBJECT RULES
229
230 $(OBJ)extract.o: $(OBJ)extract.c
231         $(CC) $(CFLAGS) $(PRJ_CFLAGS) $(FVISIBILITY) -c $(OBJ)extract.c -o $(OBJ)extract.o
232
233 $(OBJ)$(MODULE).main$(O): $(OBJ)$(MODULE).main.c
234         $(CC) $(CFLAGS) $(PRJ_CFLAGS) $(FVISIBILITY) -c $(OBJ)$(MODULE).main.c -o $(OBJ)$(MODULE).main$(O)
235
236 cleantarget: objdir
237         $(call rmq,$(TARGET))
238
239 clean: cleantarget
240         $(call rmq,$(_OBJECTS))
241         $(call rmq,$(OBJ)$(MODULE).main.o $(OBJ)$(MODULE).main.c $(OBJ)$(MODULE).main.ec $(OBJ)$(MODULE).main$(I) $(OBJ)$(MODULE).main$(S))
242         $(call rmq,$(ECOBJECTS))
243         $(call rmq,$(COBJECTS))
244         $(call rmq,$(BOWLS))
245         $(call rmq,$(IMPORTS))
246         $(call rmq,$(SYMBOLS))
247
248 realclean: cleantarget
249         $(call rmrq,$(OBJ))
250
251 distclean: cleantarget
252         $(call rmrq,obj/)