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