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