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