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