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