Merge pull request #5070 from Memphiz/osx_fix_devicechanged_recursionbp
[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                    lib/xbmc-dll-symbols/dll-symbols.a \
39                    xbmc/addons/addons.a \
40                    xbmc/cdrip/cdrip.a \
41                    xbmc/cores/AudioEngine/audioengine.a \
42                    xbmc/cores/DllLoader/dllloader.a \
43                    xbmc/cores/DllLoader/exports/exports.a \
44                    xbmc/cores/DllLoader/exports/util/exports_utils.a \
45                    xbmc/cores/ExternalPlayer/ExternalPlayer.a \
46                    xbmc/cores/VideoRenderers/VideoRenderer.a \
47                    xbmc/cores/VideoRenderers/VideoShaders/VideoShaders.a \
48                    xbmc/cores/cores.a \
49                    xbmc/cores/paplayer/paplayer.a \
50                    xbmc/cores/playercorefactory/playercorefactory.a \
51                    xbmc/dbwrappers/dbwrappers.a \
52                    xbmc/dialogs/dialogs.a \
53                    xbmc/epg/epg.a \
54                    xbmc/filesystem/MusicDatabaseDirectory/musicdatabasedirectory.a \
55                    xbmc/filesystem/VideoDatabaseDirectory/videodatabasedirectory.a \
56                    xbmc/filesystem/filesystem.a \
57                    xbmc/guilib/guilib.a \
58                    xbmc/input/input.a \
59                    xbmc/interfaces/generic/interfaces-generic.a \
60                    xbmc/interfaces/info/info.a \
61                    xbmc/interfaces/interfaces.a \
62                    xbmc/interfaces/json-rpc/json-rpc.a \
63                    xbmc/linux/linux.a \
64                    xbmc/listproviders/listproviders.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 ifeq (@USE_LIBAV_HACKS@,1)
191 DIRECTORY_ARCHIVES += lib/xbmc-libav-hacks/dll-libavhacks.a
192 endif
193
194 PAPCODECS_DIRS= \
195         lib/nosefart \
196         lib/timidity \
197         lib/libsidplay2 \
198         lib/stsound/StSoundLibrary \
199         lib/snesapu/SNES/SNESAPU \
200         lib/vgmstream
201
202 ifeq (@USE_ASAP_CODEC@,1)
203 PAPCODECS_DIRS+= \
204         lib/asap
205 endif
206
207 LIB_DIRS=\
208         lib/cximage-6.0 \
209         lib/libexif \
210         lib/libhdhomerun \
211         lib/cpluff \
212         lib/xbmc-dll-symbols
213
214 ifeq (@USE_MYSQL@,1)
215 LIB_DIRS += lib/cmyth
216 CMYTH=cmyth
217 endif
218
219 SS_DIRS=
220 ifneq (@DISABLE_RSXS@,1)
221   SS_DIRS+= xbmc/screensavers/rsxs-0.9/xbmc
222 else
223   INSTALL_FILTER+= .*screensaver\.rsxs.*
224 endif
225
226 ifneq (@DISABLE_SPECTRUM@,1)
227   VIS_DIRS+= xbmc/visualizations/OpenGLSpectrum
228 else
229   INSTALL_FILTER+= .*visualization\.glspectrum.*
230 endif
231
232 ifneq (@DISABLE_WAVEFORM@,1)
233   VIS_DIRS+= xbmc/visualizations/WaveForm
234 else
235   INSTALL_FILTER+= .*visualization\.waveform.*
236 endif
237
238 ifneq (@DISABLE_FISHBMC@,1)
239   VIS_DIRS+= xbmc/visualizations/fishBMC
240 else
241   INSTALL_FILTER+= .*visualization\.fishbmc.*
242 endif
243
244 ifneq (@DISABLE_PROJECTM@,1)
245   VIS_DIRS+= xbmc/visualizations/XBMCProjectM
246 else
247   INSTALL_FILTER+= .*visualization\.projectm.*
248 endif
249
250 ifneq (@DISABLE_GOOM@,1)
251   VIS_DIRS+=xbmc/visualizations/Goom
252 else
253   INSTALL_FILTER+= .*visualization\.goom.*
254 endif
255
256 LIBADDON_DIRS=\
257         lib/addons/library.xbmc.addon \
258         lib/addons/library.xbmc.codec \
259         lib/addons/library.xbmc.pvr \
260         lib/addons/library.xbmc.gui \
261
262 CONFLUENCE_MEDIA=addons/skin.confluence/media
263 SKIN_DIRS=$(CONFLUENCE_MEDIA)
264
265 ifeq (@USE_SKIN_TOUCHED@,1)
266 TOUCHED_MEDIA=addons/skin.touched/media
267 SKIN_DIRS+=$(TOUCHED_MEDIA)
268 endif
269
270 LIBS=@LIBS@
271 CFLAGS=@CFLAGS@
272 CXXFLAGS=@CXXFLAGS@
273 LDFLAGS=@LDFLAGS@
274 INCLUDES=$(sort @INCLUDES@)
275
276 CLEAN_FILES=xbmc.bin xbmc-xrandr libxbmc.so
277
278 DISTCLEAN_FILES=config.h config.log config.status tools/Linux/xbmc.sh \
279         tools/Linux/xbmc-standalone.sh autom4te.cache config.h.in~ \
280         system/libcpluff-@ARCH@.so
281
282 ifeq (@USE_LIBXBMC@,1)
283 FINAL_TARGETS+=libxbmc.so
284 ifeq (@USE_ANDROID@,1)
285 FINAL_TARGETS+=skins
286 endif
287 else
288 FINAL_TARGETS=xbmc.bin skins xbmc-xrandr
289 endif
290 FINAL_TARGETS+=Makefile externals
291
292 GTEST_DIR = lib/gtest
293 GTEST_INCLUDES = -I$(GTEST_DIR)/include
294 GTEST_LIBS = $(GTEST_DIR)/lib/.libs/libgtest.a
295
296 CHECK_DIRS = xbmc/filesystem/test \
297              xbmc/utils/test \
298              xbmc/threads/test \
299              xbmc/interfaces/python/test \
300              xbmc/test
301 CHECK_LIBS = xbmc/filesystem/test/filesystemTest.a \
302              xbmc/utils/test/utilsTest.a \
303              xbmc/threads/test/threadTest.a \
304              xbmc/interfaces/python/test/pythonSwigTest.a \
305              xbmc/cores/AudioEngine/Sinks/test/AESinkTest.a \
306              xbmc/test/xbmc-test.a
307
308 ifeq (@USE_WAYLAND@,1)
309 CHECK_LIBS += xbmc/windowing/tests/wayland/test_wayland.a
310
311 ifeq (@USE_WAYLAND_TEST_EXTENSION@,1)
312 WAYLAND_TEST_MODULE = xbmc/windowing/tests/wayland/xbmc-wayland-test-extension.so
313 $(WAYLAND_TEST_MODULE): force
314         $(MAKE) -C $(@D) $(@F)
315 CHECK_EXTENSIONS = $(WAYLAND_TEST_MODULE)
316 CHECK_LIBADD=@WAYLAND_TEST_LIBS@
317 endif
318 endif
319
320 CHECK_PROGRAMS = xbmc-test
321
322 CLEAN_FILES += $(CHECK_PROGRAMS) $(CHECK_EXTENSIONS)
323
324 all : $(FINAL_TARGETS)
325         @echo '-----------------------'
326         @echo 'XBMC built successfully'
327         @echo '-----------------------'
328
329 include Makefile.include
330
331 .PHONY : dllloader exports visualizations screensavers eventclients papcodecs \
332         dvdpcodecs dvdpextcodecs imagelib codecs externals force skins libaddon check \
333         testframework testsuite
334
335 # hack targets to keep build system up to date
336 Makefile : config.status $(addsuffix .in, $(AUTOGENERATED_MAKEFILES))
337         @echo "Regenerating Makefiles..."
338         @./config.status &> /dev/null
339         @echo "done"
340
341 config.status: configure
342
343 # skin textures
344 ifeq (@USE_TEXTUREPACKER@,1)
345 skins: tools/TexturePacker/TexturePacker force
346          $(MAKE) -C $(CONFLUENCE_MEDIA)
347 ifeq (@USE_SKIN_TOUCHED@,1)
348          $(MAKE) -C $(TOUCHED_MEDIA)
349 endif
350 else
351 skins:
352 endif
353
354 # Setup some dependencies for subdir makes
355 xbmc/cores/paplayer/paplayer.a: papcodecs
356 $(DVDPLAYER_ARCHIVES)         : dvdpcodecs
357
358 lib/cpluff/libcpluff/.libs/libcpluff.a: force
359         $(MAKE) -C lib/cpluff/libcpluff
360 system/libcpluff-@ARCH@.so: lib/cpluff/libcpluff/.libs/libcpluff.a exports
361 ifeq ($(findstring osx,@ARCH@), osx)
362   ifeq (@ARCH@, arm-osx)
363         $(CXX) $(LDFLAGS) -all_load -bundle -flat_namespace -undefined dynamic_lookup -read_only_relocs suppress -o $@ $<
364   else
365         $(CXX) $(LDFLAGS) -all_load -bundle -flat_namespace -undefined dynamic_lookup -lexpat $(BUNDLE1_O) -o $@ $<
366   endif
367 else
368         $(CXX) $(LDFLAGS) -shared -o $@ -Wl,--whole-archive $< \
369                 -Wl,--no-whole-archive  \
370                 `cat xbmc/cores/DllLoader/exports/wrapper.def` xbmc/cores/DllLoader/exports/wrapper.o -lexpat
371 endif
372
373 exports: xbmc/cores/DllLoader/exports/exports.a xbmc/cores/DllLoader/exports/util/exports_utils.a
374         $(MAKE) -C xbmc/cores/DllLoader/exports wrapper.def
375 dllloader: exports xbmc/cores/DllLoader/dllloader.a
376
377 ifeq (@USE_OPENGLES@,1)
378 EGLHELPERS=xbmc/visualizations/EGLHelpers/eglhelpers.a
379 endif
380
381 $(VIS_DIRS): force exports $(EGLHELPERS)
382         $(MAKE) -C $@
383
384 $(SS_DIRS): force exports
385         $(MAKE) -C $@
386
387 visualizations: $(VIS_DIRS)
388
389 screensavers: $(SS_DIRS)
390
391 libaddon: exports
392         $(MAKE) -C lib/addons/library.xbmc.addon
393         $(MAKE) -C lib/addons/library.xbmc.codec
394         $(MAKE) -C lib/addons/library.xbmc.gui
395         $(MAKE) -C lib/addons/library.xbmc.pvr
396 dvdpcodecs: dllloader
397         $(MAKE) -C lib
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 = lib/ffmpeg/libavcodec/libavcodec.a \
478              lib/ffmpeg/libavfilter/libavfilter.a \
479              lib/ffmpeg/libswresample/libswresample.a \
480              lib/ffmpeg/libavformat/libavformat.a \
481              lib/ffmpeg/libavutil/libavutil.a \
482              lib/ffmpeg/libpostproc/libpostproc.a \
483              lib/ffmpeg/libswscale/libswscale.a
484 DYNOBJSXBMC+= $(FFMPEGOBJS)
485 LIBS+= @GNUTLS_ALL_LIBS@ @VORBISENC_ALL_LIBS@ @HOGWEED_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 # sync these entries manually with tools/depends/target/xbmc-addon-bindings/Makefile
511 BINDINGS =xbmc/addons/include/xbmc_addon_cpp_dll.h
512 BINDINGS+=xbmc/addons/include/xbmc_addon_dll.h
513 BINDINGS+=xbmc/addons/include/xbmc_addon_types.h
514 BINDINGS+=xbmc/addons/include/xbmc_codec_types.h
515 BINDINGS+=xbmc/addons/include/xbmc_epg_types.h
516 BINDINGS+=xbmc/addons/include/xbmc_pvr_dll.h
517 BINDINGS+=xbmc/addons/include/xbmc_pvr_types.h
518 BINDINGS+=xbmc/addons/include/xbmc_scr_dll.h
519 BINDINGS+=xbmc/addons/include/xbmc_scr_types.h
520 BINDINGS+=xbmc/addons/include/xbmc_vis_dll.h
521 BINDINGS+=xbmc/addons/include/xbmc_vis_types.h
522 BINDINGS+=xbmc/addons/include/xbmc_stream_utils.hpp
523 BINDINGS+=addons/library.xbmc.addon/libXBMC_addon.h
524 BINDINGS+=addons/library.xbmc.gui/libXBMC_gui.h
525 BINDINGS+=addons/library.xbmc.pvr/libXBMC_pvr.h
526 BINDINGS+=addons/library.xbmc.codec/libXBMC_codec.h
527 BINDINGS+=xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxPacket.h
528
529 libxbmc.so: $(OBJSXBMC) $(DYNOBJSXBMC) $(NWAOBJSXBMC) $(MAINOBJS)
530 ifeq ($(findstring osx,@ARCH@), osx)
531         $(SILENT_LD) $(CXX) $(LDFLAGS) -bundle -o $@ $(MAINOBJS) -Wl,-all_load,-ObjC $(MAINOBJS) $(DYNOBJSXBMC) $(NWAOBJSXBMC) $(OBJSXBMC) $(LIBS) -read_only_relocs suppress
532 else
533         $(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)
534 endif
535
536 xbmc.bin: $(OBJSXBMC) $(DYNOBJSXBMC) $(NWAOBJSXBMC) $(MAINOBJS)
537
538 ifeq ($(findstring osx,@ARCH@), osx)
539         $(SILENT_LD) $(CXX) $(LDFLAGS) -o xbmc.bin $(MAINOBJS) -Wl,-all_load,-ObjC $(MAINOBJS) $(DYNOBJSXBMC) $(NWAOBJSXBMC) $(OBJSXBMC) $(LIBS) -rdynamic
540 else
541         $(SILENT_LD) $(CXX) $(CXXFLAGS) $(LDFLAGS) -o xbmc.bin $(MAINOBJS) -Wl,--start-group $(MAINOBJS) $(DYNOBJSXBMC) $(OBJSXBMC) -Wl,--end-group $(NWAOBJSXBMC) $(LIBS) -rdynamic
542 endif
543
544 xbmc-xrandr: xbmc-xrandr.c
545 ifneq (1,@USE_XRANDR@)
546         # xbmc-xrandr.c gets picked up by the default make rules
547         @echo "excluding xbmc-xrandr"
548 else
549         $(SILENT_LD) $(CC) $(CFLAGS) $(LDFLAGS) -o xbmc-xrandr xbmc-xrandr.c -lXrandr -lX11 -lm
550 endif
551
552 tools/TexturePacker/TexturePacker: xbmc/guilib/XBTF.h
553         $(MAKE) -C tools/TexturePacker/
554
555
556 install-bin: xbmc.bin # developement convenience target
557         sudo install -d $(DESTDIR)$(libdir)
558         sudo install xbmc.bin $(DESTDIR)$(libdir)/xbmc
559
560 ifeq ($(findstring osx,@ARCH@), osx)
561         # TODO: add osx install
562 else
563 install: install-binaries install-arch install-datas
564
565 apk: apk-clean install
566         make -C tools/android/packaging
567
568 apk-clean:
569         make -C tools/android/packaging clean
570
571 install-binaries: install-scripts
572         @echo "Copying XBMC binary to $(DESTDIR)$(libdir)/xbmc/"
573         @install -d $(DESTDIR)$(libdir)/xbmc
574 ifeq (1,@USE_XRANDR@)
575         @install xbmc-xrandr $(DESTDIR)$(libdir)/xbmc/xbmc-xrandr
576 endif
577 ifeq (@USE_LIBXBMC@,1)
578         @install libxbmc.so $(DESTDIR)$(libdir)/xbmc/libxbmc.so
579 else
580         @install xbmc.bin $(DESTDIR)$(libdir)/xbmc/xbmc.bin
581         @echo "You can run XBMC with the command 'xbmc'"
582 endif
583 endif
584
585 install-arch:
586         @# Arch dependent files
587 ifeq (@USE_PVR_ADDONS@,1)
588         $(MAKE) -C pvr-addons install
589 endif
590 ifeq ($(findstring freebsd,@ARCH@), freebsd)
591         @find -E system addons -type f -not -iregex ".*svn.*" \
592                 -iregex ".*@ARCH@.*|.*\.vis|.*\.xbs" \
593                 -exec sh -c "install -d \"$(DESTDIR)$(libdir)/xbmc/\`dirname '{}'\`\"" \; \
594                 -and \
595                 -exec install "{}" $(DESTDIR)$(libdir)/xbmc/"{}" \; \
596                 -exec printf " -- %-75.75s\r" "{}" \;
597 else
598 ifeq ($(findstring Darwin,$(shell uname -s)),Darwin)
599         @find -E system addons -type f -not -iregex ".*svn.*" \
600                 -iregex ".*@ARCH@.*|.*\.vis|.*\.xbs" \
601                 -exec sh -c "install -d \"$(DESTDIR)$(libdir)/xbmc/\`dirname '{}'\`\"" \; \
602                 -and \
603                 -exec install "{}" $(DESTDIR)$(libdir)/xbmc/"{}" \; \
604                 -exec printf " -- %-75.75s\r" "{}" \;
605 else
606         @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"
607 endif
608 endif
609
610 install-scripts:
611         @install -d $(DESTDIR)$(bindir)
612         @install tools/Linux/xbmc.sh $(DESTDIR)$(bindir)/xbmc
613         @install tools/Linux/xbmc-standalone.sh $(DESTDIR)$(bindir)/xbmc-standalone
614         @install -d $(DESTDIR)$(datarootdir)/xbmc
615         @install -m 0644 tools/Linux/FEH.py $(DESTDIR)$(datarootdir)/xbmc/FEH.py
616         @install -d $(DESTDIR)$(datarootdir)/xsessions
617         @install -m 0644 tools/Linux/xbmc-xsession.desktop $(DESTDIR)$(datarootdir)/xsessions/XBMC.desktop
618
619 install-datas: install-scripts
620         @echo "Copying support and legal files..."
621         @install -d $(DESTDIR)$(docdir)
622         @for FILE in `ls LICENSE.GPL *.txt`; do \
623                 install -m 0644 "$$FILE" "$(DESTDIR)$(docdir)/$$FILE"; done
624         @install -m 0644 "docs/README.linux" "$(DESTDIR)$(docdir)/README.linux"
625         @echo "Done!"
626         @echo "Copying system files to $(DESTDIR)$(datarootdir)/xbmc"
627         @install -d $(DESTDIR)$(datarootdir)/xbmc
628         @# Arch independent files
629 ifeq ($(findstring bsd,@ARCH@), bsd)
630         @find -E addons language media sounds userdata system -type f \
631                 -not -iregex ".*@ARCH@.*|.*\.vis|.*\.xbs|.*svn.*|.*\.so|.*\.dll|$(subst ${space},|,$(INSTALL_FILTER))" \
632                 -exec sh -c "install -d \"$(DESTDIR)$(datarootdir)/xbmc/\`dirname '{}'\`\"" \; \
633                 -and \
634                 -exec install -m 0644 "{}" $(DESTDIR)$(datarootdir)/xbmc/"{}" \; \
635                 -exec printf " -- %-75.75s\r" "{}" \;
636 else
637 ifeq ($(findstring Darwin,$(shell uname -s)),Darwin)
638         @find -E addons language media sounds userdata system -type f \
639                 -not -iregex ".*@ARCH@.*|.*\.vis|.*\.xbs|.*svn.*|.*\.so|.*\.dll|$(subst ${space},|,$(INSTALL_FILTER))" \
640                 -exec sh -c "install -d \"$(DESTDIR)$(datarootdir)/xbmc/\`dirname '{}'\`\"" \; \
641                 -and \
642                 -exec install -m 0644 "{}" $(DESTDIR)$(datarootdir)/xbmc/"{}" \; \
643                 -exec printf " -- %-75.75s\r" "{}" \;
644 else
645         @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"
646 endif
647 endif
648         @# Icons and links
649         @install -d $(DESTDIR)$(datarootdir)/applications
650         @install -m 0644 tools/Linux/xbmc.desktop $(DESTDIR)$(datarootdir)/applications/xbmc.desktop
651         @install -d $(DESTDIR)$(datadir)/icons/hicolor/48x48/apps
652         @install -m 0644 media/icon48x48.png $(DESTDIR)$(datadir)/icons/hicolor/48x48/apps/xbmc.png
653         @install -d $(DESTDIR)$(datadir)/icons/hicolor/256x256/apps
654         @install -m 0644 media/icon256x256.png $(DESTDIR)$(datadir)/icons/hicolor/256x256/apps/xbmc.png
655         @test -z "$(DESTDIR)" && gtk-update-icon-cache -f -q -t $(datadir)/icons/hicolor || :
656
657         @echo "Copying bindings to $(DESTDIR)$(includedir)/xbmc"
658         @install -d $(DESTDIR)$(includedir)/xbmc
659         @for f in $(BINDINGS); do \
660           install -m 0644 $$f $(DESTDIR)$(includedir)/xbmc ; \
661         done
662         @for f in project/cmake/*.cmake; do \
663           install -m 0644 $$f $(DESTDIR)$(libdir)/xbmc; \
664         done
665
666 uninstall:
667         @echo "Removing XBMC..."
668         @rm -rf $(DESTDIR)$(libdir)/xbmc
669         @rm -rf $(DESTDIR)$(datarootdir)/xbmc $(DESTDIR)$(bindir)/xbmc
670         @rm -rf $(DESTDIR)$(bindir)/xbmc-standalone
671         @rm -rf $(DESTDIR)$(datarootdir)/xsessions/XBMC.desktop
672         @rm -rf $(libdir)/libXBMC_*
673         @rm -rf $(prefix)/include/xbmc
674         @echo "Done!"
675
676 clean-xbmc.bin:
677         rm -f xbmc.bin
678         for d in $(BIN_DIRS); do if test -f $$d/Makefile; then $(MAKE) -C $$d clean; fi; done
679 clean-eventclients:
680         for d in $(EC_DIRS); do if test -f $$d/Makefile; then $(MAKE) -C $$d clean; fi; done
681 clean-xbmctex:
682         for d in $(XBMCTEX_DIRS); do if test -f $$d/Makefile; then $(MAKE) -C $$d clean; fi; done
683 clean-dvdpcodecs:
684         for d in $(DVDPCODECS_DIRS); do if test -f $$d/Makefile; then $(MAKE) -C $$d clean; fi; done
685 clean-papcodecs:
686         for d in $(PAPCODECS_DIRS); do if test -f $$d/Makefile; then $(MAKE) -C $$d clean; fi; done
687 clean-libs:
688         for d in $(LIB_DIRS); do if test -f $$d/Makefile; then $(MAKE) -C $$d clean; fi; done
689 clean-screensavers:
690         for d in $(SS_DIRS); do if test -f $$d/Makefile; then $(MAKE) -C $$d clean; fi; done
691 clean-visualisations:
692         for d in $(VIS_DIRS); do if test -f $$d/Makefile; then $(MAKE) -C $$d clean; fi; done
693 clean-libaddons:
694         for d in $(LIBADDON_DIRS); do if test -f $$d/Makefile; then $(MAKE) -C $$d clean; fi; done
695 clean-pvraddons:
696 ifeq (@USE_PVR_ADDONS@,1)
697         if test -f pvr-addons/Makefile; then $(MAKE) -C pvr-addons clean; fi;
698 endif
699
700 clean-codecs: clean-dvdpcodecs clean-papcodecs
701
702 clean-externals: clean-codecs clean-eventclients clean-xbmctex clean-libs \
703         clean-screensavers clean-visualisations clean-libaddons clean-pvraddons
704
705 ifeq (1,@GTEST_CONFIGURED@)
706 check: testsuite
707         for check_program in $(CHECK_PROGRAMS); do $(CURDIR)/$$check_program; done
708
709 testsuite: $(CHECK_EXTENSIONS) $(CHECK_PROGRAMS)
710
711 testframework: $(GTEST_LIBS)
712
713 $(GTEST_LIBS): $(GTEST_DIR)/Makefile
714
715 $(GTEST_DIR)/Makefile: force
716         $(MAKE) -C $(GTEST_DIR)
717
718 $(CHECK_LIBS): force
719         @$(MAKE) $(if $(V),,-s) -C $(@D)
720
721 xbmc-test: $(CHECK_LIBS) $(OBJSXBMC) $(DYNOBJSXBMC) $(NWAOBJSXBMC) $(GTEST_LIBS)
722 ifeq ($(findstring osx,@ARCH@), osx)
723         $(SILENT_LD) $(CXX) $(LDFLAGS) $(GTEST_INCLUDES) -o $@ -Wl,-all_load,-ObjC $(DYNOBJSXBMC) $(NWAOBJSXBMC) $(OBJSXBMC) $(GTEST_LIBS) $(CHECK_LIBS) $(LIBS) $(CHECK_LIBADD) -rdynamic
724 else
725         $(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
726 endif
727 else
728 # Give a message that the framework is not configured, but don't fail.
729 check testsuite testframework:
730         @echo "Google Test Framework not configured, skipping testsuite check."
731 endif