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