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