sdk/ide: Fixed Makefiles not passing keeping LDFLAGS from Debian packaging
[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 $(DEBIAN_PACKAGE),$(CPPFLAGS),) $(if $(DEBUG), -D_DEBUG,) \
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 OFLAGS += $(LDFLAGS)
176 endif
177
178 # TARGETS
179
180 all: objdir $(TARGET)
181
182 objdir:
183         $(if $(wildcard $(OBJ)),,$(call mkdirq,$(OBJ)))
184
185 $(OBJ)$(MODULE).main.ec: $(SYMBOLS) $(COBJECTS)
186         $(ECS) $(ECSLIBOPT) $(SYMBOLS) $(IMPORTS) -symbols obj/$(CONFIG).$(PLATFORM) -o $(OBJ)$(MODULE).main.ec
187
188 $(OBJ)$(MODULE).main.c: $(OBJ)$(MODULE).main.ec
189         $(ECP) $(CECFLAGS) $(ECFLAGS) $(CFLAGS) -c $(OBJ)$(MODULE).main.ec -o $(OBJ)$(MODULE).main.sym -symbols $(OBJ)
190         $(ECC) $(CECFLAGS) $(ECFLAGS) $(CFLAGS) $(FVISIBILITY) -c $(OBJ)$(MODULE).main.ec -o $(OBJ)$(MODULE).main.c -symbols $(OBJ)
191
192 $(SYMBOLS): | objdir
193 $(OBJECTS): | objdir
194 $(TARGET): $(SOURCES) $(RESOURCES) $(SYMBOLS) $(OBJECTS) | objdir
195 ifndef STATIC_LIBRARY_TARGET
196         $(CC) $(OFLAGS) $(OBJECTS) $(LIBS) -o $(TARGET) $(INSTALLNAME)
197 ifndef NOSTRIP
198         $(STRIP) $(STRIPOPT) $(TARGET)
199 endif
200 ifndef WINDOWS_TARGET
201 ifdef EXECUTABLE_TARGET
202         @-$(call psep,$(UPX) $(UPXFLAGS) $(TARGET)) || $(call echo,upx not installed; not compressing.)
203 endif
204 else
205         @-$(call psep,$(UPX) $(UPXFLAGS) $(TARGET)) || $(call echo,upx not installed; not compressing.)
206 endif
207         $(EAR) $(EARFLAGS) $(TARGET) ../../ecere/res/vanilla/ecere/actions/folderNew.png ../../ecere/res/vanilla/ecere/actions/goUp.png "ecere/actions"
208         $(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"
209         $(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"
210         $(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"
211         $(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"
212         $(EAR) $(EARFLAGS) $(TARGET) ../../ecere/res/vanilla/ecere/status/folderOpen.png "ecere/status"
213         $(EAR) $(EARFLAGS) $(TARGET) locale/zh_CN/LC_MESSAGES/extract.mo "locale/zh_CN/LC_MESSAGES"
214         $(EAR) $(EARFLAGS) $(TARGET) locale/es_ES/LC_MESSAGES/extract.mo "locale/es_ES/LC_MESSAGES"
215 else
216         $(AR) rcs $(TARGET) $(OBJECTS) $(LIBS)
217 endif
218
219 # SYMBOL RULES
220
221 $(OBJ)extract.sym: extract.ec
222         $(ECP) $(CECFLAGS) $(ECFLAGS) $(CFLAGS) -c extract.ec -o $(OBJ)extract.sym
223
224 # C OBJECT RULES
225
226 $(OBJ)extract.c: extract.ec $(OBJ)extract.sym | $(SYMBOLS)
227         $(ECC) $(CECFLAGS) $(ECFLAGS) $(CFLAGS) $(FVISIBILITY) -c extract.ec -o $(OBJ)extract.c -symbols $(OBJ)
228
229 # OBJECT RULES
230
231 $(OBJ)extract.o: $(OBJ)extract.c
232         $(CC) $(CFLAGS) $(FVISIBILITY) -c $(OBJ)extract.c -o $(OBJ)extract.o
233
234 $(OBJ)$(MODULE).main$(O): $(OBJ)$(MODULE).main.c
235         $(CC) $(CFLAGS) $(FVISIBILITY) -c $(OBJ)$(MODULE).main.c -o $(OBJ)$(MODULE).main$(O)
236
237 clean: objdir
238         $(call rmq,$(OBJ)$(MODULE).main.o $(OBJ)$(MODULE).main.c $(OBJ)$(MODULE).main.ec $(OBJ)$(MODULE).main$(I) $(OBJ)$(MODULE).main$(S) $(TARGET))
239         $(call rmq,$(_OBJECTS))
240         $(call rmq,$(ECOBJECTS))
241         $(call rmq,$(COBJECTS))
242         $(call rmq,$(BOWLS))
243         $(call rmq,$(IMPORTS))
244         $(call rmq,$(SYMBOLS))
245
246 realclean: clean
247         $(call rmrq,$(OBJ))
248
249 distclean:
250         $(call rmrq,obj/)