Merge pull request #9325 from AlwinEsch/fix-adsp-frezze
[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 DVDPCODECS_DIRS= \
13         lib \
14         lib/libdvd 
15
16 ifeq (@USE_LIBSTAGEFRIGHT@,1)
17 DVDPCODECS_DIRS += xbmc/cores/dvdplayer/DVDCodecs/Video/libstagefrightICS
18 endif
19
20 DVDPLAYER_ARCHIVES=xbmc/cores/dvdplayer/DVDPlayer.a \
21                    xbmc/cores/dvdplayer/DVDCodecs/DVDCodecs.a \
22                    xbmc/cores/dvdplayer/DVDCodecs/Audio/Audio.a \
23                    xbmc/cores/dvdplayer/DVDCodecs/Overlay/Overlay.a \
24                    xbmc/cores/dvdplayer/DVDCodecs/Video/Video.a \
25                    xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxers.a \
26                    xbmc/cores/dvdplayer/DVDInputStreams/DVDInputStreams.a \
27                    xbmc/cores/dvdplayer/DVDSubtitles/DVDSubtitles.a
28
29 DIRECTORY_ARCHIVES=$(DVDPLAYER_ARCHIVES) \
30                    xbmc/addons/addons.a \
31                    xbmc/cdrip/cdrip.a \
32                    xbmc/contrib/kissfft/kissfft.a \
33                    xbmc/cores/AudioEngine/audioengine.a \
34                    xbmc/cores/DllLoader/dllloader.a \
35                    xbmc/cores/DllLoader/exports/exports.a \
36                    xbmc/cores/DllLoader/exports/util/exports_utils.a \
37                    xbmc/cores/ExternalPlayer/ExternalPlayer.a \
38                    xbmc/cores/VideoRenderers/VideoRenderer.a \
39                    xbmc/cores/VideoRenderers/VideoShaders/VideoShaders.a \
40                    xbmc/cores/cores.a \
41                    xbmc/cores/paplayer/paplayer.a \
42                    xbmc/cores/playercorefactory/playercorefactory.a \
43                    xbmc/dbwrappers/dbwrappers.a \
44                    xbmc/dialogs/dialogs.a \
45                    xbmc/epg/epg.a \
46                    xbmc/events/events.a \
47                    xbmc/filesystem/MusicDatabaseDirectory/musicdatabasedirectory.a \
48                    xbmc/filesystem/VideoDatabaseDirectory/videodatabasedirectory.a \
49                    xbmc/filesystem/filesystem.a \
50                    xbmc/guilib/guilib.a \
51                    xbmc/input/input.a \
52                    xbmc/interfaces/builtins/builtins.a \
53                    xbmc/interfaces/generic/interfaces-generic.a \
54                    xbmc/interfaces/info/info.a \
55                    xbmc/interfaces/interfaces.a \
56                    xbmc/interfaces/json-rpc/json-rpc.a \
57                    xbmc/interfaces/legacy/legacy.a \
58                    xbmc/interfaces/python/python_binding.a \
59                    xbmc/linux/linux.a \
60                    xbmc/listproviders/listproviders.a \
61                    xbmc/main/posix/MessagePrinter.a \
62                    xbmc/media/media.a \
63                    xbmc/messaging/messaging.a \
64                    xbmc/messaging/helpers/messagingHelpers.a \
65                    xbmc/music/dialogs/musicdialogs.a \
66                    xbmc/music/infoscanner/musicscanner.a \
67                    xbmc/music/music.a \
68                    xbmc/music/tags/musictags.a \
69                    xbmc/music/windows/musicwindows.a \
70                    xbmc/network/dacp/dacp.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/jobs/video-jobs.a \
100                    xbmc/video/videosync/videosync.a \
101                    xbmc/video/video.a \
102                    xbmc/video/windows/videowindows.a \
103                    xbmc/view/view.a \
104                    xbmc/windowing/windowing.a \
105                    xbmc/windows/windows.a \
106                    xbmc/xbmc.a \
107
108 NWAOBJSXBMC=    xbmc/threads/threads.a \
109                 xbmc/commons/commons.a
110
111
112 ifeq (@USE_WEB_SERVER@,1)
113 DIRECTORY_ARCHIVES += xbmc/interfaces/legacy/wsgi/legacy-wsgi.a
114 DIRECTORY_ARCHIVES += xbmc/network/httprequesthandler/httprequesthandlers.a
115 DIRECTORY_ARCHIVES += xbmc/network/httprequesthandler/python/httprequesthandlers-python.a
116 endif
117
118 ifeq (@USE_OPENGL@,1)
119 DIRECTORY_ARCHIVES += xbmc/rendering/gl/rendering_gl.a
120 endif
121
122 ifeq (@USE_OPENGLES@,1)
123 DIRECTORY_ARCHIVES += xbmc/rendering/gles/rendering_gles.a
124 DIRECTORY_ARCHIVES += xbmc/windowing/egl/windowing_egl.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 ifeq ($(findstring osx,@ARCH@),osx)
137 DIRECTORY_ARCHIVES += xbmc/osx/osx.a
138 DIRECTORY_ARCHIVES += xbmc/network/osx/network.a
139 DIRECTORY_ARCHIVES += xbmc/network/linux/network_linux.a
140 DIRECTORY_ARCHIVES += xbmc/powermanagement/osx/powermanagement.a
141 DIRECTORY_ARCHIVES += xbmc/storage/osx/storage.a
142 DIRECTORY_ARCHIVES += xbmc/windowing/osx/windowing_osx.a
143 INSTALL_FILTER += .*repository\.pvr-android\.xbmc\.org.*
144 INSTALL_FILTER += .*repository\.pvr-ios\.xbmc\.org.*
145 INSTALL_FILTER += .*repository\.pvr-win32\.xbmc\.org.*
146 else
147 INSTALL_FILTER += .*repository\.pvr-ios\.xbmc\.org.*
148 INSTALL_FILTER += .*repository\.pvr-win32\.xbmc\.org.*
149 INSTALL_FILTER += .*repository\.pvr-osx.*\.xbmc\.org.*
150 ifeq (@USE_ANDROID@,1)
151 DIRECTORY_ARCHIVES += xbmc/input/linux/input_linux.a
152 DIRECTORY_ARCHIVES += xbmc/input/touch/input_touch.a
153 DIRECTORY_ARCHIVES += xbmc/input/touch/generic/input_touch_generic.a
154 DIRECTORY_ARCHIVES += xbmc/network/linux/network_linux.a
155 DIRECTORY_ARCHIVES += xbmc/powermanagement/android/powermanagement_android.a
156 DIRECTORY_ARCHIVES += xbmc/storage/android/storage_android.a
157 DIRECTORY_ARCHIVES += xbmc/windowing/X11/windowing_X11.a
158 else
159 DIRECTORY_ARCHIVES += xbmc/input/linux/input_linux.a
160 DIRECTORY_ARCHIVES += xbmc/input/touch/input_touch.a
161 DIRECTORY_ARCHIVES += xbmc/input/touch/generic/input_touch_generic.a
162 DIRECTORY_ARCHIVES += xbmc/network/linux/network_linux.a
163 DIRECTORY_ARCHIVES += xbmc/powermanagement/linux/powermanagement_linux.a
164 DIRECTORY_ARCHIVES += xbmc/storage/linux/storage_linux.a
165 DIRECTORY_ARCHIVES += xbmc/windowing/X11/windowing_X11.a
166 INSTALL_FILTER += .*repository\.pvr-android\.xbmc\.org.*
167 endif
168 endif
169
170 ifeq ($(findstring freebsd,@ARCH@),freebsd)
171 DIRECTORY_ARCHIVES += xbmc/freebsd/freebsd.a
172 endif
173
174 ifeq (@HAVE_XBMC_NONFREE@,1)
175 DIRECTORY_ARCHIVES += lib/UnrarXLib/UnrarXLib.a
176 endif
177
178 ifeq (@USE_ANDROID@,1)
179 DIRECTORY_ARCHIVES += xbmc/android/loader/AndroidDyload.a
180 DIRECTORY_ARCHIVES += xbmc/windowing/android/windowing_android.a
181 DIRECTORY_ARCHIVES += xbmc/android/bionic_supplement/bionic_supplement.a
182 DIRECTORY_ARCHIVES += xbmc/android/jni/jni.a
183 endif
184
185 ifeq (@USE_OMXPLAYER@,1)
186 DIRECTORY_ARCHIVES += xbmc/cores/omxplayer/omxplayer.a
187 endif
188
189 LIB_DIRS=\
190         lib/cximage-6.0 \
191         lib/libexif \
192         lib/cpluff \
193         lib/xbmc-dll-symbols
194
195 LIBADDON_DIRS=\
196         lib/addons/library.xbmc.addon \
197         lib/addons/library.kodi.adsp \
198         lib/addons/library.kodi.audioengine \
199         lib/addons/library.xbmc.codec \
200         lib/addons/library.xbmc.pvr \
201         lib/addons/library.kodi.guilib \
202
203 CONFLUENCE_MEDIA=addons/skin.confluence/media
204 SKIN_DIRS=$(CONFLUENCE_MEDIA)
205
206 ifeq (@USE_TOUCH_SKIN@,1)
207 TOUCH_SKIN_MEDIA=addons/skin.re-touched/media
208 SKIN_DIRS+=$(TOUCH_SKIN_MEDIA)
209 endif
210
211 LIBS=@LIBS@
212 CFLAGS=@CFLAGS@
213 CXXFLAGS=@CXXFLAGS@
214 LDFLAGS=@LDFLAGS@
215 INCLUDES=$(sort @INCLUDES@)
216
217 CLEAN_FILES=@APP_NAME_LC@.bin @APP_NAME_LC@-xrandr lib@APP_NAME_LC@.so
218
219 DISTCLEAN_FILES=config.h config.log config.status tools/Linux/@APP_NAME_LC@.sh \
220         tools/Linux/@APP_NAME_LC@-standalone.sh autom4te.cache config.h.in~ \
221         system/libcpluff-@ARCH@.so
222
223 ifeq (@USE_LIBXBMC@,1)
224 FINAL_TARGETS+=lib@APP_NAME_LC@.so
225 ifeq (@USE_ANDROID@,1)
226 FINAL_TARGETS+=skins
227 endif
228 else
229 FINAL_TARGETS=@APP_NAME_LC@.bin skins @APP_NAME_LC@-xrandr
230 endif
231 FINAL_TARGETS+=Makefile externals
232
233 GTEST_DIR = lib/gtest
234 GTEST_INCLUDES = -I$(GTEST_DIR)/include
235 GTEST_LIBS = $(GTEST_DIR)/lib/.libs/libgtest.a
236
237 CHECK_DIRS = xbmc/addons/test \
238              xbmc/filesystem/test \
239              xbmc/music/tags/test \
240              xbmc/network/test \
241              xbmc/utils/test \
242              xbmc/video/test \
243              xbmc/threads/test \
244              xbmc/interfaces/python/test \
245              xbmc/cores/AudioEngine/Sinks/test \
246              xbmc/test
247 CHECK_LIBS = xbmc/addons/test/addonsTest.a \
248              xbmc/filesystem/test/filesystemTest.a \
249              xbmc/music/tags/test/tagsTest.a \
250              xbmc/network/test/networkTest.a \
251              xbmc/utils/test/utilsTest.a \
252              xbmc/video/test/videoTest.a \
253              xbmc/threads/test/threadTest.a \
254              xbmc/interfaces/python/test/pythonSwigTest.a \
255              xbmc/cores/AudioEngine/Sinks/test/AESinkTest.a \
256              xbmc/test/xbmc-test.a
257
258 ifeq (@USE_WAYLAND@,1)
259 CHECK_LIBS += xbmc/windowing/tests/wayland/test_wayland.a
260
261 ifeq (@USE_WAYLAND_TEST_EXTENSION@,1)
262 WAYLAND_TEST_MODULE = xbmc/windowing/tests/wayland/xbmc-wayland-test-extension.so
263 $(WAYLAND_TEST_MODULE): force
264         $(MAKE) -C $(@D) $(@F)
265 CHECK_EXTENSIONS = $(WAYLAND_TEST_MODULE)
266 CHECK_LIBADD=@WAYLAND_TEST_LIBS@
267 endif
268 endif
269
270 ifeq (@USE_SSE4@,1)
271 LIBSSE4+=sse4
272 sse4 : force
273         $(MAKE) -C xbmc/linux/sse4
274 endif
275
276 CHECK_PROGRAMS = @APP_NAME_LC@-test
277
278 CLEAN_FILES += $(CHECK_PROGRAMS) $(CHECK_EXTENSIONS)
279
280 all : $(FINAL_TARGETS)
281         @echo '-----------------------'
282         @echo '@APP_NAME@ built successfully'
283         @echo '-----------------------'
284
285 include Makefile.include
286
287 .PHONY : dllloader exports eventclients \
288         dvdpcodecs dvdpextcodecs imagelib codecs externals force skins libaddon check \
289         testframework testsuite
290
291 # hack targets to keep build system up to date
292 Makefile : config.status $(addsuffix .in, $(AUTOGENERATED_MAKEFILES))
293         @echo "Regenerating Makefiles..."
294         @./config.status &> /dev/null
295         @echo "done"
296
297 config.status: configure
298
299 # skin textures
300 ifeq (@USE_TEXTUREPACKER@,1)
301 skins: @TEXTUREPACKER@
302          $(MAKE) -C $(CONFLUENCE_MEDIA)
303 ifeq (@USE_TOUCH_SKIN@,1)
304          $(MAKE) -C $(TOUCH_SKIN_MEDIA)
305 endif
306 else
307 skins:
308 endif
309
310 # Setup some dependencies for subdir makes
311 xbmc/cores/paplayer/paplayer.a:
312 $(DVDPLAYER_ARCHIVES)         : dvdpcodecs
313
314 lib/cpluff/libcpluff/.libs/libcpluff.a: force
315         $(MAKE) -C lib/cpluff/libcpluff
316 system/libcpluff-@ARCH@.so: lib/cpluff/libcpluff/.libs/libcpluff.a exports
317 ifeq ($(findstring osx,@ARCH@), osx)
318   ifeq (@ARCH@, arm-osx)
319         $(CXX) $(LDFLAGS) -all_load -bundle -flat_namespace -undefined dynamic_lookup -read_only_relocs suppress -o $@ $<
320   else
321         $(CXX) $(LDFLAGS) -all_load -bundle -flat_namespace -undefined dynamic_lookup -lexpat $(BUNDLE1_O) -o $@ $<
322   endif
323 else
324         $(CXX) $(LDFLAGS) -shared -o $@ -Wl,--whole-archive $< \
325                 -Wl,--no-whole-archive  \
326                 `cat xbmc/cores/DllLoader/exports/wrapper.def` xbmc/cores/DllLoader/exports/wrapper.o -lexpat
327 endif
328
329 exports: xbmc/cores/DllLoader/exports/exports.a xbmc/cores/DllLoader/exports/util/exports_utils.a
330         $(MAKE) -C xbmc/cores/DllLoader/exports wrapper.def
331 dllloader: exports xbmc/cores/DllLoader/dllloader.a
332
333 libaddon: exports
334         $(MAKE) -C lib/addons/library.xbmc.addon
335         $(MAKE) -C lib/addons/library.kodi.adsp
336         $(MAKE) -C lib/addons/library.kodi.audioengine
337         $(MAKE) -C lib/addons/library.xbmc.codec
338         $(MAKE) -C lib/addons/library.kodi.guilib
339         $(MAKE) -C lib/addons/library.xbmc.pvr
340 dvdpcodecs: dllloader
341         $(MAKE) -C lib/libdvd
342
343 ifeq (@USE_LIBSTAGEFRIGHT@,1)
344 dvdpextcodecs: lib@APP_NAME_LC@.so
345         $(MAKE) -C xbmc/cores/dvdplayer/DVDCodecs/Video/libstagefrightICS
346 else
347 dvdpextcodecs:
348 endif
349
350 eventclients:
351 ifeq ($(findstring osx,@ARCH@), osx)
352 ifneq ($(findstring arm,@ARCH@), arm)
353         $(MAKE) -C tools/EventClients/Clients/OSXRemote
354 endif
355 else
356         $(MAKE) -C tools/EventClients
357 endif
358 libexif: dllloader
359         $(MAKE) -C lib/libexif
360
361 imagelib: dllloader
362         $(MAKE) -C lib/cximage-6.0
363
364 codecs: dvdpcodecs dvdpextcodecs
365
366 libs: $(LIBSSE4) imagelib libexif system/libcpluff-@ARCH@.so
367
368 externals: codecs libs libaddon
369
370 xcode_depends: \
371         codecs libs eventclients skins libaddon
372
373 DYNOBJSXBMC= \
374         xbmc/linux/linux.a \
375         xbmc/network/network.a \
376         xbmc/video/windows/videowindows.a \
377         xbmc/utils/utils.a \
378         xbmc/cores/DllLoader/exports/util/exports_utils.a \
379         xbmc/cores/DllLoader/exports/exports.a \
380         xbmc/settings/settings.a \
381         xbmc/video/video.a \
382         xbmc/pvr/addons/pvraddons.a \
383         xbmc/pvr/windows/pvrwindows.a \
384         xbmc/guilib/guilib.a # must be dynamic to avoid linker errors
385
386 ifeq ($(findstring freebsd,@ARCH@),freebsd)
387 DYNOBJSXBMC+= xbmc/freebsd/freebsd.a
388 endif
389
390 ifeq (@USE_STATIC_FFMPEG@,1)
391 FFMPEGOBJS = @FFMPEG_LIBDIR@/libavcodec.a \
392              @FFMPEG_LIBDIR@/libavfilter.a \
393              @FFMPEG_LIBDIR@/libswresample.a \
394              @FFMPEG_LIBDIR@/libavformat.a \
395              @FFMPEG_LIBDIR@/libavutil.a \
396              @FFMPEG_LIBDIR@/libpostproc.a \
397              @FFMPEG_LIBDIR@/libswscale.a
398 DYNOBJSXBMC+= $(FFMPEGOBJS)
399 LIBS+= @GNUTLS_ALL_LIBS@ @VORBISENC_ALL_LIBS@ @DCADEC_ALL_LIBS@
400
401 $(FFMPEGOBJS): dvdpcodecs
402 endif
403
404 ifeq (@USE_ANDROID@,1)
405 MAINOBJS+=xbmc/android/activity/activity.a
406 else
407 MAINOBJS+=xbmc/main/main.a
408 endif # USE_ANDROID
409
410
411 OBJSXBMC =$(DIRECTORY_ARCHIVES)
412 OBJSXBMC:=$(filter-out $(DYNOBJSXBMC), $(OBJSXBMC))
413
414 BIN_DIRS = $(dir $(DIRECTORY_ARCHIVES)) $(dir $(NWAOBJSXBMC)) $(dir $(MAINOBJS))
415
416 DIRS= $(BIN_DIRS) $(EC_DIRS) $(DVDPCODECS_DIRS) \
417         $(LIB_DIRS) $(LIBADDON_DIRS) $(SKIN_DIRS) xbmc/main
418
419 $(NWAOBJSXBMC) $(DIRECTORY_ARCHIVES) $(MAINOBJS): force
420         @$(MAKE) $(if $(V),,-s) -C $(@D)
421
422 # Binary Addon bindings
423 include xbmc/addons/addon-bindings.mk
424
425 lib@APP_NAME_LC@.so: $(OBJSXBMC) $(DYNOBJSXBMC) $(NWAOBJSXBMC) $(MAINOBJS)
426 ifeq ($(findstring osx,@ARCH@), osx)
427         $(SILENT_LD) $(CXX) $(LDFLAGS) -bundle -o $@ $(MAINOBJS) -Wl,-all_load,-ObjC $(MAINOBJS) $(DYNOBJSXBMC) $(NWAOBJSXBMC) $(OBJSXBMC) $(LIBS) -read_only_relocs suppress
428 else
429         $(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) -Wl,-Bsymbolic
430 endif
431
432 @APP_NAME_LC@.bin: $(OBJSXBMC) $(DYNOBJSXBMC) $(NWAOBJSXBMC) $(MAINOBJS)
433
434 ifeq ($(findstring osx,@ARCH@), osx)
435         $(SILENT_LD) $(CXX) $(LDFLAGS) -o @APP_NAME_LC@.bin $(MAINOBJS) -Wl,-all_load,-ObjC $(MAINOBJS) $(DYNOBJSXBMC) $(NWAOBJSXBMC) $(OBJSXBMC) $(LIBS) -rdynamic
436 else
437         $(SILENT_LD) $(CXX) $(CXXFLAGS) $(LDFLAGS) -o @APP_NAME_LC@.bin $(MAINOBJS) -Wl,--start-group $(MAINOBJS) $(DYNOBJSXBMC) $(OBJSXBMC) -Wl,--end-group $(NWAOBJSXBMC) $(LIBS) -rdynamic
438 endif
439
440 @APP_NAME_LC@-xrandr: xbmc-xrandr.c
441 ifneq (1,@USE_X11@)
442         # xbmc-xrandr.c gets picked up by the default make rules
443         @echo "excluding @APP_NAME_LC@-xrandr"
444 else
445         $(SILENT_LD) $(CC) $(CFLAGS) $(LDFLAGS) -o @APP_NAME_LC@-xrandr xbmc-xrandr.c -lXrandr -lX11 -lm
446 endif
447
448
449 install-bin: @APP_NAME_LC@.bin # developement convenience target
450         sudo install -d $(DESTDIR)$(libdir)
451         sudo install @APP_NAME_LC@.bin $(DESTDIR)$(libdir)/@APP_NAME_LC@
452
453 ifeq ($(findstring osx,@ARCH@), osx)
454         # TODO: add osx install
455 else
456 install: install-binaries install-arch install-datas
457
458 apk obb apk-unsigned apk-obb apk-obb-unsigned apk-noobb: install
459         make -C tools/android/packaging $@
460
461 apk-clean apk-sign:
462         make -C tools/android/packaging $@
463
464 install-binaries: install-scripts
465         @echo "Copying @APP_NAME_LC@ binary to $(DESTDIR)$(libdir)/@APP_NAME_LC@/"
466         @install -d $(DESTDIR)$(libdir)/@APP_NAME_LC@
467         @cd $(DESTDIR)$(libdir); [ -L xbmc ] || [ -d xbmc ] || ln -s @APP_NAME_LC@ xbmc
468 ifeq (1,@USE_X11@)
469         @install @APP_NAME_LC@-xrandr $(DESTDIR)$(libdir)/@APP_NAME_LC@/@APP_NAME_LC@-xrandr
470 endif
471 ifeq (@USE_LIBXBMC@,1)
472         @install lib@APP_NAME_LC@.so $(DESTDIR)$(libdir)/@APP_NAME_LC@/lib@APP_NAME_LC@.so
473 else
474         @install @APP_NAME_LC@.bin $(DESTDIR)$(libdir)/@APP_NAME_LC@/@APP_NAME_LC@.bin
475         @echo "You can run @APP_NAME_LC@ with the command '@APP_NAME_LC@'"
476 endif
477 endif
478
479 install-arch:
480         @# Arch dependent files
481 ifeq ($(findstring freebsd,@ARCH@), freebsd)
482         @find -E system addons -type f -not -iregex ".*\.git.*" \
483                 -iregex ".*@ARCH@.*|.*\.vis|.*\.xbs" \
484                 -exec sh -c "install -d \"$(DESTDIR)$(libdir)/@APP_NAME_LC@/\`dirname '{}'\`\"" \; \
485                 -and \
486                 -exec install "{}" $(DESTDIR)$(libdir)/@APP_NAME_LC@/"{}" \; \
487                 -exec printf " -- %-75.75s\r" "{}" \;
488 else
489 ifeq ($(findstring Darwin,$(shell uname -s)),Darwin)
490         @find -E system addons -type f -not -iregex ".*\.git.*" \
491                 -iregex ".*@ARCH@.*|.*\.vis|.*\.xbs" \
492                 -exec sh -c "install -d \"$(DESTDIR)$(libdir)/@APP_NAME_LC@/\`dirname '{}'\`\"" \; \
493                 -and \
494                 -exec install "{}" $(DESTDIR)$(libdir)/xbmc/"{}" \; \
495                 -exec printf " -- %-75.75s\r" "{}" \;
496 else
497         @find system addons -regextype posix-extended -type f -not -iregex ".*\.git.*" -iregex ".*\.so|.*\.so\.[0-9].*|.*\.vis|.*\.xbs" -exec install -D "{}" $(DESTDIR)$(libdir)/@APP_NAME_LC@/"{}" \; -printf " -- %-75.75f\r"
498         @find -L addons -regextype posix-extended -type f -not -iregex ".*\.git.*" -iregex ".*\.so|.*\.so\.[0-9].*" -exec cp -d "{}" $(DESTDIR)$(libdir)/@APP_NAME_LC@/"{}" \; -printf " -- %-75.75f\r"
499 endif
500 endif
501
502 install-scripts:
503         @install -d $(DESTDIR)$(bindir)
504         @install tools/Linux/@APP_NAME_LC@.sh $(DESTDIR)$(bindir)/@APP_NAME_LC@
505         @cd $(DESTDIR)$(bindir); [ -L xbmc ] || [ -f xbmc ] || ln -s @APP_NAME_LC@ xbmc
506         @install tools/Linux/@APP_NAME_LC@-standalone.sh $(DESTDIR)$(bindir)/@APP_NAME_LC@-standalone
507         @cd $(DESTDIR)$(bindir); [ -L xbmc-standalone ] || [ -f xbmc-standalone ] ||  ln -s @APP_NAME_LC@-standalone xbmc-standalone
508         @install -d $(DESTDIR)$(datarootdir)/@APP_NAME_LC@
509         @cd $(DESTDIR)$(datarootdir); [ -L xbmc ] || [ -d xbmc ] || ln -s @APP_NAME_LC@ xbmc
510         @install -d $(DESTDIR)$(datarootdir)/xsessions
511         @install -m 0644 tools/Linux/@APP_NAME_LC@-xsession.desktop $(DESTDIR)$(datarootdir)/xsessions/@APP_NAME_LC@.desktop
512         @cd $(DESTDIR)$(datarootdir)/xsessions; [ -L xbmc.desktop ] || [ -f xbmc.desktop ] || ln -s @APP_NAME_LC@.desktop xbmc.desktop
513
514 install-datas: install-scripts
515         @echo "Copying support and legal files..."
516         @install -d $(DESTDIR)$(docdir)
517         @for FILE in `ls LICENSE.GPL *.txt`; do \
518                 install -m 0644 "$$FILE" "$(DESTDIR)$(docdir)/$$FILE"; done
519         @install -m 0644 "docs/README.linux" "$(DESTDIR)$(docdir)/README.linux"
520         @echo "Done!"
521         @echo "Copying system files to $(DESTDIR)$(datarootdir)/@APP_NAME_LC@"
522         @install -d $(DESTDIR)$(datarootdir)/@APP_NAME_LC@
523         @# Arch independent files
524 ifeq ($(findstring bsd,@ARCH@), bsd)
525         @find -E addons media userdata system -type f \
526                 -not -iregex ".*-@ARCH@.*|.*\.vis|.*\.xbs|.*\.git.*|.*\.so|.*\.so\.[0-9].*|.*\.dll|$(subst ${space},|,$(INSTALL_FILTER))" \
527                 -exec sh -c "install -d \"$(DESTDIR)$(datarootdir)/@APP_NAME_LC@/\`dirname '{}'\`\"" \; \
528                 -and \
529                 -exec install -m 0644 "{}" $(DESTDIR)$(datarootdir)/@APP_NAME_LC@/"{}" \; \
530                 -exec printf " -- %-75.75s\r" "{}" \;
531 else
532 ifeq ($(findstring Darwin,$(shell uname -s)),Darwin)
533         @find -E addons media userdata system -type f \
534                 -not -iregex ".*-@ARCH@.*|.*\.vis|.*\.xbs|.*\.git.*|.*\.so|.*\.so\.[0-9].*|.*\.dll|$(subst ${space},|,$(INSTALL_FILTER))" \
535                 -exec sh -c "install -d \"$(DESTDIR)$(datarootdir)/xbmc/\`dirname '{}'\`\"" \; \
536                 -and \
537                 -exec install -m 0644 "{}" $(DESTDIR)$(datarootdir)/xbmc/"{}" \; \
538                 -exec printf " -- %-75.75s\r" "{}" \;
539 else
540         @find addons media userdata system -regextype posix-extended -type f -not -iregex ".*-@ARCH@.*|.*\.vis|.*\.xbs|.*\.git.*|.*\.so|.*\.so\.[0-9].*|.*\.dll|$(subst ${space},|,$(INSTALL_FILTER))" -exec install -D -m 0644 "{}" $(DESTDIR)$(datarootdir)/@APP_NAME_LC@/"{}" \; -printf " -- %-75.75f\r"
541 endif
542 endif
543         @# Icons and links
544         @install -d $(DESTDIR)$(datarootdir)/applications
545         @install -m 0644 tools/Linux/@APP_NAME_LC@.desktop $(DESTDIR)$(datarootdir)/applications/@APP_NAME_LC@.desktop
546
547         @install -d $(DESTDIR)$(datadir)/icons/hicolor/16x16/apps
548         @install -m 0644 tools/Linux/packaging/media/icon16x16.png $(DESTDIR)$(datadir)/icons/hicolor/16x16/apps/@APP_NAME_LC@.png
549         @install -d $(DESTDIR)$(datadir)/icons/hicolor/22x22/apps
550         @install -m 0644 tools/Linux/packaging/media/icon22x22.png $(DESTDIR)$(datadir)/icons/hicolor/22x22/apps/@APP_NAME_LC@.png
551         @install -d $(DESTDIR)$(datadir)/icons/hicolor/24x24/apps
552         @install -m 0644 tools/Linux/packaging/media/icon24x24.png $(DESTDIR)$(datadir)/icons/hicolor/24x24/apps/@APP_NAME_LC@.png
553         @install -d $(DESTDIR)$(datadir)/icons/hicolor/32x32/apps
554         @install -m 0644 tools/Linux/packaging/media/icon32x32.png $(DESTDIR)$(datadir)/icons/hicolor/32x32/apps/@APP_NAME_LC@.png
555         @install -d $(DESTDIR)$(datadir)/icons/hicolor/48x48/apps
556         @install -m 0644 tools/Linux/packaging/media/icon48x48.png $(DESTDIR)$(datadir)/icons/hicolor/48x48/apps/@APP_NAME_LC@.png
557         @install -d $(DESTDIR)$(datadir)/icons/hicolor/64x64/apps
558         @install -m 0644 tools/Linux/packaging/media/icon64x64.png $(DESTDIR)$(datadir)/icons/hicolor/64x64/apps/@APP_NAME_LC@.png
559         @install -d $(DESTDIR)$(datadir)/icons/hicolor/128x128/apps
560         @install -m 0644 tools/Linux/packaging/media/icon128x128.png $(DESTDIR)$(datadir)/icons/hicolor/128x128/apps/@APP_NAME_LC@.png
561         @install -d $(DESTDIR)$(datadir)/icons/hicolor/256x256/apps
562         @install -m 0644 tools/Linux/packaging/media/icon256x256.png $(DESTDIR)$(datadir)/icons/hicolor/256x256/apps/@APP_NAME_LC@.png
563
564         @test -z "$(DESTDIR)" && gtk-update-icon-cache -f -q -t $(datadir)/icons/hicolor || :
565
566         @echo "Copying bindings to $(DESTDIR)$(includedir)/@APP_NAME_LC@"
567         @install -d $(DESTDIR)$(includedir)/@APP_NAME_LC@
568         @for f in $(BINDINGS); do \
569           install -m 0644 $$f $(DESTDIR)$(includedir)/@APP_NAME_LC@ ; \
570         done
571         @for f in project/cmake/*.cmake; do \
572           install -m 0644 $$f $(DESTDIR)$(libdir)/@APP_NAME_LC@; \
573         done
574         @for f in project/cmake/scripts/common/*.cmake; do \
575           install -m 0644 $$f $(DESTDIR)$(libdir)/@APP_NAME_LC@; \
576         done
577         @cd $(DESTDIR)$(includedir); [ -L xbmc ] || [ -d xbmc ] || ln -s @APP_NAME_LC@ xbmc
578
579 uninstall:
580         @echo "Removing @APP_NAME@..."
581         @rm -rf $(DESTDIR)$(libdir)/@APP_NAME_LC@
582         @rm -rf $(DESTDIR)$(datarootdir)/@APP_NAME_LC@ $(DESTDIR)$(bindir)/@APP_NAME_LC@
583         @rm -rf $(DESTDIR)$(bindir)/@APP_NAME_LC@-standalone
584         @rm -rf $(DESTDIR)$(datarootdir)/xsessions/@APP_NAME_LC@.desktop
585         @rm -rf $(libdir)/lib@APP_NAME_LC@_*
586         @rm -rf $(prefix)/include/@APP_NAME_LC@
587         @echo "Done!"
588
589 clean-@APP_NAME_LC@.bin:
590         rm -f @APP_NAME_LC@.bin
591         for d in $(BIN_DIRS); do if test -f $$d/Makefile; then $(MAKE) -C $$d clean; fi; done
592 clean-eventclients:
593         for d in $(EC_DIRS); do if test -f $$d/Makefile; then $(MAKE) -C $$d clean; fi; done
594 clean-dvdpcodecs:
595         for d in $(DVDPCODECS_DIRS); do if test -f $$d/Makefile; then $(MAKE) -C $$d clean; fi; done
596 clean-libs:
597         for d in $(LIB_DIRS); do if test -f $$d/Makefile; then $(MAKE) -C $$d clean; fi; done
598 clean-libaddons:
599         for d in $(LIBADDON_DIRS); do if test -f $$d/Makefile; then $(MAKE) -C $$d clean; fi; done
600
601 clean-codecs: clean-dvdpcodecs
602
603 clean-externals: clean-codecs clean-eventclients clean-libs \
604         clean-libaddons
605
606 ifeq (1,@GTEST_CONFIGURED@)
607 check: testsuite
608         for check_program in $(CHECK_PROGRAMS); do $(CURDIR)/$$check_program; done
609
610 testsuite: $(CHECK_EXTENSIONS) $(CHECK_PROGRAMS)
611
612 testframework: $(GTEST_LIBS)
613
614 $(GTEST_LIBS): $(GTEST_DIR)/Makefile
615
616 $(GTEST_DIR)/Makefile: force
617         $(MAKE) CXXFLAGS="$(CXXFLAGS) -DGTEST_USE_OWN_TR1_TUPLE=1" -C $(GTEST_DIR)
618
619 $(CHECK_LIBS): force
620         @$(MAKE) CXXFLAGS="$(CXXFLAGS) -DGTEST_USE_OWN_TR1_TUPLE=1" $(if $(V),,-s) -C $(@D)
621
622 @APP_NAME_LC@-test: $(CHECK_LIBS) $(OBJSXBMC) $(DYNOBJSXBMC) $(NWAOBJSXBMC) $(GTEST_LIBS)
623 ifeq ($(findstring osx,@ARCH@), osx)
624         $(SILENT_LD) $(CXX) $(CXXFLAGS) $(LDFLAGS) $(GTEST_INCLUDES) -o $@ -Wl,-all_load,-ObjC $(DYNOBJSXBMC) $(NWAOBJSXBMC) $(OBJSXBMC) $(GTEST_LIBS) $(CHECK_LIBS) $(LIBS) $(CHECK_LIBADD) -rdynamic
625 else
626         $(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
627 endif
628 else
629 # Give a message that the framework is not configured, but don't fail.
630 check testsuite testframework:
631         @echo "Google Test Framework not configured, skipping testsuite check."
632 endif