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