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