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