Merge pull request #3390 from davilla/amlcodec-fixes
[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 DVDPLAYER_ARCHIVES=xbmc/cores/dvdplayer/DVDPlayer.a \
20                    xbmc/cores/dvdplayer/DVDCodecs/DVDCodecs.a \
21                    xbmc/cores/dvdplayer/DVDCodecs/Audio/Audio.a \
22                    xbmc/cores/dvdplayer/DVDCodecs/Overlay/Overlay.a \
23                    xbmc/cores/dvdplayer/DVDCodecs/Video/Video.a \
24                    xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxers.a \
25                    xbmc/cores/dvdplayer/DVDInputStreams/DVDInputStreams.a \
26                    xbmc/cores/dvdplayer/DVDSubtitles/DVDSubtitles.a
27
28 DIRECTORY_ARCHIVES=$(DVDPLAYER_ARCHIVES) \
29                    lib/SlingboxLib/SlingboxLib.a \
30                    lib/libRTV/librtv.a \
31                    lib/libXDAAP/libxdaap.a \
32                    lib/libhts/libhts.a \
33                    lib/libsquish/libsquish.a \
34                    lib/xbmc-dll-symbols/dll-symbols.a \
35                    xbmc/addons/addons.a \
36                    xbmc/cdrip/cdrip.a \
37                    xbmc/cores/AudioEngine/audioengine.a \
38                    xbmc/cores/DllLoader/dllloader.a \
39                    xbmc/cores/DllLoader/exports/exports.a \
40                    xbmc/cores/DllLoader/exports/util/exports_utils.a \
41                    xbmc/cores/ExternalPlayer/ExternalPlayer.a \
42                    xbmc/cores/VideoRenderers/VideoRenderer.a \
43                    xbmc/cores/VideoRenderers/VideoShaders/VideoShaders.a \
44                    xbmc/cores/cores.a \
45                    xbmc/cores/paplayer/paplayer.a \
46                    xbmc/cores/playercorefactory/playercorefactory.a \
47                    xbmc/dbwrappers/dbwrappers.a \
48                    xbmc/dialogs/dialogs.a \
49                    xbmc/epg/epg.a \
50                    xbmc/filesystem/MusicDatabaseDirectory/musicdatabasedirectory.a \
51                    xbmc/filesystem/VideoDatabaseDirectory/videodatabasedirectory.a \
52                    xbmc/filesystem/filesystem.a \
53                    xbmc/guilib/guilib.a \
54                    xbmc/input/input.a \
55                    xbmc/interfaces/generic/interfaces-generic.a \
56                    xbmc/interfaces/info/info.a \
57                    xbmc/interfaces/interfaces.a \
58                    xbmc/interfaces/json-rpc/json-rpc.a \
59                    xbmc/linux/linux.a \
60                    xbmc/music/dialogs/musicdialogs.a \
61                    xbmc/music/infoscanner/musicscanner.a \
62                    xbmc/music/karaoke/karaoke.a \
63                    xbmc/music/music.a \
64                    xbmc/music/tags/musictags.a \
65                    xbmc/music/windows/musicwindows.a \
66                    xbmc/network/websocket/websocket.a \
67                    xbmc/network/network.a \
68                    xbmc/peripherals/bus/peripheral-bus.a \
69                    xbmc/peripherals/devices/peripheral-devices.a \
70                    xbmc/peripherals/dialogs/peripheral-dialogs.a \
71                    xbmc/peripherals/peripherals.a \
72                    xbmc/pictures/pictures.a \
73                    xbmc/playlists/playlists.a \
74                    xbmc/powermanagement/powermanagement.a \
75                    xbmc/profiles/profiles.a \
76                    xbmc/profiles/dialogs/profiles_dialogs.a \
77                    xbmc/profiles/windows/profiles_windows.a \
78                    xbmc/programs/programs.a \
79                    xbmc/pvr/addons/pvraddons.a \
80                    xbmc/pvr/channels/pvrchannels.a \
81                    xbmc/pvr/dialogs/pvrdialogs.a \
82                    xbmc/pvr/pvr.a \
83                    xbmc/pvr/recordings/pvrrecordings.a \
84                    xbmc/pvr/timers/pvrtimers.a \
85                    xbmc/pvr/windows/pvrwindows.a \
86                    xbmc/rendering/rendering.a \
87                    xbmc/settings/settings.a \
88                    xbmc/settings/dialogs/settings_dialogs.a \
89                    xbmc/settings/windows/settings_windows.a \
90                    xbmc/storage/storage.a \
91                    xbmc/utils/utils.a \
92                    xbmc/video/dialogs/videodialogs.a \
93                    xbmc/video/video.a \
94                    xbmc/video/windows/videowindows.a \
95                    xbmc/view/view.a \
96                    xbmc/windowing/windowing.a \
97                    xbmc/windows/windows.a \
98                    xbmc/xbmc.a \
99
100 NWAOBJSXBMC=    xbmc/threads/threads.a \
101                 xbmc/commons/commons.a
102
103
104 ifeq (@USE_WEB_SERVER@,1)
105 DIRECTORY_ARCHIVES += xbmc/network/httprequesthandler/httprequesthandlers.a
106 endif
107
108 DIRECTORY_ARCHIVES += xbmc/interfaces/legacy/legacy.a
109 DIRECTORY_ARCHIVES += xbmc/interfaces/python/python_binding.a
110
111 ifeq (@USE_OPENGL@,1)
112 DIRECTORY_ARCHIVES += xbmc/rendering/gl/rendering_gl.a
113 endif
114
115 ifeq (@USE_OPENGLES@,1)
116 DIRECTORY_ARCHIVES += xbmc/rendering/gles/rendering_gles.a
117 DIRECTORY_ARCHIVES += xbmc/windowing/egl/windowing_egl.a
118 DIRECTORY_ARCHIVES += xbmc/visualizations/EGLHelpers/eglhelpers.a
119 endif
120
121 ifeq (@USE_UPNP@,1)
122 DIRECTORY_ARCHIVES += lib/libUPnP/libupnp.a \
123                       xbmc/network/upnp/upnp.a
124 endif
125
126 ifeq (@USE_MDNSEMBEDDED@,1)
127 DIRECTORY_ARCHIVES += xbmc/network/mdns/mdns.a
128 endif
129
130 INSTALL_FILTER = .*visualization\.dxspectrum.*
131 INSTALL_FILTER += .*visualization\.milkdrop.*
132
133 ifeq ($(findstring osx,@ARCH@),osx)
134 DIRECTORY_ARCHIVES += xbmc/osx/osx.a
135 DIRECTORY_ARCHIVES += xbmc/network/osx/network.a
136 DIRECTORY_ARCHIVES += xbmc/network/linux/network_linux.a
137 DIRECTORY_ARCHIVES += xbmc/powermanagement/osx/powermanagement.a
138 DIRECTORY_ARCHIVES += xbmc/storage/osx/storage.a
139 DIRECTORY_ARCHIVES += xbmc/windowing/osx/windowing_osx.a
140 INSTALL_FILTER += .*repository\.pvr-android\.xbmc\.org.*
141 INSTALL_FILTER += .*repository\.pvr-ios\.xbmc\.org.*
142 INSTALL_FILTER += .*repository\.pvr-win32\.xbmc\.org.*
143 else
144 INSTALL_FILTER += .*repository\.pvr-ios\.xbmc\.org.*
145 INSTALL_FILTER += .*repository\.pvr-win32\.xbmc\.org.*
146 INSTALL_FILTER += .*repository\.pvr-osx.*\.xbmc\.org.*
147 ifeq (@USE_ANDROID@,1)
148 DIRECTORY_ARCHIVES += xbmc/input/linux/input_linux.a
149 DIRECTORY_ARCHIVES += xbmc/input/touch/input_touch.a
150 DIRECTORY_ARCHIVES += xbmc/input/touch/generic/input_touch_generic.a
151 DIRECTORY_ARCHIVES += xbmc/network/linux/network_linux.a
152 DIRECTORY_ARCHIVES += xbmc/powermanagement/android/powermanagement_android.a
153 DIRECTORY_ARCHIVES += xbmc/storage/android/storage_android.a
154 DIRECTORY_ARCHIVES += xbmc/windowing/X11/windowing_X11.a
155 else
156 DIRECTORY_ARCHIVES += xbmc/input/linux/input_linux.a
157 DIRECTORY_ARCHIVES += xbmc/network/linux/network_linux.a
158 DIRECTORY_ARCHIVES += xbmc/powermanagement/linux/powermanagement_linux.a
159 DIRECTORY_ARCHIVES += xbmc/storage/linux/storage_linux.a
160 DIRECTORY_ARCHIVES += xbmc/windowing/X11/windowing_X11.a
161 INSTALL_FILTER += .*repository\.pvr-android\.xbmc\.org.*
162 endif
163 endif
164
165 ifeq ($(findstring freebsd,@ARCH@),freebsd)
166 DIRECTORY_ARCHIVES += xbmc/freebsd/freebsd.a
167 endif
168
169 ifeq (@HAVE_XBMC_NONFREE@,1)
170 DIRECTORY_ARCHIVES += lib/UnrarXLib/UnrarXLib.a
171 endif
172
173 BIN_DIRS = $(dir $(DIRECTORY_ARCHIVES)) $(dir $(NWAOBJSXBMC))
174
175 ifeq (@USE_ANDROID@,1)
176 DIRECTORY_ARCHIVES += xbmc/android/loader/AndroidDyload.a
177 DIRECTORY_ARCHIVES += xbmc/windowing/android/windowing_android.a
178 DIRECTORY_ARCHIVES += xbmc/android/activity/activity.a
179 DIRECTORY_ARCHIVES += xbmc/android/bionic_supplement/bionic_supplement.a
180 DIRECTORY_ARCHIVES += xbmc/android/jni/jni.a
181 endif
182
183 ifeq (@USE_AMLPLAYER@,1)
184 DIRECTORY_ARCHIVES += xbmc/cores/amlplayer/amlplayer.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 CHECK_PROGRAMS = xbmc-test
312
313 CLEAN_FILES += $(CHECK_PROGRAMS)
314
315 all : $(FINAL_TARGETS)
316         @echo '-----------------------'
317         @echo 'XBMC built successfully'
318         @echo '-----------------------'
319
320 include Makefile.include
321
322 .PHONY : dllloader exports visualizations screensavers eventclients papcodecs \
323         dvdpcodecs imagelib codecs externals force skins libaddon check \
324         testframework testsuite
325
326 # hack targets to keep build system up to date
327 Makefile : config.status $(addsuffix .in, $(AUTOGENERATED_MAKEFILES))
328         @echo "Regenerating Makefiles..."
329         @./config.status &> /dev/null
330         @echo "done"
331
332 config.status: configure
333
334 # skin textures
335 ifeq (@USE_TEXTUREPACKER@,1)
336 skins: tools/TexturePacker/TexturePacker force
337          $(MAKE) -C $(CONFLUENCE_MEDIA)
338 ifeq (@USE_SKIN_TOUCHED@,1)
339          $(MAKE) -C $(TOUCHED_MEDIA)
340 endif
341 else
342 skins:
343 endif
344
345 # Setup some dependencies for subdir makes
346 xbmc/cores/paplayer/paplayer.a: papcodecs
347 $(DVDPLAYER_ARCHIVES)         : dvdpcodecs
348
349 $(NWAOBJSXBMC): force
350         @$(MAKE) $(if $(V),,-s) -C $(@D)
351
352 $(DIRECTORY_ARCHIVES): force
353         @$(MAKE) $(if $(V),,-s) -C $(@D)
354
355 lib/cpluff/libcpluff/.libs/libcpluff.a: force
356         $(MAKE) -C lib/cpluff/libcpluff
357 system/libcpluff-@ARCH@.so: lib/cpluff/libcpluff/.libs/libcpluff.a exports
358 ifeq ($(findstring osx,@ARCH@), osx)
359   ifeq (@ARCH@, arm-osx)
360         $(CXX) $(LDFLAGS) -all_load -bundle -flat_namespace -undefined dynamic_lookup -read_only_relocs suppress -o $@ $<
361   else
362         $(CXX) $(LDFLAGS) -all_load -bundle -flat_namespace -undefined dynamic_lookup -lexpat $(BUNDLE1_O) -o $@ $<
363   endif
364 else
365         $(CXX) $(LDFLAGS) -shared -o $@ -Wl,--whole-archive $< \
366                 -Wl,--no-whole-archive  \
367                 `cat xbmc/cores/DllLoader/exports/wrapper.def` xbmc/cores/DllLoader/exports/wrapper.o -lexpat
368 endif
369
370 exports: xbmc/cores/DllLoader/exports/exports.a xbmc/cores/DllLoader/exports/util/exports_utils.a
371         $(MAKE) -C xbmc/cores/DllLoader/exports wrapper.def
372 dllloader: exports xbmc/cores/DllLoader/dllloader.a
373
374 ifeq (@USE_OPENGLES@,1)
375 EGLHELPERS=xbmc/visualizations/EGLHelpers/eglhelpers.a
376 endif
377
378 $(VIS_DIRS): force exports $(EGLHELPERS)
379         $(MAKE) -C $@
380
381 $(SS_DIRS): force exports
382         $(MAKE) -C $@
383
384 visualizations: $(VIS_DIRS)
385
386 screensavers: $(SS_DIRS)
387
388 libaddon: exports
389         $(MAKE) -C lib/addons/library.xbmc.addon
390         $(MAKE) -C lib/addons/library.xbmc.codec
391         $(MAKE) -C lib/addons/library.xbmc.gui
392         $(MAKE) -C lib/addons/library.xbmc.pvr
393 dvdpcodecs: dllloader
394         $(MAKE) -C lib
395         $(MAKE) -C lib/libdvd
396 eventclients:
397 ifeq ($(findstring osx,@ARCH@), osx)
398 ifneq ($(findstring arm,@ARCH@), arm)
399         $(MAKE) -C tools/EventClients/Clients/OSXRemote
400 endif
401 else
402         $(MAKE) -C tools/EventClients
403 endif
404 libexif: dllloader
405         $(MAKE) -C lib/libexif
406 cmyth: dllloader
407         $(MAKE) -C lib/cmyth
408 libhdhomerun: dllloader
409         $(MAKE) -C lib/libhdhomerun
410 papcodecs: dllloader dvdpcodecs
411         test -d system/players/paplayer || mkdir system/players/paplayer
412         $(MAKE) -C lib/xbadpcm
413         $(MAKE) -C lib/vgmstream
414         $(MAKE) -C lib/timidity
415         $(MAKE) -C lib/nosefart
416 ifneq ($(findstring arm-osx,@ARCH@), arm-osx)
417         $(MAKE) -C lib/libsidplay2
418 endif
419 ifeq (@USE_ASAP_CODEC@,1)
420   ifneq ($(findstring osx,@ARCH@), osx)
421         $(MAKE) -C lib/asap asap-xbmc
422   endif
423 endif
424         $(MAKE) -C lib/stsound/StSoundLibrary
425 ifeq ($(or $(findstring powerpc,@ARCH@),$(findstring x86_64-linux,@ARCH@),$(findstring arm, @ARCH@),$(findstring freebsd,@ARCH@)),)
426         $(MAKE) -C lib/snesapu/SNES/SNESAPU
427 endif
428 imagelib: dllloader
429         $(MAKE) -C lib/cximage-6.0
430
431 pvraddons: exports
432 ifeq (@USE_PVR_ADDONS@,1)
433         $(MAKE) -C pvr-addons
434 endif
435
436 codecs: papcodecs dvdpcodecs
437
438 libs: libhdhomerun imagelib libexif system/libcpluff-@ARCH@.so $(CMYTH)
439
440 externals: codecs libs visualizations screensavers libaddon pvraddons
441
442 xcode_depends: \
443         codecs libs visualizations screensavers eventclients skins libaddon \
444         lib/libsquish/libsquish.a \
445         lib/libRTV/librtv.a \
446         lib/libXDAAP/libxdaap.a \
447         lib/SlingboxLib/SlingboxLib.a
448
449 OBJSXBMC =$(DIRECTORY_ARCHIVES)
450
451 DYNOBJSXBMC= \
452         xbmc/linux/linux.a \
453         xbmc/network/network.a \
454         xbmc/video/windows/videowindows.a \
455         xbmc/utils/utils.a \
456         xbmc/cores/DllLoader/exports/util/exports_utils.a \
457         xbmc/cores/DllLoader/exports/exports.a \
458         xbmc/settings/settings.a \
459         xbmc/video/video.a \
460         xbmc/pvr/addons/pvraddons.a \
461         xbmc/pvr/windows/pvrwindows.a \
462         xbmc/guilib/guilib.a # must be dynamic to avoid linker errors
463
464 ifeq ($(findstring freebsd,@ARCH@),freebsd)
465 DYNOBJSXBMC+= xbmc/freebsd/freebsd.a
466 endif
467
468 OBJSXBMC:=$(filter-out $(DYNOBJSXBMC), $(OBJSXBMC))
469
470 MAINOBJS=xbmc/xbmc.o
471 ifeq (@USE_ANDROID@,1)
472 MAINOBJS+=xbmc/android/activity/android_main.o
473 endif
474 ifneq (@USE_LIBXBMC@,1)
475 MAINOBJS+=xbmc/main/main.o
476 endif
477
478 # sync these entries manually with tools/depends/target/xbmc-addon-bindings/Makefile
479 BINDINGS =xbmc/addons/include/xbmc_addon_cpp_dll.h
480 BINDINGS+=xbmc/addons/include/xbmc_addon_dll.h
481 BINDINGS+=xbmc/addons/include/xbmc_addon_types.h
482 BINDINGS+=xbmc/addons/include/xbmc_codec_types.h
483 BINDINGS+=xbmc/addons/include/xbmc_epg_types.h
484 BINDINGS+=xbmc/addons/include/xbmc_pvr_dll.h
485 BINDINGS+=xbmc/addons/include/xbmc_pvr_types.h
486 BINDINGS+=xbmc/addons/include/xbmc_scr_dll.h
487 BINDINGS+=xbmc/addons/include/xbmc_scr_types.h
488 BINDINGS+=xbmc/addons/include/xbmc_vis_dll.h
489 BINDINGS+=xbmc/addons/include/xbmc_vis_types.h
490 BINDINGS+=xbmc/addons/include/xbmc_stream_utils.hpp
491 BINDINGS+=addons/library.xbmc.addon/libXBMC_addon.h
492 BINDINGS+=addons/library.xbmc.gui/libXBMC_gui.h
493 BINDINGS+=addons/library.xbmc.pvr/libXBMC_pvr.h
494 BINDINGS+=addons/library.xbmc.codec/libXBMC_codec.h
495 BINDINGS+=xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxPacket.h
496
497 libxbmc.so: $(OBJSXBMC) $(DYNOBJSXBMC) $(NWAOBJSXBMC) $(MAINOBJS)
498 ifeq ($(findstring osx,@ARCH@), osx)
499         $(SILENT_LD) $(CXX) $(LDFLAGS) -bundle -o $@ -Wl,-all_load,-ObjC $(DYNOBJSXBMC) $(NWAOBJSXBMC) $(OBJSXBMC) $(LIBS)
500 else
501         $(SILENT_LD) $(CXX) $(CXXFLAGS) $(LDFLAGS) -shared -o $@ $(MAINOBJS) -Wl,--start-group $(DYNOBJSXBMC) $(OBJSXBMC) -Wl,--end-group -Wl,--no-undefined $(NWAOBJSXBMC) $(LIBS)
502 endif
503
504 xbmc/main/main.a:
505         $(MAKE) -C xbmc/main
506
507 xbmc.bin: $(OBJSXBMC) $(DYNOBJSXBMC) $(NWAOBJSXBMC) $(MAINOBJS) xbmc/main/main.a
508
509 ifeq ($(findstring osx,@ARCH@), osx)
510         $(SILENT_LD) $(CXX) $(LDFLAGS) -o xbmc.bin -Wl,-all_load,-ObjC $(DYNOBJSXBMC) $(NWAOBJSXBMC) $(OBJSXBMC) $(LIBS) -rdynamic
511 else
512         $(SILENT_LD) $(CXX) $(CXXFLAGS) $(LDFLAGS) -o xbmc.bin $(MAINOBJS) -Wl,--start-group $(DYNOBJSXBMC) $(OBJSXBMC) -Wl,--end-group $(NWAOBJSXBMC) $(LIBS) -rdynamic
513 endif
514
515 xbmc-xrandr: xbmc-xrandr.c
516 ifneq (1,@USE_XRANDR@)
517         # xbmc-xrandr.c gets picked up by the default make rules
518         @echo "excluding xbmc-xrandr"
519 else
520         $(SILENT_LD) $(CC) $(CFLAGS) $(LDFLAGS) -o xbmc-xrandr xbmc-xrandr.c -lXrandr -lX11 -lm
521 endif
522
523 tools/TexturePacker/TexturePacker: xbmc/guilib/XBTF.h
524         $(MAKE) -C tools/TexturePacker/
525
526
527 install-bin: xbmc.bin # developement convenience target
528         sudo install -d $(DESTDIR)$(libdir)
529         sudo install xbmc.bin $(DESTDIR)$(libdir)/xbmc
530
531 ifeq ($(findstring osx,@ARCH@), osx)
532         # TODO: add osx install
533 else
534 install: install-binaries install-arch install-datas
535
536 apk: install
537         make -C tools/android/packaging
538
539 install-binaries: install-scripts
540         @echo "Copying XBMC binary to $(DESTDIR)$(libdir)/xbmc/"
541         @install -d $(DESTDIR)$(libdir)/xbmc
542 ifeq (1,@USE_XRANDR@)
543         @install xbmc-xrandr $(DESTDIR)$(libdir)/xbmc/xbmc-xrandr
544 endif
545 ifeq (@USE_LIBXBMC@,1)
546         @install libxbmc.so $(DESTDIR)$(libdir)/xbmc/libxbmc.so
547 else
548         @install xbmc.bin $(DESTDIR)$(libdir)/xbmc/xbmc.bin
549         @echo "You can run XBMC with the command 'xbmc'"
550 endif
551 endif
552
553 install-arch:
554         @# Arch dependent files
555 ifeq (@USE_PVR_ADDONS@,1)
556         $(MAKE) -C pvr-addons install
557 endif
558 ifeq ($(findstring freebsd,@ARCH@), freebsd)
559         @find -E system addons -type f -not -iregex ".*svn.*" \
560                 -iregex ".*@ARCH@.*|.*\.vis|.*\.xbs" \
561                 -exec sh -c "install -d \"$(DESTDIR)$(libdir)/xbmc/\`dirname '{}'\`\"" \; \
562                 -and \
563                 -exec install "{}" $(DESTDIR)$(libdir)/xbmc/"{}" \; \
564                 -exec printf " -- %-75.75s\r" "{}" \;
565 else
566 ifeq ($(findstring Darwin,$(shell uname -s)),Darwin)
567         @find -E system addons -type f -not -iregex ".*svn.*" \
568                 -iregex ".*@ARCH@.*|.*\.vis|.*\.xbs" \
569                 -exec sh -c "install -d \"$(DESTDIR)$(libdir)/xbmc/\`dirname '{}'\`\"" \; \
570                 -and \
571                 -exec install "{}" $(DESTDIR)$(libdir)/xbmc/"{}" \; \
572                 -exec printf " -- %-75.75s\r" "{}" \;
573 else
574         @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"
575 endif
576 endif
577
578 install-scripts:
579         @install -d $(DESTDIR)$(bindir)
580         @install tools/Linux/xbmc.sh $(DESTDIR)$(bindir)/xbmc
581         @install tools/Linux/xbmc-standalone.sh $(DESTDIR)$(bindir)/xbmc-standalone
582         @install -d $(DESTDIR)$(datarootdir)/xbmc
583         @install -m 0644 tools/Linux/FEH.py $(DESTDIR)$(datarootdir)/xbmc/FEH.py
584         @install -d $(DESTDIR)$(datarootdir)/xsessions
585         @install -m 0644 tools/Linux/xbmc-xsession.desktop $(DESTDIR)$(datarootdir)/xsessions/XBMC.desktop
586
587 install-datas: install-scripts
588         @echo "Copying support and legal files..."
589         @install -d $(DESTDIR)$(docdir)
590         @for FILE in `ls LICENSE.GPL *.txt`; do \
591                 install -m 0644 "$$FILE" "$(DESTDIR)$(docdir)/$$FILE"; done
592         @install -m 0644 "docs/README.linux" "$(DESTDIR)$(docdir)/README.linux"
593         @echo "Done!"
594         @echo "Copying system files to $(DESTDIR)$(datarootdir)/xbmc"
595         @install -d $(DESTDIR)$(datarootdir)/xbmc
596         @# Arch independent files
597 ifeq ($(findstring bsd,@ARCH@), bsd)
598         @find -E addons language media sounds userdata system -type f \
599                 -not -iregex ".*@ARCH@.*|.*\.vis|.*\.xbs|.*svn.*|.*\.so|.*\.dll|$(subst ${space},|,$(INSTALL_FILTER))" \
600                 -exec sh -c "install -d \"$(DESTDIR)$(datarootdir)/xbmc/\`dirname '{}'\`\"" \; \
601                 -and \
602                 -exec install -m 0644 "{}" $(DESTDIR)$(datarootdir)/xbmc/"{}" \; \
603                 -exec printf " -- %-75.75s\r" "{}" \;
604 else
605 ifeq ($(findstring Darwin,$(shell uname -s)),Darwin)
606         @find -E addons language media sounds userdata system -type f \
607                 -not -iregex ".*@ARCH@.*|.*\.vis|.*\.xbs|.*svn.*|.*\.so|.*\.dll|$(subst ${space},|,$(INSTALL_FILTER))" \
608                 -exec sh -c "install -d \"$(DESTDIR)$(datarootdir)/xbmc/\`dirname '{}'\`\"" \; \
609                 -and \
610                 -exec install -m 0644 "{}" $(DESTDIR)$(datarootdir)/xbmc/"{}" \; \
611                 -exec printf " -- %-75.75s\r" "{}" \;
612 else
613         @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"
614 endif
615 endif
616         @# Icons and links
617         @install -d $(DESTDIR)$(datarootdir)/applications
618         @install tools/Linux/xbmc.desktop $(DESTDIR)$(datarootdir)/applications/xbmc.desktop
619         @install -d $(DESTDIR)$(datadir)/icons/hicolor/48x48/apps
620         @install -m 0644 tools/Linux/xbmc-48x48.png $(DESTDIR)$(datadir)/icons/hicolor/48x48/apps/xbmc.png
621         @install -d $(DESTDIR)$(datadir)/icons/hicolor/256x256/apps
622         @install -m 0644 media/icon.png $(DESTDIR)$(datadir)/icons/hicolor/256x256/apps/xbmc.png
623         @test -z "$(DESTDIR)" && gtk-update-icon-cache -f -q -t $(datadir)/icons/hicolor || :
624
625         @echo "Copying bindings to $(DESTDIR)$(includedir)/xbmc"
626         @install -d $(DESTDIR)$(includedir)/xbmc
627         @for f in $(BINDINGS); do \
628           install -m 0644 $$f $(DESTDIR)$(includedir)/xbmc ; \
629         done
630         @for f in project/cmake/*.cmake; do \
631           install -m 0644 $$f $(DESTDIR)$(libdir)/xbmc; \
632         done
633
634 uninstall:
635         @echo "Removing XBMC..."
636         @rm -rf $(DESTDIR)$(libdir)/xbmc
637         @rm -rf $(DESTDIR)$(datarootdir)/xbmc $(DESTDIR)$(bindir)/xbmc
638         @rm -rf $(DESTDIR)$(bindir)/xbmc-standalone
639         @rm -rf $(DESTDIR)$(datarootdir)/xsessions/XBMC.desktop
640         @rm -rf $(libdir)/libXBMC_*
641         @rm -rf $(prefix)/include/xbmc
642         @echo "Done!"
643
644 clean-xbmc.bin:
645         rm -f xbmc.bin
646         for d in $(BIN_DIRS); do if test -f $$d/Makefile; then $(MAKE) -C $$d clean; fi; done
647 clean-eventclients:
648         for d in $(EC_DIRS); do if test -f $$d/Makefile; then $(MAKE) -C $$d clean; fi; done
649 clean-xbmctex:
650         for d in $(XBMCTEX_DIRS); do if test -f $$d/Makefile; then $(MAKE) -C $$d clean; fi; done
651 clean-dvdpcodecs:
652         for d in $(DVDPCODECS_DIRS); do if test -f $$d/Makefile; then $(MAKE) -C $$d clean; fi; done
653 clean-papcodecs:
654         for d in $(PAPCODECS_DIRS); do if test -f $$d/Makefile; then $(MAKE) -C $$d clean; fi; done
655 clean-libs:
656         for d in $(LIB_DIRS); do if test -f $$d/Makefile; then $(MAKE) -C $$d clean; fi; done
657 clean-screensavers:
658         for d in $(SS_DIRS); do if test -f $$d/Makefile; then $(MAKE) -C $$d clean; fi; done
659 clean-visualisations:
660         for d in $(VIS_DIRS); do if test -f $$d/Makefile; then $(MAKE) -C $$d clean; fi; done
661 clean-libaddons:
662         for d in $(LIBADDON_DIRS); do if test -f $$d/Makefile; then $(MAKE) -C $$d clean; fi; done
663 clean-pvraddons:
664 ifeq (@USE_PVR_ADDONS@,1)
665         if test -f pvr-addons/Makefile; then $(MAKE) -C pvr-addons clean; fi;
666 endif
667
668 clean-codecs: clean-dvdpcodecs clean-papcodecs
669
670 clean-externals: clean-codecs clean-eventclients clean-xbmctex clean-libs \
671         clean-screensavers clean-visualisations clean-libaddons clean-pvraddons
672
673 ifeq (1,@GTEST_CONFIGURED@)
674 check: testsuite
675         for check_program in $(CHECK_PROGRAMS); do $(CURDIR)/$$check_program; done
676
677 testsuite: $(CHECK_PROGRAMS)
678
679 testframework: $(GTEST_LIBS)
680
681 $(GTEST_LIBS): $(GTEST_DIR)/Makefile
682
683 $(GTEST_DIR)/Makefile: force
684         $(MAKE) -C $(GTEST_DIR)
685
686 $(CHECK_LIBS): force
687         @$(MAKE) $(if $(V),,-s) -C $(@D)
688
689 xbmc-test: $(CHECK_LIBS) $(OBJSXBMC) $(DYNOBJSXBMC) $(NWAOBJSXBMC) $(GTEST_LIBS)
690 ifeq ($(findstring osx,@ARCH@), osx)
691         $(SILENT_LD) $(CXX) $(LDFLAGS) $(GTEST_INCLUDES) -o $@ -Wl,-all_load,-ObjC $(CHECK_LIBS) $(DYNOBJSXBMC) $(NWAOBJSXBMC) $(OBJSXBMC) $(GTEST_LIBS) $(LIBS) -rdynamic
692 else
693         $(SILENT_LD) $(CXX) $(CXXFLAGS) $(LDFLAGS) $(GTEST_INCLUDES) -o $@ -Wl,--whole-archive $(CHECK_LIBS) $(DYNOBJSXBMC) $(OBJSXBMC) -Wl,--no-whole-archive $(NWAOBJSXBMC) $(GTEST_LIBS) $(LIBS) -rdynamic
694 endif
695 else
696 # Give a message that the framework is not configured, but don't fail.
697 check testsuite testframework:
698         @echo "Google Test Framework not configured, skipping testsuite check."
699 endif