Merge pull request #3541 from FernetMenta/aefixes
[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/test/xbmc-test.a
307
308 ifeq (@USE_WAYLAND@,1)
309 CHECK_LIBS += xbmc/windowing/tests/wayland/test_wayland.a
310
311 ifeq (@USE_WAYLAND_TEST_EXTENSION@,1)
312 WAYLAND_TEST_MODULE = xbmc/windowing/tests/wayland/xbmc-wayland-test-extension.so
313 $(WAYLAND_TEST_MODULE): force
314         $(MAKE) -C $(@D) $(@F)
315 CHECK_EXTENSIONS = $(WAYLAND_TEST_MODULE)
316 CHECK_LIBADD=@WAYLAND_TEST_LIBS@
317 endif
318 endif
319
320 CHECK_PROGRAMS = xbmc-test
321
322 CLEAN_FILES += $(CHECK_PROGRAMS) $(CHECK_EXTENSIONS)
323
324 all : $(FINAL_TARGETS)
325         @echo '-----------------------'
326         @echo 'XBMC built successfully'
327         @echo '-----------------------'
328
329 include Makefile.include
330
331 .PHONY : dllloader exports visualizations screensavers eventclients papcodecs \
332         dvdpcodecs imagelib codecs externals force skins libaddon check \
333         testframework testsuite
334
335 # hack targets to keep build system up to date
336 Makefile : config.status $(addsuffix .in, $(AUTOGENERATED_MAKEFILES))
337         @echo "Regenerating Makefiles..."
338         @./config.status &> /dev/null
339         @echo "done"
340
341 config.status: configure
342
343 # skin textures
344 ifeq (@USE_TEXTUREPACKER@,1)
345 skins: tools/TexturePacker/TexturePacker force
346          $(MAKE) -C $(CONFLUENCE_MEDIA)
347 ifeq (@USE_SKIN_TOUCHED@,1)
348          $(MAKE) -C $(TOUCHED_MEDIA)
349 endif
350 else
351 skins:
352 endif
353
354 # Setup some dependencies for subdir makes
355 xbmc/cores/paplayer/paplayer.a: papcodecs
356 $(DVDPLAYER_ARCHIVES)         : dvdpcodecs
357
358 $(NWAOBJSXBMC): force
359         @$(MAKE) $(if $(V),,-s) -C $(@D)
360
361 $(DIRECTORY_ARCHIVES): force
362         @$(MAKE) $(if $(V),,-s) -C $(@D)
363
364 lib/cpluff/libcpluff/.libs/libcpluff.a: force
365         $(MAKE) -C lib/cpluff/libcpluff
366 system/libcpluff-@ARCH@.so: lib/cpluff/libcpluff/.libs/libcpluff.a exports
367 ifeq ($(findstring osx,@ARCH@), osx)
368   ifeq (@ARCH@, arm-osx)
369         $(CXX) $(LDFLAGS) -all_load -bundle -flat_namespace -undefined dynamic_lookup -read_only_relocs suppress -o $@ $<
370   else
371         $(CXX) $(LDFLAGS) -all_load -bundle -flat_namespace -undefined dynamic_lookup -lexpat $(BUNDLE1_O) -o $@ $<
372   endif
373 else
374         $(CXX) $(LDFLAGS) -shared -o $@ -Wl,--whole-archive $< \
375                 -Wl,--no-whole-archive  \
376                 `cat xbmc/cores/DllLoader/exports/wrapper.def` xbmc/cores/DllLoader/exports/wrapper.o -lexpat
377 endif
378
379 exports: xbmc/cores/DllLoader/exports/exports.a xbmc/cores/DllLoader/exports/util/exports_utils.a
380         $(MAKE) -C xbmc/cores/DllLoader/exports wrapper.def
381 dllloader: exports xbmc/cores/DllLoader/dllloader.a
382
383 ifeq (@USE_OPENGLES@,1)
384 EGLHELPERS=xbmc/visualizations/EGLHelpers/eglhelpers.a
385 endif
386
387 $(VIS_DIRS): force exports $(EGLHELPERS)
388         $(MAKE) -C $@
389
390 $(SS_DIRS): force exports
391         $(MAKE) -C $@
392
393 visualizations: $(VIS_DIRS)
394
395 screensavers: $(SS_DIRS)
396
397 libaddon: exports
398         $(MAKE) -C lib/addons/library.xbmc.addon
399         $(MAKE) -C lib/addons/library.xbmc.codec
400         $(MAKE) -C lib/addons/library.xbmc.gui
401         $(MAKE) -C lib/addons/library.xbmc.pvr
402 dvdpcodecs: dllloader
403         $(MAKE) -C lib
404         $(MAKE) -C lib/libdvd
405 eventclients:
406 ifeq ($(findstring osx,@ARCH@), osx)
407 ifneq ($(findstring arm,@ARCH@), arm)
408         $(MAKE) -C tools/EventClients/Clients/OSXRemote
409 endif
410 else
411         $(MAKE) -C tools/EventClients
412 endif
413 libexif: dllloader
414         $(MAKE) -C lib/libexif
415 cmyth: dllloader
416         $(MAKE) -C lib/cmyth
417 libhdhomerun: dllloader
418         $(MAKE) -C lib/libhdhomerun
419 papcodecs: dllloader dvdpcodecs
420         test -d system/players/paplayer || mkdir system/players/paplayer
421         $(MAKE) -C lib/xbadpcm
422         $(MAKE) -C lib/vgmstream
423         $(MAKE) -C lib/timidity
424         $(MAKE) -C lib/nosefart
425 ifneq ($(findstring arm-osx,@ARCH@), arm-osx)
426         $(MAKE) -C lib/libsidplay2
427 endif
428 ifeq (@USE_ASAP_CODEC@,1)
429   ifneq ($(findstring osx,@ARCH@), osx)
430         $(MAKE) -C lib/asap asap-xbmc
431   endif
432 endif
433         $(MAKE) -C lib/stsound/StSoundLibrary
434 ifeq ($(or $(findstring powerpc,@ARCH@),$(findstring x86_64-linux,@ARCH@),$(findstring arm, @ARCH@),$(findstring freebsd,@ARCH@)),)
435         $(MAKE) -C lib/snesapu/SNES/SNESAPU
436 endif
437 imagelib: dllloader
438         $(MAKE) -C lib/cximage-6.0
439
440 pvraddons: exports
441 ifeq (@USE_PVR_ADDONS@,1)
442         $(MAKE) -C pvr-addons
443 endif
444
445 codecs: papcodecs dvdpcodecs
446
447 libs: libhdhomerun imagelib libexif system/libcpluff-@ARCH@.so $(CMYTH)
448
449 externals: codecs libs visualizations screensavers libaddon pvraddons
450
451 xcode_depends: \
452         codecs libs visualizations screensavers eventclients skins libaddon \
453         lib/libsquish/libsquish.a \
454         lib/libRTV/librtv.a \
455         lib/libXDAAP/libxdaap.a \
456         lib/SlingboxLib/SlingboxLib.a
457
458 OBJSXBMC =$(DIRECTORY_ARCHIVES)
459
460 DYNOBJSXBMC= \
461         xbmc/linux/linux.a \
462         xbmc/network/network.a \
463         xbmc/video/windows/videowindows.a \
464         xbmc/utils/utils.a \
465         xbmc/cores/DllLoader/exports/util/exports_utils.a \
466         xbmc/cores/DllLoader/exports/exports.a \
467         xbmc/settings/settings.a \
468         xbmc/video/video.a \
469         xbmc/pvr/addons/pvraddons.a \
470         xbmc/pvr/windows/pvrwindows.a \
471         xbmc/guilib/guilib.a # must be dynamic to avoid linker errors
472
473 ifeq ($(findstring freebsd,@ARCH@),freebsd)
474 DYNOBJSXBMC+= xbmc/freebsd/freebsd.a
475 endif
476
477 OBJSXBMC:=$(filter-out $(DYNOBJSXBMC), $(OBJSXBMC))
478
479 MAINOBJS=xbmc/xbmc.o
480 ifeq (@USE_ANDROID@,1)
481 MAINOBJS+=xbmc/android/activity/android_main.o
482 endif
483 ifneq (@USE_LIBXBMC@,1)
484 MAINOBJS+=xbmc/main/main.o
485 endif
486
487 # sync these entries manually with tools/depends/target/xbmc-addon-bindings/Makefile
488 BINDINGS =xbmc/addons/include/xbmc_addon_cpp_dll.h
489 BINDINGS+=xbmc/addons/include/xbmc_addon_dll.h
490 BINDINGS+=xbmc/addons/include/xbmc_addon_types.h
491 BINDINGS+=xbmc/addons/include/xbmc_codec_types.h
492 BINDINGS+=xbmc/addons/include/xbmc_epg_types.h
493 BINDINGS+=xbmc/addons/include/xbmc_pvr_dll.h
494 BINDINGS+=xbmc/addons/include/xbmc_pvr_types.h
495 BINDINGS+=xbmc/addons/include/xbmc_scr_dll.h
496 BINDINGS+=xbmc/addons/include/xbmc_scr_types.h
497 BINDINGS+=xbmc/addons/include/xbmc_vis_dll.h
498 BINDINGS+=xbmc/addons/include/xbmc_vis_types.h
499 BINDINGS+=xbmc/addons/include/xbmc_stream_utils.hpp
500 BINDINGS+=addons/library.xbmc.addon/libXBMC_addon.h
501 BINDINGS+=addons/library.xbmc.gui/libXBMC_gui.h
502 BINDINGS+=addons/library.xbmc.pvr/libXBMC_pvr.h
503 BINDINGS+=addons/library.xbmc.codec/libXBMC_codec.h
504 BINDINGS+=xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxPacket.h
505
506 libxbmc.so: $(OBJSXBMC) $(DYNOBJSXBMC) $(NWAOBJSXBMC) $(MAINOBJS)
507 ifeq ($(findstring osx,@ARCH@), osx)
508         $(SILENT_LD) $(CXX) $(LDFLAGS) -bundle -o $@ -Wl,-all_load,-ObjC $(DYNOBJSXBMC) $(NWAOBJSXBMC) $(OBJSXBMC) $(LIBS)
509 else
510         $(SILENT_LD) $(CXX) $(CXXFLAGS) $(LDFLAGS) -shared -o $@ $(MAINOBJS) -Wl,--start-group $(DYNOBJSXBMC) $(OBJSXBMC) -Wl,--end-group -Wl,--no-undefined $(NWAOBJSXBMC) $(LIBS)
511 endif
512
513 xbmc/main/main.a:
514         $(MAKE) -C xbmc/main
515
516 xbmc.bin: $(OBJSXBMC) $(DYNOBJSXBMC) $(NWAOBJSXBMC) $(MAINOBJS) xbmc/main/main.a
517
518 ifeq ($(findstring osx,@ARCH@), osx)
519         $(SILENT_LD) $(CXX) $(LDFLAGS) -o xbmc.bin -Wl,-all_load,-ObjC $(DYNOBJSXBMC) $(NWAOBJSXBMC) $(OBJSXBMC) $(LIBS) -rdynamic
520 else
521         $(SILENT_LD) $(CXX) $(CXXFLAGS) $(LDFLAGS) -o xbmc.bin $(MAINOBJS) -Wl,--start-group $(DYNOBJSXBMC) $(OBJSXBMC) -Wl,--end-group $(NWAOBJSXBMC) $(LIBS) -rdynamic
522 endif
523
524 xbmc-xrandr: xbmc-xrandr.c
525 ifneq (1,@USE_XRANDR@)
526         # xbmc-xrandr.c gets picked up by the default make rules
527         @echo "excluding xbmc-xrandr"
528 else
529         $(SILENT_LD) $(CC) $(CFLAGS) $(LDFLAGS) -o xbmc-xrandr xbmc-xrandr.c -lXrandr -lX11 -lm
530 endif
531
532 tools/TexturePacker/TexturePacker: xbmc/guilib/XBTF.h
533         $(MAKE) -C tools/TexturePacker/
534
535
536 install-bin: xbmc.bin # developement convenience target
537         sudo install -d $(DESTDIR)$(libdir)
538         sudo install xbmc.bin $(DESTDIR)$(libdir)/xbmc
539
540 ifeq ($(findstring osx,@ARCH@), osx)
541         # TODO: add osx install
542 else
543 install: install-binaries install-arch install-datas
544
545 apk: install
546         make -C tools/android/packaging
547
548 apk-clean: 
549         make -C tools/android/packaging clean
550
551 install-binaries: install-scripts
552         @echo "Copying XBMC binary to $(DESTDIR)$(libdir)/xbmc/"
553         @install -d $(DESTDIR)$(libdir)/xbmc
554 ifeq (1,@USE_XRANDR@)
555         @install xbmc-xrandr $(DESTDIR)$(libdir)/xbmc/xbmc-xrandr
556 endif
557 ifeq (@USE_LIBXBMC@,1)
558         @install libxbmc.so $(DESTDIR)$(libdir)/xbmc/libxbmc.so
559 else
560         @install xbmc.bin $(DESTDIR)$(libdir)/xbmc/xbmc.bin
561         @echo "You can run XBMC with the command 'xbmc'"
562 endif
563 endif
564
565 install-arch:
566         @# Arch dependent files
567 ifeq (@USE_PVR_ADDONS@,1)
568         $(MAKE) -C pvr-addons install
569 endif
570 ifeq ($(findstring freebsd,@ARCH@), freebsd)
571         @find -E system addons -type f -not -iregex ".*svn.*" \
572                 -iregex ".*@ARCH@.*|.*\.vis|.*\.xbs" \
573                 -exec sh -c "install -d \"$(DESTDIR)$(libdir)/xbmc/\`dirname '{}'\`\"" \; \
574                 -and \
575                 -exec install "{}" $(DESTDIR)$(libdir)/xbmc/"{}" \; \
576                 -exec printf " -- %-75.75s\r" "{}" \;
577 else
578 ifeq ($(findstring Darwin,$(shell uname -s)),Darwin)
579         @find -E system addons -type f -not -iregex ".*svn.*" \
580                 -iregex ".*@ARCH@.*|.*\.vis|.*\.xbs" \
581                 -exec sh -c "install -d \"$(DESTDIR)$(libdir)/xbmc/\`dirname '{}'\`\"" \; \
582                 -and \
583                 -exec install "{}" $(DESTDIR)$(libdir)/xbmc/"{}" \; \
584                 -exec printf " -- %-75.75s\r" "{}" \;
585 else
586         @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"
587 endif
588 endif
589
590 install-scripts:
591         @install -d $(DESTDIR)$(bindir)
592         @install tools/Linux/xbmc.sh $(DESTDIR)$(bindir)/xbmc
593         @install tools/Linux/xbmc-standalone.sh $(DESTDIR)$(bindir)/xbmc-standalone
594         @install -d $(DESTDIR)$(datarootdir)/xbmc
595         @install -m 0644 tools/Linux/FEH.py $(DESTDIR)$(datarootdir)/xbmc/FEH.py
596         @install -d $(DESTDIR)$(datarootdir)/xsessions
597         @install -m 0644 tools/Linux/xbmc-xsession.desktop $(DESTDIR)$(datarootdir)/xsessions/XBMC.desktop
598
599 install-datas: install-scripts
600         @echo "Copying support and legal files..."
601         @install -d $(DESTDIR)$(docdir)
602         @for FILE in `ls LICENSE.GPL *.txt`; do \
603                 install -m 0644 "$$FILE" "$(DESTDIR)$(docdir)/$$FILE"; done
604         @install -m 0644 "docs/README.linux" "$(DESTDIR)$(docdir)/README.linux"
605         @echo "Done!"
606         @echo "Copying system files to $(DESTDIR)$(datarootdir)/xbmc"
607         @install -d $(DESTDIR)$(datarootdir)/xbmc
608         @# Arch independent files
609 ifeq ($(findstring bsd,@ARCH@), bsd)
610         @find -E addons language media sounds userdata system -type f \
611                 -not -iregex ".*@ARCH@.*|.*\.vis|.*\.xbs|.*svn.*|.*\.so|.*\.dll|$(subst ${space},|,$(INSTALL_FILTER))" \
612                 -exec sh -c "install -d \"$(DESTDIR)$(datarootdir)/xbmc/\`dirname '{}'\`\"" \; \
613                 -and \
614                 -exec install -m 0644 "{}" $(DESTDIR)$(datarootdir)/xbmc/"{}" \; \
615                 -exec printf " -- %-75.75s\r" "{}" \;
616 else
617 ifeq ($(findstring Darwin,$(shell uname -s)),Darwin)
618         @find -E addons language media sounds userdata system -type f \
619                 -not -iregex ".*@ARCH@.*|.*\.vis|.*\.xbs|.*svn.*|.*\.so|.*\.dll|$(subst ${space},|,$(INSTALL_FILTER))" \
620                 -exec sh -c "install -d \"$(DESTDIR)$(datarootdir)/xbmc/\`dirname '{}'\`\"" \; \
621                 -and \
622                 -exec install -m 0644 "{}" $(DESTDIR)$(datarootdir)/xbmc/"{}" \; \
623                 -exec printf " -- %-75.75s\r" "{}" \;
624 else
625         @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"
626 endif
627 endif
628         @# Icons and links
629         @install -d $(DESTDIR)$(datarootdir)/applications
630         @install tools/Linux/xbmc.desktop $(DESTDIR)$(datarootdir)/applications/xbmc.desktop
631         @install -d $(DESTDIR)$(datadir)/icons/hicolor/48x48/apps
632         @install -m 0644 tools/Linux/xbmc-48x48.png $(DESTDIR)$(datadir)/icons/hicolor/48x48/apps/xbmc.png
633         @install -d $(DESTDIR)$(datadir)/icons/hicolor/256x256/apps
634         @install -m 0644 media/icon.png $(DESTDIR)$(datadir)/icons/hicolor/256x256/apps/xbmc.png
635         @test -z "$(DESTDIR)" && gtk-update-icon-cache -f -q -t $(datadir)/icons/hicolor || :
636
637         @echo "Copying bindings to $(DESTDIR)$(includedir)/xbmc"
638         @install -d $(DESTDIR)$(includedir)/xbmc
639         @for f in $(BINDINGS); do \
640           install -m 0644 $$f $(DESTDIR)$(includedir)/xbmc ; \
641         done
642         @for f in project/cmake/*.cmake; do \
643           install -m 0644 $$f $(DESTDIR)$(libdir)/xbmc; \
644         done
645
646 uninstall:
647         @echo "Removing XBMC..."
648         @rm -rf $(DESTDIR)$(libdir)/xbmc
649         @rm -rf $(DESTDIR)$(datarootdir)/xbmc $(DESTDIR)$(bindir)/xbmc
650         @rm -rf $(DESTDIR)$(bindir)/xbmc-standalone
651         @rm -rf $(DESTDIR)$(datarootdir)/xsessions/XBMC.desktop
652         @rm -rf $(libdir)/libXBMC_*
653         @rm -rf $(prefix)/include/xbmc
654         @echo "Done!"
655
656 clean-xbmc.bin:
657         rm -f xbmc.bin
658         for d in $(BIN_DIRS); do if test -f $$d/Makefile; then $(MAKE) -C $$d clean; fi; done
659 clean-eventclients:
660         for d in $(EC_DIRS); do if test -f $$d/Makefile; then $(MAKE) -C $$d clean; fi; done
661 clean-xbmctex:
662         for d in $(XBMCTEX_DIRS); do if test -f $$d/Makefile; then $(MAKE) -C $$d clean; fi; done
663 clean-dvdpcodecs:
664         for d in $(DVDPCODECS_DIRS); do if test -f $$d/Makefile; then $(MAKE) -C $$d clean; fi; done
665 clean-papcodecs:
666         for d in $(PAPCODECS_DIRS); do if test -f $$d/Makefile; then $(MAKE) -C $$d clean; fi; done
667 clean-libs:
668         for d in $(LIB_DIRS); do if test -f $$d/Makefile; then $(MAKE) -C $$d clean; fi; done
669 clean-screensavers:
670         for d in $(SS_DIRS); do if test -f $$d/Makefile; then $(MAKE) -C $$d clean; fi; done
671 clean-visualisations:
672         for d in $(VIS_DIRS); do if test -f $$d/Makefile; then $(MAKE) -C $$d clean; fi; done
673 clean-libaddons:
674         for d in $(LIBADDON_DIRS); do if test -f $$d/Makefile; then $(MAKE) -C $$d clean; fi; done
675 clean-pvraddons:
676 ifeq (@USE_PVR_ADDONS@,1)
677         if test -f pvr-addons/Makefile; then $(MAKE) -C pvr-addons clean; fi;
678 endif
679
680 clean-codecs: clean-dvdpcodecs clean-papcodecs
681
682 clean-externals: clean-codecs clean-eventclients clean-xbmctex clean-libs \
683         clean-screensavers clean-visualisations clean-libaddons clean-pvraddons
684
685 ifeq (1,@GTEST_CONFIGURED@)
686 check: testsuite
687         for check_program in $(CHECK_PROGRAMS); do $(CURDIR)/$$check_program; done
688
689 testsuite: $(CHECK_EXTENSIONS) $(CHECK_PROGRAMS)
690
691 testframework: $(GTEST_LIBS)
692
693 $(GTEST_LIBS): $(GTEST_DIR)/Makefile
694
695 $(GTEST_DIR)/Makefile: force
696         $(MAKE) -C $(GTEST_DIR)
697
698 $(CHECK_LIBS): force
699         @$(MAKE) $(if $(V),,-s) -C $(@D)
700
701 xbmc-test: $(CHECK_LIBS) $(OBJSXBMC) $(DYNOBJSXBMC) $(NWAOBJSXBMC) $(GTEST_LIBS)
702 ifeq ($(findstring osx,@ARCH@), osx)
703         $(SILENT_LD) $(CXX) $(LDFLAGS) $(GTEST_INCLUDES) -o $@ -Wl,-all_load,-ObjC $(DYNOBJSXBMC) $(NWAOBJSXBMC) $(OBJSXBMC) $(GTEST_LIBS) $(CHECK_LIBS) $(LIBS) $(CHECK_LIBADD) -rdynamic
704 else
705         $(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
706 endif
707 else
708 # Give a message that the framework is not configured, but don't fail.
709 check testsuite testframework:
710         @echo "Google Test Framework not configured, skipping testsuite check."
711 endif