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