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