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