Merge pull request #3394 from groth-its/fix-pathsubstitution-rss
[vuplus_xbmc] / Makefile.in
1 include bootstrap.mk
2
3 null :=
4 space := ${null} ${null}
5 ${space} := ${space}
6
7 AUTOGENERATED_MAKEFILES=@OUTPUT_FILES@
8
9 EC_DIRS= \
10         tools/EventClients
11
12 XBMCTEX_DIRS= \
13         tools/TexturePacker
14
15 DVDPCODECS_DIRS= \
16         lib \
17         lib/libdvd
18
19 DVDPLAYER_ARCHIVES=xbmc/cores/dvdplayer/DVDPlayer.a \
20                    xbmc/cores/dvdplayer/DVDCodecs/DVDCodecs.a \
21                    xbmc/cores/dvdplayer/DVDCodecs/Audio/Audio.a \
22                    xbmc/cores/dvdplayer/DVDCodecs/Overlay/Overlay.a \
23                    xbmc/cores/dvdplayer/DVDCodecs/Video/Video.a \
24                    xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxers.a \
25                    xbmc/cores/dvdplayer/DVDInputStreams/DVDInputStreams.a \
26                    xbmc/cores/dvdplayer/DVDSubtitles/DVDSubtitles.a
27
28 DIRECTORY_ARCHIVES=$(DVDPLAYER_ARCHIVES) \
29                    lib/SlingboxLib/SlingboxLib.a \
30                    lib/libRTV/librtv.a \
31                    lib/libXDAAP/libxdaap.a \
32                    lib/libhts/libhts.a \
33                    lib/libsquish/libsquish.a \
34                    lib/xbmc-dll-symbols/dll-symbols.a \
35                    xbmc/addons/addons.a \
36                    xbmc/cdrip/cdrip.a \
37                    xbmc/cores/AudioEngine/audioengine.a \
38                    xbmc/cores/DllLoader/dllloader.a \
39                    xbmc/cores/DllLoader/exports/exports.a \
40                    xbmc/cores/DllLoader/exports/util/exports_utils.a \
41                    xbmc/cores/ExternalPlayer/ExternalPlayer.a \
42                    xbmc/cores/VideoRenderers/VideoRenderer.a \
43                    xbmc/cores/VideoRenderers/VideoShaders/VideoShaders.a \
44                    xbmc/cores/cores.a \
45                    xbmc/cores/paplayer/paplayer.a \
46                    xbmc/cores/playercorefactory/playercorefactory.a \
47                    xbmc/dbwrappers/dbwrappers.a \
48                    xbmc/dialogs/dialogs.a \
49                    xbmc/epg/epg.a \
50                    xbmc/filesystem/MusicDatabaseDirectory/musicdatabasedirectory.a \
51                    xbmc/filesystem/VideoDatabaseDirectory/videodatabasedirectory.a \
52                    xbmc/filesystem/filesystem.a \
53                    xbmc/guilib/guilib.a \
54                    xbmc/input/input.a \
55                    xbmc/interfaces/generic/interfaces-generic.a \
56                    xbmc/interfaces/info/info.a \
57                    xbmc/interfaces/interfaces.a \
58                    xbmc/interfaces/json-rpc/json-rpc.a \
59                    xbmc/linux/linux.a \
60                    xbmc/music/dialogs/musicdialogs.a \
61                    xbmc/music/infoscanner/musicscanner.a \
62                    xbmc/music/karaoke/karaoke.a \
63                    xbmc/music/music.a \
64                    xbmc/music/tags/musictags.a \
65                    xbmc/music/windows/musicwindows.a \
66                    xbmc/network/websocket/websocket.a \
67                    xbmc/network/network.a \
68                    xbmc/peripherals/bus/peripheral-bus.a \
69                    xbmc/peripherals/devices/peripheral-devices.a \
70                    xbmc/peripherals/dialogs/peripheral-dialogs.a \
71                    xbmc/peripherals/peripherals.a \
72                    xbmc/pictures/pictures.a \
73                    xbmc/playlists/playlists.a \
74                    xbmc/powermanagement/powermanagement.a \
75                    xbmc/profiles/profiles.a \
76                    xbmc/profiles/dialogs/profiles_dialogs.a \
77                    xbmc/profiles/windows/profiles_windows.a \
78                    xbmc/programs/programs.a \
79                    xbmc/pvr/addons/pvraddons.a \
80                    xbmc/pvr/channels/pvrchannels.a \
81                    xbmc/pvr/dialogs/pvrdialogs.a \
82                    xbmc/pvr/pvr.a \
83                    xbmc/pvr/recordings/pvrrecordings.a \
84                    xbmc/pvr/timers/pvrtimers.a \
85                    xbmc/pvr/windows/pvrwindows.a \
86                    xbmc/rendering/rendering.a \
87                    xbmc/settings/settings.a \
88                    xbmc/settings/dialogs/settings_dialogs.a \
89                    xbmc/settings/windows/settings_windows.a \
90                    xbmc/storage/storage.a \
91                    xbmc/utils/utils.a \
92                    xbmc/video/dialogs/videodialogs.a \
93                    xbmc/video/video.a \
94                    xbmc/video/windows/videowindows.a \
95                    xbmc/view/view.a \
96                    xbmc/windowing/windowing.a \
97                    xbmc/windows/windows.a \
98                    xbmc/xbmc.a \
99
100 NWAOBJSXBMC=    xbmc/threads/threads.a \
101                 xbmc/commons/commons.a
102
103
104 ifeq (@USE_WEB_SERVER@,1)
105 DIRECTORY_ARCHIVES += xbmc/network/httprequesthandler/httprequesthandlers.a
106 endif
107
108 DIRECTORY_ARCHIVES += xbmc/interfaces/legacy/legacy.a
109 DIRECTORY_ARCHIVES += xbmc/interfaces/python/python_binding.a
110
111 ifeq (@USE_OPENGL@,1)
112 DIRECTORY_ARCHIVES += xbmc/rendering/gl/rendering_gl.a
113 endif
114
115 ifeq (@USE_OPENGLES@,1)
116 DIRECTORY_ARCHIVES += xbmc/rendering/gles/rendering_gles.a
117 DIRECTORY_ARCHIVES += xbmc/windowing/egl/windowing_egl.a
118 DIRECTORY_ARCHIVES += xbmc/visualizations/EGLHelpers/eglhelpers.a
119 endif
120
121 ifeq (@USE_UPNP@,1)
122 DIRECTORY_ARCHIVES += lib/libUPnP/libupnp.a \
123                       xbmc/network/upnp/upnp.a
124 endif
125
126 ifeq (@USE_MDNSEMBEDDED@,1)
127 DIRECTORY_ARCHIVES += xbmc/network/mdns/mdns.a
128 endif
129
130 INSTALL_FILTER = .*visualization\.dxspectrum.*
131 INSTALL_FILTER += .*visualization\.milkdrop.*
132
133 ifeq ($(findstring osx,@ARCH@),osx)
134 DIRECTORY_ARCHIVES += xbmc/osx/osx.a
135 DIRECTORY_ARCHIVES += xbmc/network/osx/network.a
136 DIRECTORY_ARCHIVES += xbmc/network/linux/network_linux.a
137 DIRECTORY_ARCHIVES += xbmc/powermanagement/osx/powermanagement.a
138 DIRECTORY_ARCHIVES += xbmc/storage/osx/storage.a
139 DIRECTORY_ARCHIVES += xbmc/windowing/osx/windowing_osx.a
140 INSTALL_FILTER += .*repository\.pvr-android\.xbmc\.org.*
141 INSTALL_FILTER += .*repository\.pvr-ios\.xbmc\.org.*
142 INSTALL_FILTER += .*repository\.pvr-win32\.xbmc\.org.*
143 else
144 INSTALL_FILTER += .*repository\.pvr-ios\.xbmc\.org.*
145 INSTALL_FILTER += .*repository\.pvr-win32\.xbmc\.org.*
146 INSTALL_FILTER += .*repository\.pvr-osx.*\.xbmc\.org.*
147 ifeq (@USE_ANDROID@,1)
148 DIRECTORY_ARCHIVES += xbmc/input/linux/input_linux.a
149 DIRECTORY_ARCHIVES += xbmc/input/touch/input_touch.a
150 DIRECTORY_ARCHIVES += xbmc/input/touch/generic/input_touch_generic.a
151 DIRECTORY_ARCHIVES += xbmc/network/linux/network_linux.a
152 DIRECTORY_ARCHIVES += xbmc/powermanagement/android/powermanagement_android.a
153 DIRECTORY_ARCHIVES += xbmc/storage/android/storage_android.a
154 DIRECTORY_ARCHIVES += xbmc/windowing/X11/windowing_X11.a
155 else
156 DIRECTORY_ARCHIVES += xbmc/input/linux/input_linux.a
157 DIRECTORY_ARCHIVES += xbmc/network/linux/network_linux.a
158 DIRECTORY_ARCHIVES += xbmc/powermanagement/linux/powermanagement_linux.a
159 DIRECTORY_ARCHIVES += xbmc/storage/linux/storage_linux.a
160 DIRECTORY_ARCHIVES += xbmc/windowing/X11/windowing_X11.a
161 INSTALL_FILTER += .*repository\.pvr-android\.xbmc\.org.*
162 endif
163 endif
164
165 ifeq ($(findstring freebsd,@ARCH@),freebsd)
166 DIRECTORY_ARCHIVES += xbmc/freebsd/freebsd.a
167 endif
168
169 ifeq (@HAVE_XBMC_NONFREE@,1)
170 DIRECTORY_ARCHIVES += lib/UnrarXLib/UnrarXLib.a
171 endif
172
173 BIN_DIRS = $(dir $(DIRECTORY_ARCHIVES)) $(dir $(NWAOBJSXBMC))
174
175 ifeq (@USE_ANDROID@,1)
176 DIRECTORY_ARCHIVES += xbmc/android/loader/AndroidDyload.a
177 DIRECTORY_ARCHIVES += xbmc/windowing/android/windowing_android.a
178 DIRECTORY_ARCHIVES += xbmc/android/activity/activity.a
179 DIRECTORY_ARCHIVES += xbmc/android/bionic_supplement/bionic_supplement.a
180 DIRECTORY_ARCHIVES += xbmc/android/jni/jni.a
181 endif
182
183 ifeq (@USE_OMXPLAYER@,1)
184 DIRECTORY_ARCHIVES += xbmc/cores/omxplayer/omxplayer.a
185 endif
186
187 ifeq (@USE_LIBAV_HACKS@,1)
188 DIRECTORY_ARCHIVES += lib/xbmc-libav-hacks/dll-libavhacks.a
189 endif
190
191 PAPCODECS_DIRS= \
192         lib/xbadpcm \
193         lib/nosefart \
194         lib/timidity \
195         lib/libsidplay2 \
196         lib/stsound/StSoundLibrary \
197         lib/snesapu/SNES/SNESAPU \
198         lib/vgmstream
199
200 ifeq (@USE_ASAP_CODEC@,1)
201 PAPCODECS_DIRS+= \
202         lib/asap
203 endif
204
205 LIB_DIRS=\
206         lib/cximage-6.0 \
207         lib/libexif \
208         lib/libhdhomerun \
209         lib/cpluff \
210         lib/xbmc-dll-symbols
211
212 ifeq (@USE_MYSQL@,1)
213 LIB_DIRS += lib/cmyth
214 CMYTH=cmyth
215 endif
216
217 SS_DIRS=
218 ifneq (@DISABLE_RSXS@,1)
219   SS_DIRS+= xbmc/screensavers/rsxs-0.9/xbmc
220 else
221   INSTALL_FILTER+= .*screensaver\.rsxs.*
222 endif
223
224 ifneq (@DISABLE_SPECTRUM@,1)
225   VIS_DIRS+= xbmc/visualizations/OpenGLSpectrum
226 else
227   INSTALL_FILTER+= .*visualization\.glspectrum.*
228 endif
229
230 ifneq (@DISABLE_WAVEFORM@,1)
231   VIS_DIRS+= xbmc/visualizations/WaveForm
232 else
233   INSTALL_FILTER+= .*visualization\.waveform.*
234 endif
235
236 ifneq (@DISABLE_FISHBMC@,1)
237   VIS_DIRS+= xbmc/visualizations/fishBMC
238 else
239   INSTALL_FILTER+= .*visualization\.fishbmc.*
240 endif
241
242 ifneq (@DISABLE_PROJECTM@,1)
243   VIS_DIRS+= xbmc/visualizations/XBMCProjectM
244 else
245   INSTALL_FILTER+= .*visualization\.projectm.*
246 endif
247
248 ifneq (@DISABLE_GOOM@,1)
249   VIS_DIRS+=xbmc/visualizations/Goom
250 else
251   INSTALL_FILTER+= .*visualization\.goom.*
252 endif
253
254 LIBADDON_DIRS=\
255         lib/addons/library.xbmc.addon \
256         lib/addons/library.xbmc.codec \
257         lib/addons/library.xbmc.pvr \
258         lib/addons/library.xbmc.gui \
259
260 CONFLUENCE_MEDIA=addons/skin.confluence/media
261 SKIN_DIRS=$(CONFLUENCE_MEDIA)
262
263 ifeq (@USE_SKIN_TOUCHED@,1)
264 TOUCHED_MEDIA=addons/skin.touched/media
265 SKIN_DIRS+=$(TOUCHED_MEDIA)
266 endif
267
268 DIRS= $(BIN_DIRS) $(EC_DIRS) $(XBMCTEX_DIRS) $(DVDPCODECS_DIRS) $(PAPCODECS_DIRS) \
269         $(LIB_DIRS) $(SS_DIRS) $(VIS_DIRS) $(LIBADDON_DIRS) $(SKIN_DIRS) xbmc/main
270
271 LIBS=@LIBS@
272 CFLAGS=@CFLAGS@
273 CXXFLAGS=@CXXFLAGS@
274 LDFLAGS=@LDFLAGS@
275 INCLUDES=$(sort @INCLUDES@)
276
277 CLEAN_FILES=xbmc.bin xbmc-xrandr libxbmc.so
278
279 DISTCLEAN_FILES=config.h config.log config.status tools/Linux/xbmc.sh \
280         tools/Linux/xbmc-standalone.sh autom4te.cache config.h.in~ \
281         system/libcpluff-@ARCH@.so
282
283 ifeq (@USE_LIBXBMC@,1)
284 FINAL_TARGETS+=libxbmc.so
285 ifeq (@USE_ANDROID@,1)
286 FINAL_TARGETS+=skins
287 endif
288 else
289 FINAL_TARGETS=xbmc.bin skins xbmc-xrandr
290 endif
291 FINAL_TARGETS+=Makefile externals
292
293 GTEST_DIR = lib/gtest
294 GTEST_INCLUDES = -I$(GTEST_DIR)/include
295 GTEST_LIBS = $(GTEST_DIR)/lib/.libs/libgtest.a
296
297 CHECK_DIRS = xbmc/filesystem/test \
298              xbmc/utils/test \
299              xbmc/threads/test \
300              xbmc/interfaces/python/test \
301              xbmc/test
302 CHECK_LIBS = xbmc/filesystem/test/filesystemTest.a \
303              xbmc/utils/test/utilsTest.a \
304              xbmc/threads/test/threadTest.a \
305              xbmc/interfaces/python/test/pythonSwigTest.a \
306              xbmc/windowing/tests/wayland/test_wayland.a \
307              xbmc/test/xbmc-test.a
308
309 ifeq (@USE_WAYLAND_TEST_EXTENSION@,1)
310 WAYLAND_TEST_MODULE = xbmc/windowing/tests/wayland/xbmc-wayland-test-extension.so
311 $(WAYLAND_TEST_MODULE): force
312         $(MAKE) -C $(@D) $(@F)
313 CHECK_EXTENSIONS = $(WAYLAND_TEST_MODULE)
314 CHECK_LIBADD=@WAYLAND_TEST_LIBS@
315 endif
316
317 CHECK_PROGRAMS = xbmc-test
318
319 CLEAN_FILES += $(CHECK_PROGRAMS) $(CHECK_EXTENSIONS)
320
321 all : $(FINAL_TARGETS)
322         @echo '-----------------------'
323         @echo 'XBMC built successfully'
324         @echo '-----------------------'
325
326 include Makefile.include
327
328 .PHONY : dllloader exports visualizations screensavers eventclients papcodecs \
329         dvdpcodecs imagelib codecs externals force skins libaddon check \
330         testframework testsuite
331
332 # hack targets to keep build system up to date
333 Makefile : config.status $(addsuffix .in, $(AUTOGENERATED_MAKEFILES))
334         @echo "Regenerating Makefiles..."
335         @./config.status &> /dev/null
336         @echo "done"
337
338 config.status: configure
339
340 # skin textures
341 ifeq (@USE_TEXTUREPACKER@,1)
342 skins: tools/TexturePacker/TexturePacker force
343          $(MAKE) -C $(CONFLUENCE_MEDIA)
344 ifeq (@USE_SKIN_TOUCHED@,1)
345          $(MAKE) -C $(TOUCHED_MEDIA)
346 endif
347 else
348 skins:
349 endif
350
351 # Setup some dependencies for subdir makes
352 xbmc/cores/paplayer/paplayer.a: papcodecs
353 $(DVDPLAYER_ARCHIVES)         : dvdpcodecs
354
355 $(NWAOBJSXBMC): force
356         @$(MAKE) $(if $(V),,-s) -C $(@D)
357
358 $(DIRECTORY_ARCHIVES): force
359         @$(MAKE) $(if $(V),,-s) -C $(@D)
360
361 lib/cpluff/libcpluff/.libs/libcpluff.a: force
362         $(MAKE) -C lib/cpluff/libcpluff
363 system/libcpluff-@ARCH@.so: lib/cpluff/libcpluff/.libs/libcpluff.a exports
364 ifeq ($(findstring osx,@ARCH@), osx)
365   ifeq (@ARCH@, arm-osx)
366         $(CXX) $(LDFLAGS) -all_load -bundle -flat_namespace -undefined dynamic_lookup -read_only_relocs suppress -o $@ $<
367   else
368         $(CXX) $(LDFLAGS) -all_load -bundle -flat_namespace -undefined dynamic_lookup -lexpat $(BUNDLE1_O) -o $@ $<
369   endif
370 else
371         $(CXX) $(LDFLAGS) -shared -o $@ -Wl,--whole-archive $< \
372                 -Wl,--no-whole-archive  \
373                 `cat xbmc/cores/DllLoader/exports/wrapper.def` xbmc/cores/DllLoader/exports/wrapper.o -lexpat
374 endif
375
376 exports: xbmc/cores/DllLoader/exports/exports.a xbmc/cores/DllLoader/exports/util/exports_utils.a
377         $(MAKE) -C xbmc/cores/DllLoader/exports wrapper.def
378 dllloader: exports xbmc/cores/DllLoader/dllloader.a
379
380 ifeq (@USE_OPENGLES@,1)
381 EGLHELPERS=xbmc/visualizations/EGLHelpers/eglhelpers.a
382 endif
383
384 $(VIS_DIRS): force exports $(EGLHELPERS)
385         $(MAKE) -C $@
386
387 $(SS_DIRS): force exports
388         $(MAKE) -C $@
389
390 visualizations: $(VIS_DIRS)
391
392 screensavers: $(SS_DIRS)
393
394 libaddon: exports
395         $(MAKE) -C lib/addons/library.xbmc.addon
396         $(MAKE) -C lib/addons/library.xbmc.codec
397         $(MAKE) -C lib/addons/library.xbmc.gui
398         $(MAKE) -C lib/addons/library.xbmc.pvr
399 dvdpcodecs: dllloader
400         $(MAKE) -C lib
401         $(MAKE) -C lib/libdvd
402 eventclients:
403 ifeq ($(findstring osx,@ARCH@), osx)
404 ifneq ($(findstring arm,@ARCH@), arm)
405         $(MAKE) -C tools/EventClients/Clients/OSXRemote
406 endif
407 else
408         $(MAKE) -C tools/EventClients
409 endif
410 libexif: dllloader
411         $(MAKE) -C lib/libexif
412 cmyth: dllloader
413         $(MAKE) -C lib/cmyth
414 libhdhomerun: dllloader
415         $(MAKE) -C lib/libhdhomerun
416 papcodecs: dllloader dvdpcodecs
417         test -d system/players/paplayer || mkdir system/players/paplayer
418         $(MAKE) -C lib/xbadpcm
419         $(MAKE) -C lib/vgmstream
420         $(MAKE) -C lib/timidity
421         $(MAKE) -C lib/nosefart
422 ifneq ($(findstring arm-osx,@ARCH@), arm-osx)
423         $(MAKE) -C lib/libsidplay2
424 endif
425 ifeq (@USE_ASAP_CODEC@,1)
426   ifneq ($(findstring osx,@ARCH@), osx)
427         $(MAKE) -C lib/asap asap-xbmc
428   endif
429 endif
430         $(MAKE) -C lib/stsound/StSoundLibrary
431 ifeq ($(or $(findstring powerpc,@ARCH@),$(findstring x86_64-linux,@ARCH@),$(findstring arm, @ARCH@),$(findstring freebsd,@ARCH@)),)
432         $(MAKE) -C lib/snesapu/SNES/SNESAPU
433 endif
434 imagelib: dllloader
435         $(MAKE) -C lib/cximage-6.0
436
437 pvraddons: exports
438 ifeq (@USE_PVR_ADDONS@,1)
439         $(MAKE) -C pvr-addons
440 endif
441
442 codecs: papcodecs dvdpcodecs
443
444 libs: libhdhomerun imagelib libexif system/libcpluff-@ARCH@.so $(CMYTH)
445
446 externals: codecs libs visualizations screensavers libaddon pvraddons
447
448 xcode_depends: \
449         codecs libs visualizations screensavers eventclients skins libaddon \
450         lib/libsquish/libsquish.a \
451         lib/libRTV/librtv.a \
452         lib/libXDAAP/libxdaap.a \
453         lib/SlingboxLib/SlingboxLib.a
454
455 OBJSXBMC =$(DIRECTORY_ARCHIVES)
456
457 DYNOBJSXBMC= \
458         xbmc/linux/linux.a \
459         xbmc/network/network.a \
460         xbmc/video/windows/videowindows.a \
461         xbmc/utils/utils.a \
462         xbmc/cores/DllLoader/exports/util/exports_utils.a \
463         xbmc/cores/DllLoader/exports/exports.a \
464         xbmc/settings/settings.a \
465         xbmc/video/video.a \
466         xbmc/pvr/addons/pvraddons.a \
467         xbmc/pvr/windows/pvrwindows.a \
468         xbmc/guilib/guilib.a # must be dynamic to avoid linker errors
469
470 ifeq ($(findstring freebsd,@ARCH@),freebsd)
471 DYNOBJSXBMC+= xbmc/freebsd/freebsd.a
472 endif
473
474 OBJSXBMC:=$(filter-out $(DYNOBJSXBMC), $(OBJSXBMC))
475
476 MAINOBJS=xbmc/xbmc.o
477 ifeq (@USE_ANDROID@,1)
478 MAINOBJS+=xbmc/android/activity/android_main.o
479 endif
480 ifneq (@USE_LIBXBMC@,1)
481 MAINOBJS+=xbmc/main/main.o
482 endif
483
484 # sync these entries manually with tools/depends/target/xbmc-addon-bindings/Makefile
485 BINDINGS =xbmc/addons/include/xbmc_addon_cpp_dll.h
486 BINDINGS+=xbmc/addons/include/xbmc_addon_dll.h
487 BINDINGS+=xbmc/addons/include/xbmc_addon_types.h
488 BINDINGS+=xbmc/addons/include/xbmc_codec_types.h
489 BINDINGS+=xbmc/addons/include/xbmc_epg_types.h
490 BINDINGS+=xbmc/addons/include/xbmc_pvr_dll.h
491 BINDINGS+=xbmc/addons/include/xbmc_pvr_types.h
492 BINDINGS+=xbmc/addons/include/xbmc_scr_dll.h
493 BINDINGS+=xbmc/addons/include/xbmc_scr_types.h
494 BINDINGS+=xbmc/addons/include/xbmc_vis_dll.h
495 BINDINGS+=xbmc/addons/include/xbmc_vis_types.h
496 BINDINGS+=xbmc/addons/include/xbmc_stream_utils.hpp
497 BINDINGS+=addons/library.xbmc.addon/libXBMC_addon.h
498 BINDINGS+=addons/library.xbmc.gui/libXBMC_gui.h
499 BINDINGS+=addons/library.xbmc.pvr/libXBMC_pvr.h
500 BINDINGS+=addons/library.xbmc.codec/libXBMC_codec.h
501 BINDINGS+=xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxPacket.h
502
503 libxbmc.so: $(OBJSXBMC) $(DYNOBJSXBMC) $(NWAOBJSXBMC) $(MAINOBJS)
504 ifeq ($(findstring osx,@ARCH@), osx)
505         $(SILENT_LD) $(CXX) $(LDFLAGS) -bundle -o $@ -Wl,-all_load,-ObjC $(DYNOBJSXBMC) $(NWAOBJSXBMC) $(OBJSXBMC) $(LIBS)
506 else
507         $(SILENT_LD) $(CXX) $(CXXFLAGS) $(LDFLAGS) -shared -o $@ $(MAINOBJS) -Wl,--start-group $(DYNOBJSXBMC) $(OBJSXBMC) -Wl,--end-group -Wl,--no-undefined $(NWAOBJSXBMC) $(LIBS)
508 endif
509
510 xbmc/main/main.a:
511         $(MAKE) -C xbmc/main
512
513 xbmc.bin: $(OBJSXBMC) $(DYNOBJSXBMC) $(NWAOBJSXBMC) $(MAINOBJS) xbmc/main/main.a
514
515 ifeq ($(findstring osx,@ARCH@), osx)
516         $(SILENT_LD) $(CXX) $(LDFLAGS) -o xbmc.bin -Wl,-all_load,-ObjC $(DYNOBJSXBMC) $(NWAOBJSXBMC) $(OBJSXBMC) $(LIBS) -rdynamic
517 else
518         $(SILENT_LD) $(CXX) $(CXXFLAGS) $(LDFLAGS) -o xbmc.bin $(MAINOBJS) -Wl,--start-group $(DYNOBJSXBMC) $(OBJSXBMC) -Wl,--end-group $(NWAOBJSXBMC) $(LIBS) -rdynamic
519 endif
520
521 xbmc-xrandr: xbmc-xrandr.c
522 ifneq (1,@USE_XRANDR@)
523         # xbmc-xrandr.c gets picked up by the default make rules
524         @echo "excluding xbmc-xrandr"
525 else
526         $(SILENT_LD) $(CC) $(CFLAGS) $(LDFLAGS) -o xbmc-xrandr xbmc-xrandr.c -lXrandr -lX11 -lm
527 endif
528
529 tools/TexturePacker/TexturePacker: xbmc/guilib/XBTF.h
530         $(MAKE) -C tools/TexturePacker/
531
532
533 install-bin: xbmc.bin # developement convenience target
534         sudo install -d $(DESTDIR)$(libdir)
535         sudo install xbmc.bin $(DESTDIR)$(libdir)/xbmc
536
537 ifeq ($(findstring osx,@ARCH@), osx)
538         # TODO: add osx install
539 else
540 install: install-binaries install-arch install-datas
541
542 apk: install
543         make -C tools/android/packaging
544
545 apk-clean: 
546         make -C tools/android/packaging clean
547
548 install-binaries: install-scripts
549         @echo "Copying XBMC binary to $(DESTDIR)$(libdir)/xbmc/"
550         @install -d $(DESTDIR)$(libdir)/xbmc
551 ifeq (1,@USE_XRANDR@)
552         @install xbmc-xrandr $(DESTDIR)$(libdir)/xbmc/xbmc-xrandr
553 endif
554 ifeq (@USE_LIBXBMC@,1)
555         @install libxbmc.so $(DESTDIR)$(libdir)/xbmc/libxbmc.so
556 else
557         @install xbmc.bin $(DESTDIR)$(libdir)/xbmc/xbmc.bin
558         @echo "You can run XBMC with the command 'xbmc'"
559 endif
560 endif
561
562 install-arch:
563         @# Arch dependent files
564 ifeq (@USE_PVR_ADDONS@,1)
565         $(MAKE) -C pvr-addons install
566 endif
567 ifeq ($(findstring freebsd,@ARCH@), freebsd)
568         @find -E system addons -type f -not -iregex ".*svn.*" \
569                 -iregex ".*@ARCH@.*|.*\.vis|.*\.xbs" \
570                 -exec sh -c "install -d \"$(DESTDIR)$(libdir)/xbmc/\`dirname '{}'\`\"" \; \
571                 -and \
572                 -exec install "{}" $(DESTDIR)$(libdir)/xbmc/"{}" \; \
573                 -exec printf " -- %-75.75s\r" "{}" \;
574 else
575 ifeq ($(findstring Darwin,$(shell uname -s)),Darwin)
576         @find -E system addons -type f -not -iregex ".*svn.*" \
577                 -iregex ".*@ARCH@.*|.*\.vis|.*\.xbs" \
578                 -exec sh -c "install -d \"$(DESTDIR)$(libdir)/xbmc/\`dirname '{}'\`\"" \; \
579                 -and \
580                 -exec install "{}" $(DESTDIR)$(libdir)/xbmc/"{}" \; \
581                 -exec printf " -- %-75.75s\r" "{}" \;
582 else
583         @find system addons -regextype posix-extended -type f -not -iregex ".*svn.*" -iregex ".*\.so|.*\.vis|.*\.xbs|.*\.pvr" -exec install -D "{}" $(DESTDIR)$(libdir)/xbmc/"{}" \; -printf " -- %-75.75f\r"
584 endif
585 endif
586
587 install-scripts:
588         @install -d $(DESTDIR)$(bindir)
589         @install tools/Linux/xbmc.sh $(DESTDIR)$(bindir)/xbmc
590         @install tools/Linux/xbmc-standalone.sh $(DESTDIR)$(bindir)/xbmc-standalone
591         @install -d $(DESTDIR)$(datarootdir)/xbmc
592         @install -m 0644 tools/Linux/FEH.py $(DESTDIR)$(datarootdir)/xbmc/FEH.py
593         @install -d $(DESTDIR)$(datarootdir)/xsessions
594         @install -m 0644 tools/Linux/xbmc-xsession.desktop $(DESTDIR)$(datarootdir)/xsessions/XBMC.desktop
595
596 install-datas: install-scripts
597         @echo "Copying support and legal files..."
598         @install -d $(DESTDIR)$(docdir)
599         @for FILE in `ls LICENSE.GPL *.txt`; do \
600                 install -m 0644 "$$FILE" "$(DESTDIR)$(docdir)/$$FILE"; done
601         @install -m 0644 "docs/README.linux" "$(DESTDIR)$(docdir)/README.linux"
602         @echo "Done!"
603         @echo "Copying system files to $(DESTDIR)$(datarootdir)/xbmc"
604         @install -d $(DESTDIR)$(datarootdir)/xbmc
605         @# Arch independent files
606 ifeq ($(findstring bsd,@ARCH@), bsd)
607         @find -E addons language media sounds userdata system -type f \
608                 -not -iregex ".*@ARCH@.*|.*\.vis|.*\.xbs|.*svn.*|.*\.so|.*\.dll|$(subst ${space},|,$(INSTALL_FILTER))" \
609                 -exec sh -c "install -d \"$(DESTDIR)$(datarootdir)/xbmc/\`dirname '{}'\`\"" \; \
610                 -and \
611                 -exec install -m 0644 "{}" $(DESTDIR)$(datarootdir)/xbmc/"{}" \; \
612                 -exec printf " -- %-75.75s\r" "{}" \;
613 else
614 ifeq ($(findstring Darwin,$(shell uname -s)),Darwin)
615         @find -E addons language media sounds userdata system -type f \
616                 -not -iregex ".*@ARCH@.*|.*\.vis|.*\.xbs|.*svn.*|.*\.so|.*\.dll|$(subst ${space},|,$(INSTALL_FILTER))" \
617                 -exec sh -c "install -d \"$(DESTDIR)$(datarootdir)/xbmc/\`dirname '{}'\`\"" \; \
618                 -and \
619                 -exec install -m 0644 "{}" $(DESTDIR)$(datarootdir)/xbmc/"{}" \; \
620                 -exec printf " -- %-75.75s\r" "{}" \;
621 else
622         @find addons language media sounds userdata system -regextype posix-extended -type f -not -iregex ".*@ARCH@.*|.*\.vis|.*\.xbs|.*svn.*|.*\.so|.*\.dll|.*\.pvr|$(subst ${space},|,$(INSTALL_FILTER))" -exec install -D -m 0644 "{}" $(DESTDIR)$(datarootdir)/xbmc/"{}" \; -printf " -- %-75.75f\r"
623 endif
624 endif
625         @# Icons and links
626         @install -d $(DESTDIR)$(datarootdir)/applications
627         @install tools/Linux/xbmc.desktop $(DESTDIR)$(datarootdir)/applications/xbmc.desktop
628         @install -d $(DESTDIR)$(datadir)/icons/hicolor/48x48/apps
629         @install -m 0644 tools/Linux/xbmc-48x48.png $(DESTDIR)$(datadir)/icons/hicolor/48x48/apps/xbmc.png
630         @install -d $(DESTDIR)$(datadir)/icons/hicolor/256x256/apps
631         @install -m 0644 media/icon.png $(DESTDIR)$(datadir)/icons/hicolor/256x256/apps/xbmc.png
632         @test -z "$(DESTDIR)" && gtk-update-icon-cache -f -q -t $(datadir)/icons/hicolor || :
633
634         @echo "Copying bindings to $(DESTDIR)$(includedir)/xbmc"
635         @install -d $(DESTDIR)$(includedir)/xbmc
636         @for f in $(BINDINGS); do \
637           install -m 0644 $$f $(DESTDIR)$(includedir)/xbmc ; \
638         done
639         @for f in project/cmake/*.cmake; do \
640           install -m 0644 $$f $(DESTDIR)$(libdir)/xbmc; \
641         done
642
643 uninstall:
644         @echo "Removing XBMC..."
645         @rm -rf $(DESTDIR)$(libdir)/xbmc
646         @rm -rf $(DESTDIR)$(datarootdir)/xbmc $(DESTDIR)$(bindir)/xbmc
647         @rm -rf $(DESTDIR)$(bindir)/xbmc-standalone
648         @rm -rf $(DESTDIR)$(datarootdir)/xsessions/XBMC.desktop
649         @rm -rf $(libdir)/libXBMC_*
650         @rm -rf $(prefix)/include/xbmc
651         @echo "Done!"
652
653 clean-xbmc.bin:
654         rm -f xbmc.bin
655         for d in $(BIN_DIRS); do if test -f $$d/Makefile; then $(MAKE) -C $$d clean; fi; done
656 clean-eventclients:
657         for d in $(EC_DIRS); do if test -f $$d/Makefile; then $(MAKE) -C $$d clean; fi; done
658 clean-xbmctex:
659         for d in $(XBMCTEX_DIRS); do if test -f $$d/Makefile; then $(MAKE) -C $$d clean; fi; done
660 clean-dvdpcodecs:
661         for d in $(DVDPCODECS_DIRS); do if test -f $$d/Makefile; then $(MAKE) -C $$d clean; fi; done
662 clean-papcodecs:
663         for d in $(PAPCODECS_DIRS); do if test -f $$d/Makefile; then $(MAKE) -C $$d clean; fi; done
664 clean-libs:
665         for d in $(LIB_DIRS); do if test -f $$d/Makefile; then $(MAKE) -C $$d clean; fi; done
666 clean-screensavers:
667         for d in $(SS_DIRS); do if test -f $$d/Makefile; then $(MAKE) -C $$d clean; fi; done
668 clean-visualisations:
669         for d in $(VIS_DIRS); do if test -f $$d/Makefile; then $(MAKE) -C $$d clean; fi; done
670 clean-libaddons:
671         for d in $(LIBADDON_DIRS); do if test -f $$d/Makefile; then $(MAKE) -C $$d clean; fi; done
672 clean-pvraddons:
673 ifeq (@USE_PVR_ADDONS@,1)
674         if test -f pvr-addons/Makefile; then $(MAKE) -C pvr-addons clean; fi;
675 endif
676
677 clean-codecs: clean-dvdpcodecs clean-papcodecs
678
679 clean-externals: clean-codecs clean-eventclients clean-xbmctex clean-libs \
680         clean-screensavers clean-visualisations clean-libaddons clean-pvraddons
681
682 ifeq (1,@GTEST_CONFIGURED@)
683 check: testsuite
684         for check_program in $(CHECK_PROGRAMS); do $(CURDIR)/$$check_program; done
685
686 testsuite: $(CHECK_EXTENSIONS) $(CHECK_PROGRAMS)
687
688 testframework: $(GTEST_LIBS)
689
690 $(GTEST_LIBS): $(GTEST_DIR)/Makefile
691
692 $(GTEST_DIR)/Makefile: force
693         $(MAKE) -C $(GTEST_DIR)
694
695 $(CHECK_LIBS): force
696         @$(MAKE) $(if $(V),,-s) -C $(@D)
697
698 xbmc-test: $(CHECK_LIBS) $(OBJSXBMC) $(DYNOBJSXBMC) $(NWAOBJSXBMC) $(GTEST_LIBS)
699 ifeq ($(findstring osx,@ARCH@), osx)
700         $(SILENT_LD) $(CXX) $(LDFLAGS) $(GTEST_INCLUDES) -o $@ -Wl,-all_load,-ObjC $(DYNOBJSXBMC) $(NWAOBJSXBMC) $(OBJSXBMC) $(GTEST_LIBS) $(CHECK_LIBS) $(LIBS) $(CHECK_LIBADD) -rdynamic
701 else
702         $(SILENT_LD) $(CXX) $(CXXFLAGS) $(LDFLAGS) $(GTEST_INCLUDES) -o $@ -Wl,--whole-archive $(DYNOBJSXBMC) $(OBJSXBMC) $(GTEST_LIBS) $(CHECK_LIBS) -Wl,--no-whole-archive $(NWAOBJSXBMC) $(LIBS) $(CHECK_LIBADD) -rdynamic
703 endif
704 else
705 # Give a message that the framework is not configured, but don't fail.
706 check testsuite testframework:
707         @echo "Google Test Framework not configured, skipping testsuite check."
708 endif