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