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