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