]> git.sesse.net Git - vlc/blob - Makefile.am
08236214487cf4cbcb599535476526e52b1382dd
[vlc] / Makefile.am
1 ###############################################################################
2 # Automake targets and declarations
3 ###############################################################################
4
5 # SUBDIRS stores the directories where a "make" is required when building
6 # something. DIST_SUBDIRS stores the directories where nothing is built but
7 # which have makefiles with distribution information.
8 #  - src (libvlc) is nedeed by modules, mozilla and bindings
9 #  - libs/* are needed by modules
10 BASE_SUBDIRS = po compat src bin modules share doc test
11 EXTRA_SUBDIRS = m4 extras/package/ipkg \
12         libs/loader libs/srtp libs/unzip \
13         projects/mozilla projects/activex
14 DIST_SUBDIRS = $(BASE_SUBDIRS) $(EXTRA_SUBDIRS)
15
16 SUBDIRS = po compat src
17 if LOADER
18 SUBDIRS += libs/loader
19 endif
20 if HAVE_GCRYPT
21 SUBDIRS += libs/srtp
22 endif
23 if HAVE_ZLIB
24 if !HAVE_MINIZIP
25 SUBDIRS += libs/unzip
26 endif
27 endif
28 if BUILD_VLC
29 SUBDIRS += bin
30 endif
31 SUBDIRS += modules share doc test
32 if BUILD_MOZILLA
33 SUBDIRS += projects/mozilla
34 endif
35 if BUILD_ACTIVEX
36 SUBDIRS += projects/activex
37 endif
38
39 EXTRA_DIST = \
40         HACKING \
41         INSTALL.win32 \
42         INSTALL.wince \
43         extras/package/win32/vlc.exe.manifest \
44         extras/package/win32/libvlc.dll.manifest \
45         extras/package/macosx/README.MacOSX.rtf \
46         vlc-config.in.in \
47         extras/package/rpm/vlc.fedora.spec \
48         extras/package/rpm/vlc.altlinux.spec \
49         extras/package/win32/vlc.win32.nsi.in \
50         extras/package/win32/spad.nsi.in \
51         extras/package/win32/languages/declaration.nsh \
52         extras/package/win32/languages/english.nsh \
53         extras/package/win32/languages/french.nsh
54
55 dist_noinst_SCRIPTS = bootstrap toolbox
56 nodist_noinst_SCRIPTS = compile
57
58 BUILT_SOURCES_distclean = vlc-config extras/package/win32/vlc.win32.nsi extras/package/win32/spad.nsi
59 if HAVE_DARWIN
60 BUILT_SOURCES_clean = macosx-sdk
61 else
62 BUILT_SOURCES_clean =
63 endif
64
65 BUILT_SOURCES = $(BUILT_SOURCES_distclean) $(BUILT_SOURCES_clean)
66
67 SUFFIXES = 
68
69 DISTCHECK_CONFIGURE_FLAGS = \
70         --enable-fast-install \
71         --disable-dbus \
72         --disable-dvd --disable-mad --disable-libmpeg2 \
73         --disable-ffmpeg --disable-faad --disable-skins2 \
74         --disable-live555 \
75         --disable-fribidi --disable-glx
76
77 ACLOCAL_AMFLAGS = -I m4
78 AUTOMAKE_OPTIONS = \
79         1.9 \
80         -Wall \
81         check-news \
82         dist-bzip2 \
83         no-dist-gzip
84 #       std-options
85
86 ChangeLog: Makefile.am
87         rm -f -- "$@"
88         cd doc && $(MAKE) $(AM_MAKEFLAGS) changelogs
89         ln -sf doc/ChangeLog-2009 "$@"
90
91 ###############################################################################
92 # MacOS X project
93 ###############################################################################
94
95 EXTRA_DIST += \
96         extras/package/macosx/Resources/English.lproj/MainMenu.nib/designable.nib \
97         extras/package/macosx/Resources/English.lproj/MainMenu.nib/keyedobjects.nib \
98         extras/package/macosx/Resources/English.lproj/MediaInfo.nib/designable.nib \
99         extras/package/macosx/Resources/English.lproj/MediaInfo.nib/keyedobjects.nib \
100         extras/package/macosx/Resources/English.lproj/About.nib/designable.nib \
101         extras/package/macosx/Resources/English.lproj/About.nib/keyedobjects.nib \
102         extras/package/macosx/Resources/English.lproj/Open.nib/designable.nib \
103         extras/package/macosx/Resources/English.lproj/Open.nib/keyedobjects.nib \
104         extras/package/macosx/Resources/English.lproj/Preferences.nib/designable.nib \
105         extras/package/macosx/Resources/English.lproj/Preferences.nib/keyedobjects.nib \
106         extras/package/macosx/Resources/English.lproj/Wizard.nib/designable.nib \
107         extras/package/macosx/Resources/English.lproj/Wizard.nib/keyedobjects.nib \
108         extras/package/macosx/Resources/English.lproj/Bookmarks.nib/designable.nib \
109         extras/package/macosx/Resources/English.lproj/Bookmarks.nib/keyedobjects.nib \
110         extras/package/macosx/Resources/English.lproj/Extended.nib/designable.nib \
111         extras/package/macosx/Resources/English.lproj/Extended.nib/keyedobjects.nib \
112         extras/package/macosx/Resources/English.lproj/CoreDialogs.nib/designable.nib \
113         extras/package/macosx/Resources/English.lproj/CoreDialogs.nib/keyedobjects.nib \
114         extras/package/macosx/Resources/English.lproj/ErrorPanel.nib/designable.nib \
115         extras/package/macosx/Resources/English.lproj/ErrorPanel.nib/keyedobjects.nib \
116         extras/package/macosx/Resources/English.lproj/InfoPlist.strings.in \
117         extras/package/macosx/Resources/dsa_pub.pem \
118         extras/package/macosx/Resources/aiff.icns \
119         extras/package/macosx/Resources/audio.icns \
120         extras/package/macosx/Resources/avi.icns \
121         extras/package/macosx/Resources/flv.icns \
122         extras/package/macosx/Resources/generic.icns \
123         extras/package/macosx/Resources/m4a.icns \
124         extras/package/macosx/Resources/m4v.icns \
125         extras/package/macosx/Resources/mkv.icns \
126         extras/package/macosx/Resources/mov.icns \
127         extras/package/macosx/Resources/movie.icns \
128         extras/package/macosx/Resources/mp3.icns \
129         extras/package/macosx/Resources/mpeg.icns \
130         extras/package/macosx/Resources/ogg.icns \
131         extras/package/macosx/Resources/playlist.icns \
132         extras/package/macosx/Resources/rm.icns \
133         extras/package/macosx/Resources/subtitle.icns \
134         extras/package/macosx/Resources/vob.icns \
135         extras/package/macosx/Resources/wav.icns \
136         extras/package/macosx/Resources/vlc.icns \
137         extras/package/macosx/Resources/wma.icns \
138         extras/package/macosx/Resources/wmv.icns \
139         extras/package/macosx/Resources/pause.png \
140         extras/package/macosx/Resources/pause_blue.png \
141         extras/package/macosx/Resources/play.png \
142         extras/package/macosx/Resources/play_blue.png \
143         extras/package/macosx/Resources/stop.png \
144         extras/package/macosx/Resources/stop_blue.png \
145         extras/package/macosx/Resources/display_left.png \
146         extras/package/macosx/Resources/display_middle.png \
147         extras/package/macosx/Resources/display_right.png \
148         extras/package/macosx/Resources/display_slider.png \
149         extras/package/macosx/Resources/display_track.png \
150         extras/package/macosx/Resources/equalizerdrawer_active.png \
151         extras/package/macosx/Resources/equalizerdrawer_blue.png \
152         extras/package/macosx/Resources/fullscreen_active.png \
153         extras/package/macosx/Resources/fullscreen_blue.png \
154         extras/package/macosx/Resources/next_active.png \
155         extras/package/macosx/Resources/next_blue.png \
156         extras/package/macosx/Resources/playlistdrawer_active.png \
157         extras/package/macosx/Resources/playlistdrawer_blue.png \
158         extras/package/macosx/Resources/previous_active.png \
159         extras/package/macosx/Resources/previous_blue.png \
160         extras/package/macosx/Resources/skip_forward_active.png \
161         extras/package/macosx/Resources/skip_forward_blue.png \
162         extras/package/macosx/Resources/skip_previous_active.png \
163         extras/package/macosx/Resources/skip_previous_blue.png \
164         extras/package/macosx/Resources/volume_high.png \
165         extras/package/macosx/Resources/volume_low.png \
166         extras/package/macosx/Resources/volumeslider_blue.png \
167         extras/package/macosx/Resources/volumeslider_normal.png \
168         extras/package/macosx/Resources/volumetrack.png \
169         extras/package/macosx/Resources/about_bg.png \
170         extras/package/macosx/Resources/skip_forward_active_embedded.png \
171         extras/package/macosx/Resources/play_embedded.png \
172         extras/package/macosx/Resources/pause_embedded.png \
173         extras/package/macosx/Resources/skip_previous_active_embedded.png \
174         extras/package/macosx/Resources/pause_embedded_blue.png \
175         extras/package/macosx/Resources/play_embedded_blue.png \
176         extras/package/macosx/Resources/skip_forward_embedded_blue.png \
177         extras/package/macosx/Resources/skip_previous_embedded_blue.png \
178         extras/package/macosx/Resources/vlc.scriptSuite \
179         extras/package/macosx/Resources/vlc.scriptTerminology \
180         extras/package/macosx/Resources/README \
181         extras/package/macosx/Resources/add_embedded.png \
182         extras/package/macosx/Resources/add_embedded_blue.png \
183         extras/package/macosx/Resources/repeat_embedded.png \
184         extras/package/macosx/Resources/repeat_embedded_blue.png \
185         extras/package/macosx/Resources/repeat_single_embedded_blue.png \
186         extras/package/macosx/Resources/shuffle_embedded.png \
187         extras/package/macosx/Resources/shuffle_embedded_blue.png \
188         extras/package/macosx/Resources/fs_volume_slider_knob_highlight.png \
189         extras/package/macosx/Resources/fs_volume_slider_knob.png \
190         extras/package/macosx/Resources/fs_volume_slider_bar.png \
191         extras/package/macosx/Resources/fs_volume_mute_highlight.png \
192         extras/package/macosx/Resources/fs_volume_mute.png \
193         extras/package/macosx/Resources/fs_volume_max_highlight.png \
194         extras/package/macosx/Resources/fs_volume_max.png \
195         extras/package/macosx/Resources/fs_time_slider_knob_highlight.png \
196         extras/package/macosx/Resources/fs_time_slider_knob.png \
197         extras/package/macosx/Resources/fs_time_slider.png \
198         extras/package/macosx/Resources/fs_stop_highlight.png \
199         extras/package/macosx/Resources/fs_stop.png \
200         extras/package/macosx/Resources/fs_skip_previous_highlight.png \
201         extras/package/macosx/Resources/fs_skip_previous.png \
202         extras/package/macosx/Resources/fs_skip_next_highlight.png \
203         extras/package/macosx/Resources/fs_skip_next.png \
204         extras/package/macosx/Resources/fs_rewind_highlight.png \
205         extras/package/macosx/Resources/fs_rewind.png \
206         extras/package/macosx/Resources/fs_play_highlight.png \
207         extras/package/macosx/Resources/fs_play.png \
208         extras/package/macosx/Resources/fs_pause_highlight.png \
209         extras/package/macosx/Resources/fs_pause.png \
210         extras/package/macosx/Resources/fs_forward_highlight.png \
211         extras/package/macosx/Resources/fs_forward.png \
212         extras/package/macosx/Resources/fs_exit_fullscreen_highlight.png \
213         extras/package/macosx/Resources/fs_exit_fullscreen.png \
214         extras/package/macosx/Resources/fs_background.png \
215         extras/package/macosx/Resources/add_embedded_graphite.png \
216         extras/package/macosx/Resources/equalizerdrawer_graphite.png \
217         extras/package/macosx/Resources/fullscreen_graphite.png \
218         extras/package/macosx/Resources/next_graphite.png \
219         extras/package/macosx/Resources/pause_embedded_graphite.png \
220         extras/package/macosx/Resources/pause_graphite.png \
221         extras/package/macosx/Resources/play_embedded_graphite.png \
222         extras/package/macosx/Resources/play_graphite.png \
223         extras/package/macosx/Resources/playlistdrawer_graphite.png \
224         extras/package/macosx/Resources/previous_graphite.png \
225         extras/package/macosx/Resources/repeat_embedded_graphite.png \
226         extras/package/macosx/Resources/repeat_single_embedded_graphite.png \
227         extras/package/macosx/Resources/shuffle_embedded_graphite.png \
228         extras/package/macosx/Resources/skip_forward_embedded_graphite.png \
229         extras/package/macosx/Resources/skip_forward_graphite.png \
230         extras/package/macosx/Resources/skip_previous_embedded_graphite.png \
231         extras/package/macosx/Resources/skip_previous_graphite.png \
232         extras/package/macosx/Resources/stop_graphite.png \
233         extras/package/macosx/Resources/volumeslider_graphite.png \
234         extras/package/macosx/Resources/backward_big_down.png \
235         extras/package/macosx/Resources/backward_big.png \
236         extras/package/macosx/Resources/eq_sm.pdf \
237         extras/package/macosx/Resources/forward_big_down.png \
238         extras/package/macosx/Resources/forward_big.png \
239         extras/package/macosx/Resources/fs_sm.pdf \
240         extras/package/macosx/Resources/list_sm.pdf \
241         extras/package/macosx/Resources/next_sm.pdf \
242         extras/package/macosx/Resources/pause_big_down.png \
243         extras/package/macosx/Resources/pause_big.png \
244         extras/package/macosx/Resources/play_big_down.png \
245         extras/package/macosx/Resources/play_big.png \
246         extras/package/macosx/Resources/prev_sm.pdf \
247         extras/package/macosx/Resources/sidebarAdd.png \
248         extras/package/macosx/Resources/sidebarRepeat.png \
249         extras/package/macosx/Resources/sidebarRepeatOn.png \
250         extras/package/macosx/Resources/sidebarRepeatOneOn.png \
251         extras/package/macosx/Resources/sidebarResizeWidget.png \
252         extras/package/macosx/Resources/sidebarShuffle.png \
253         extras/package/macosx/Resources/sidebarShuffleOn.png \
254         extras/package/macosx/Resources/sidebarStatusAreaBackground.png \
255         extras/package/macosx/Resources/stop_sm.pdf \
256         extras/package/macosx/Resources/noart.png \
257         extras/package/macosx/Resources/spref_cone_Audio_64.png \
258         extras/package/macosx/Resources/spref_cone_Hotkeys_64.png \
259         extras/package/macosx/Resources/spref_cone_Input_64.png \
260         extras/package/macosx/Resources/spref_cone_Interface_64.png \
261         extras/package/macosx/Resources/spref_cone_Subtitles_64.png \
262         extras/package/macosx/Resources/spref_cone_Video_64.png \
263         extras/package/macosx/fullscreen_panel.svg \
264         extras/package/macosx/ub.sh \
265         extras/package/macosx/vlc.xcodeproj/project.pbxproj \
266         extras/package/macosx/Delete_Preferences.app/Contents/Info.plist \
267         extras/package/macosx/Delete_Preferences.app/Contents/PkgInfo \
268         extras/package/macosx/Delete_Preferences.app/Contents/MacOS/applet \
269         extras/package/macosx/Delete_Preferences.app/Contents/Resources/description.rtfd/TXT.rtf \
270         extras/package/macosx/Delete_Preferences.app/Contents/Resources/applet.icns \
271         extras/package/macosx/Delete_Preferences.app/Contents/Resources/applet.rsrc \
272         extras/package/macosx/Delete_Preferences.app/Contents/Resources/Scripts/main.scpt \
273         extras/package/macosx/plugin/Info.plist.in \
274         extras/package/macosx/plugin/InstallerInfo.plist.in \
275         extras/package/macosx/plugin/InstallerDescription.plist \
276         extras/package/macosx/plugin/pbdevelopment.plist \
277         extras/package/macosx/eyetvplugin/EyeTVPluginDefs.h \
278         extras/package/macosx/eyetvplugin/Info.plist \
279         extras/package/macosx/eyetvplugin/eyetvplugin.c \
280         extras/package/macosx/eyetvplugin/eyetvplugin.h \
281         extras/package/macosx/eyetvplugin/English.lproj/InfoPlist.strings \
282         extras/package/macosx/eyetvplugin/eyetvplugin.xcodeproj/project.pbxproj \
283         extras/package/macosx/README.MacOSX.rtf \
284         extras/package/macosx/Info.plist.in
285
286
287 ###############################################################################
288 # Various utilities ( editor syntax files, D-Bus controller ... )
289 ##############################################################################
290 EXTRA_DIST += \
291         extras/analyser/zsh_completion.sh \
292         extras/analyser/zsh.cpp \
293         extras/analyser/emacs.init \
294         extras/analyser/vlc.vim \
295         extras/analyser/valgrind.suppressions \
296         extras/buildsystem/make.pl \
297         extras/misc/mpris.py \
298         extras/misc/mpris.glade
299
300 dist-hook:
301         distdir=$(distdir) srcdir=$(srcdir) $(SHELL) $(srcdir)/toolbox --dist-contrib
302
303 ###############################################################################
304 # Building libvlc
305 ###############################################################################
306
307 noinst_SCRIPTS = vlc-config
308 vlc-config: $(top_builddir)/config.status $(top_builddir)/vlc-config.in
309         $(SHELL) ./config.status --file=$@
310         chmod 0755 $@
311         touch $@
312
313 vlc-config.in: vlc-config.in.in
314         ./config.status --recheck
315         touch $@
316
317 CLEANFILES = $(BUILT_SOURCES_clean)
318 DISTCLEANFILES = $(BUILT_SOURCES_distclean) vlc-config.in compile
319 MAINTAINERCLEANFILES = ChangeLog
320
321 # Shortcut for developers to rebuild the core (libvlc + vlc)
322 # Don't use it if you don't know what it is about.
323 # Don't complain if it doesn't work. -- Courmisch
324 libcompat:
325         cd compat && $(MAKE) $(AM_MAKEFLAGS)
326
327 libvlc: libcompat
328         cd src && $(MAKE) $(AM_MAKEFLAGS) libvlc.la
329
330 core: libvlc
331         cd bin && $(MAKE) $(AM_MAKEFLAGS) vlc$(EXEEXT)
332
333 doc:
334         cd doc && $(MAKE) $(AM_MAKEFLAGS) doc
335
336 .PHONY: libvlc core doc
337
338 if HAVE_BEOS
339 noinst_DATA = vlc-bundle
340 vlc-bundle: vlc
341         rm -Rf $(top_builddir)/vlc-bundle ; mkdir -p $(top_builddir)/vlc-bundle
342         cp $(top_builddir)/vlc $(top_builddir)/vlc-bundle/
343         xres -o $(top_builddir)/vlc-bundle/vlc $(srcdir)/share/vlc_beos.rsrc
344         for i in "" `$(VLC_CONFIG) --target plugin` ; do \
345           if test -n "$$i" ; then \
346             mkdir -p $(top_builddir)/vlc-bundle/plugins ; \
347             cp "$$i$(LIBEXT)" $(top_builddir)/vlc-bundle/plugins/ ; \
348           fi ; \
349         done
350         if test -d $(CONTRIB_DIR)/vlc-lib ; then \
351           mkdir -p $(top_builddir)/vlc-bundle/lib ; \
352           for i in $(CONTRIB_DIR)/vlc-lib/*.so ; do \
353             cp $$i $(top_builddir)/vlc-bundle/lib/ ; \
354           done ; \
355         fi
356         cat $(top_srcdir)/po/LINGUAS | while read i; do \
357           mkdir -p "$(top_builddir)/vlc-bundle/share/locale/$$i/LC_MESSAGES" ; \
358           cp "$(top_builddir)/po/$$i.gmo" \
359             "$(top_builddir)/vlc-bundle/share/locale/$$i/LC_MESSAGES/vlc.mo" || true ; \
360         done
361         find $(top_builddir)/vlc-bundle -type f -exec mimeset -f "{}" \;
362 endif
363
364 ###############################################################################
365 # Building aliases
366 ###############################################################################
367
368 ALL_ALIASES = cvlc rvlc svlc qvlc nvlc mvlc
369 bin_SCRIPTS = $(ALIASES)
370 CLEANFILES += $(ALIASES) $(noinst_SCRIPTS)
371 EXTRA_SCRIPTS = $(ALL_ALIASES)
372
373 dist_noinst_SCRIPTS += make-alias
374
375 MKALIAS = bindir="$(bindir)" transform="$(transform)" program_prefix="$(program_prefix)" program_suffix="$(program_suffix)" $(top_srcdir)/make-alias $@
376
377 cvlc: make-alias Makefile
378         $(AM_V_GEN)$(MKALIAS) dummy
379
380 rvlc: make-alias Makefile
381         $(AM_V_GEN)$(MKALIAS) rc
382
383 svlc: make-alias Makefile
384         $(AM_V_GEN)$(MKALIAS) skins2
385
386 qvlc: make-alias Makefile
387         $(AM_V_GEN)$(MKALIAS) qt4
388
389 nvlc: make-alias Makefile
390         $(AM_V_GEN)$(MKALIAS) ncurses
391
392 mvlc: make-alias Makefile
393         $(AM_V_GEN)$(MKALIAS) maemo
394
395 if BUILD_VLC
396 noinst_SCRIPTS += vlc$(EXEEXT)
397 endif
398
399 vlc$(EXEEXT):
400         $(AM_V_GEN)ln -sf bin/vlc-static$(EXEEXT) vlc$(EXEEXT)
401
402 if HAVE_DARWIN
403 if BUILD_MACOSX_VLC_APP
404 # Create the MacOS X app
405 noinst_DATA = VLC.app
406 endif
407 endif
408
409 silentstd = $(silentstd_$(V))
410 silentstd_ = $(silentstd_$(AM_DEFAULT_VERBOSITY))
411 silentstd_0 = 2>&1 >/dev/null
412
413 # VLC-release.app for packaging and giving it to your friends
414 # use package-macosx to get a nice dmg
415 VLC-release.app: vlc
416         ( cd src && $(MAKE) $(AM_MAKEFLAGS) install $(silentstd) )
417         rm -Rf "$(top_builddir)/tmp"
418         mkdir -p "$(top_builddir)/tmp/extras/package/macosx"
419         rm -Rf $(top_builddir)/VLC-release.app
420         for i in vlc.xcodeproj Resources README.MacOSX.rtf ; do \
421           cp -R $(srcdir)/extras/package/macosx/$$i $(top_builddir)/tmp/extras/package/macosx/; \
422         done
423         REVISION=`(git --git-dir=$(srcdir)/.git describe --always || echo exported)` && \
424         cat $(top_builddir)/extras/package/macosx/Info.plist | \
425         sed "s/#REVISION#/$$REVISION/g" > $(top_builddir)/tmp/extras/package/macosx/Info.plist
426         cp -R $(top_builddir)/extras/package/macosx/Resources $(top_builddir)/tmp/extras/package/macosx/
427         for i in AUTHORS COPYING THANKS; do \
428           cp "$(srcdir)/$$i" $(top_builddir)/tmp; \
429         done
430         mkdir -p $(top_builddir)/tmp/extras/contrib/Sparkle
431         cp -R $(CONTRIB_DIR)/Sparkle/Sparkle.framework $(top_builddir)/tmp/extras/contrib/Sparkle
432         mkdir -p $(top_builddir)/tmp/modules/audio_output
433         mkdir -p $(top_builddir)/tmp/modules/gui/macosx
434         for i in \
435             AppleRemote.h \
436             AppleRemote.m \
437             about.h \
438             about.m \
439             applescript.h \
440             applescript.m \
441             controls.h \
442             controls.m \
443             equalizer.h \
444             equalizer.m \
445             intf.h \
446             intf.m \
447             macosx.m \
448             misc.h \
449             misc.m \
450             open.h \
451             open.m \
452             output.h \
453             output.m \
454             playlist.h \
455             playlist.m \
456             playlistinfo.h \
457             playlistinfo.m \
458             prefs_widgets.h \
459             prefs_widgets.m \
460             prefs.h \
461             prefs.m \
462             simple_prefs.h \
463             simple_prefs.m \
464             vout.h \
465             voutgl.m \
466             wizard.h \
467             wizard.m \
468             extended.h \
469             extended.m \
470             bookmarks.h \
471             bookmarks.m \
472             coredialogs.h \
473             coredialogs.m \
474             embeddedwindow.h \
475             embeddedwindow.m \
476             fspanel.h \
477             fspanel.m \
478             vout.m; do \
479           cp "$(srcdir)/modules/gui/macosx/$$i" \
480              $(top_builddir)/tmp/modules/gui/macosx; \
481         done
482         $(AM_V_GEN)cd $(top_builddir)/tmp/extras/package/macosx && \
483         xcodebuild -target vlc SYMROOT=../../../build $(silentstd) && \
484         cd ../../../../ && \
485         cp -R $(top_builddir)/tmp/build/Default/VLC.bundle $(top_builddir)/VLC-release.app; \
486         rm -Rf $(top_builddir)/tmp
487         $(INSTALL) -d $(top_builddir)/VLC-release.app/Contents/MacOS
488         PRODUCT="VLC-release.app" ACTION="release-makefile" src_dir=$(srcdir) build_dir=$(top_builddir) sh $(srcdir)/projects/macosx/framework/Pre-Compile.sh
489         $(INSTALL) -d $(top_builddir)/VLC-release.app/Contents/MacOS/share/lua
490         for i in $(srcdir)/share/lua/*.* ; do \
491           $(INSTALL) -m 644 $${i} $(top_builddir)/VLC-release.app/Contents/MacOS/share/lua/`basename $${i}` ; \
492         done ; \
493         $(INSTALL) -d $(top_builddir)/VLC-release.app/Contents/MacOS/share/lua/playlist
494         for i in $(srcdir)/share/lua/playlist/*.* ; do \
495           $(INSTALL) -m 644 $${i} $(top_builddir)/VLC-release.app/Contents/MacOS/share/lua/playlist/`basename $${i}` ; \
496         done ; \
497         $(INSTALL) -d $(top_builddir)/VLC-release.app/Contents/MacOS/share/lua/meta
498         for i in $(srcdir)/share/lua/meta/*.* ; do \
499           $(INSTALL) -m 644 $${i} $(top_builddir)/VLC-release.app/Contents/MacOS/share/lua/meta/`basename $${i}` ; \
500         done ; \
501         $(INSTALL) -d $(top_builddir)/VLC-release.app/Contents/MacOS/share/lua/intf
502         for i in $(srcdir)/share/lua/intf/*.* ; do \
503           $(INSTALL) -m 644 $${i} $(top_builddir)/VLC-release.app/Contents/MacOS/share/lua/intf/`basename $${i}` ; \
504         done ; \
505         $(INSTALL) -d $(top_builddir)/VLC-release.app/Contents/MacOS/share/lua/intf/modules
506         for i in $(srcdir)/share/lua/intf/modules/*.* ; do \
507           $(INSTALL) -m 644 $${i} $(top_builddir)/VLC-release.app/Contents/MacOS/share/lua/intf/modules/`basename $${i}` ; \
508         done ; \
509         $(INSTALL) -d $(top_builddir)/VLC-release.app/Contents/MacOS/share/lua/http/dialogs
510         $(INSTALL) -d $(top_builddir)/VLC-release.app/Contents/MacOS/share/lua/http/js
511         $(INSTALL) -d $(top_builddir)/VLC-release.app/Contents/MacOS/share/lua/http/images
512         $(INSTALL) -d $(top_builddir)/VLC-release.app/Contents/MacOS/share/lua/http/requests
513         $(INSTALL) -m 644 $(srcdir)/share/lua/http/.hosts $(top_builddir)/VLC-release.app/Contents/MacOS/share/lua/http/.hosts
514         for i in $(srcdir)/share/lua/http/*.* ; do \
515           $(INSTALL) -m 644 $${i} $(top_builddir)/VLC-release.app/Contents/MacOS/share/lua/http/`basename $${i}` ; \
516         done
517         for i in $(srcdir)/share/lua/http/dialogs/* ; do \
518           $(INSTALL) -m 644 $${i} $(top_builddir)/VLC-release.app/Contents/MacOS/share/lua/http/dialogs/`basename $${i}` ; \
519         done
520         for i in $(srcdir)/share/lua/http/js/*.* ; do \
521           $(INSTALL) -m 644 $${i} $(top_builddir)/VLC-release.app/Contents/MacOS/share/lua/http/js/`basename $${i}` ; \
522         done
523         for i in $(srcdir)/share/lua/http/images/*.* ; do \
524           $(INSTALL) -m 644 $${i} $(top_builddir)/VLC-release.app/Contents/MacOS/share/lua/http/images/`basename $${i}` ; \
525         done
526         for i in $(srcdir)/share/lua/http/requests/*.* ; do \
527           $(INSTALL) -m 644 $${i} $(top_builddir)/VLC-release.app/Contents/MacOS/share/lua/http/requests/`basename $${i}` ; \
528         done
529         $(INSTALL) -m 644 $(srcdir)/share/lua/http/requests/readme $(top_builddir)/VLC-release.app/Contents/MacOS/share/lua/http/requests/readme.txt
530         $(INSTALL) -d $(top_builddir)/VLC-release.app/Contents/MacOS/share/http/dialogs
531         $(INSTALL) -d $(top_builddir)/VLC-release.app/Contents/MacOS/share/http/js
532         $(INSTALL) -d $(top_builddir)/VLC-release.app/Contents/MacOS/share/http/images
533         $(INSTALL) -d $(top_builddir)/VLC-release.app/Contents/MacOS/share/http/requests
534         $(INSTALL) -m 644 $(srcdir)/share/http/.hosts $(top_builddir)/VLC-release.app/Contents/MacOS/share/http/.hosts
535         for i in $(srcdir)/share/http/*.* ; do \
536           $(INSTALL) -m 644 $${i} $(top_builddir)/VLC-release.app/Contents/MacOS/share/http/`basename $${i}` ; \
537         done
538         for i in $(srcdir)/share/http/dialogs/* ; do \
539           $(INSTALL) -m 644 $${i} $(top_builddir)/VLC-release.app/Contents/MacOS/share/http/dialogs/`basename $${i}` ; \
540         done
541         for i in $(srcdir)/share/http/js/*.* ; do \
542           $(INSTALL) -m 644 $${i} $(top_builddir)/VLC-release.app/Contents/MacOS/share/http/js/`basename $${i}` ; \
543         done
544         for i in $(srcdir)/share/http/images/*.* ; do \
545           $(INSTALL) -m 644 $${i} $(top_builddir)/VLC-release.app/Contents/MacOS/share/http/images/`basename $${i}` ; \
546         done
547         for i in $(srcdir)/share/http/requests/*.* ; do \
548           $(INSTALL) -m 644 $${i} $(top_builddir)/VLC-release.app/Contents/MacOS/share/http/requests/`basename $${i}` ; \
549         done
550         $(INSTALL) -m 644 $(srcdir)/share/http/requests/readme $(top_builddir)/VLC-release.app/Contents/MacOS/share/http/requests/readme.txt
551         $(INSTALL) -d $(top_builddir)/VLC-release.app/Contents/MacOS/share/locale
552         cat $(top_srcdir)/po/LINGUAS | while read i; do \
553           $(INSTALL) -d $(top_builddir)/VLC-release.app/Contents/MacOS/share/locale/$${i}/LC_MESSAGES ; \
554           $(INSTALL) $(srcdir)/po/$${i}.gmo $(top_builddir)/VLC-release.app/Contents/MacOS/share/locale/$${i}/LC_MESSAGES/vlc.mo || true ; \
555           mkdir -p $(top_builddir)/VLC-release.app/Contents/Resources/$${i}.lproj ; \
556           ln -sf ../English.lproj/InfoPlist.strings \
557               $(top_builddir)/VLC-release.app/Contents/Resources/$${i}.lproj ; \
558           ln -sf ../English.lproj/MainMenu.nib \
559               $(top_builddir)/VLC-release.app/Contents/Resources/$${i}.lproj ; \
560         done
561         printf "APPLVLC#" >| $(top_builddir)/VLC-release.app/Contents/PkgInfo
562         find $(top_builddir)/VLC-release.app/Contents/Resources/English.lproj -name designable.nib -delete;
563         find $(top_builddir)/VLC-release.app -type d -exec chmod ugo+rx '{}' \;
564         find $(top_builddir)/VLC-release.app -type f -exec chmod ugo+r '{}' \;
565
566 # This is just for development purposes. 
567 # The resulting VLC.app will only run in this tree.
568 VLC.app: vlc $(top_builddir)/src/.libs/libvlccore.dylib $(top_builddir)/src/.libs/libvlc.dylib
569         $(AM_V_GEN)(cd src && make install $(silentstd))
570         rm -Rf $(top_builddir)/tmp
571         mkdir -p "$(top_builddir)/tmp/extras/package/macosx"
572         rm -Rf $(top_builddir)/VLC.app
573         for i in vlc.xcodeproj Resources README.MacOSX.rtf; do \
574           cp -R $(srcdir)/extras/package/macosx/$$i $(top_builddir)/tmp/extras/package/macosx/; \
575         done
576         REVISION=`(git --git-dir=$(srcdir)/.git describe --always || echo exported)` && \
577         cat $(top_builddir)/extras/package/macosx/Info.plist | \
578         sed "s/#REVISION#/$$REVISION/g" > $(top_builddir)/tmp/extras/package/macosx/Info.plist
579         cp -R $(top_builddir)/extras/package/macosx/Resources $(top_builddir)/tmp/extras/package/macosx/
580         for i in AUTHORS COPYING THANKS; do \
581           cp "$(srcdir)/$$i" $(top_builddir)/tmp; \
582         done
583         mkdir -p $(top_builddir)/tmp/extras/contrib/Sparkle
584         cp -R $(CONTRIB_DIR)/Sparkle/Sparkle.framework $(top_builddir)/tmp/extras/contrib/Sparkle
585         mkdir -p $(top_builddir)/tmp/modules/audio_output
586         mkdir -p $(top_builddir)/tmp/modules/gui/macosx
587         for i in \
588             AppleRemote.h \
589             AppleRemote.m \
590             about.h \
591             about.m \
592             applescript.h \
593             applescript.m \
594             controls.h \
595             controls.m \
596             equalizer.h \
597             equalizer.m \
598             intf.h \
599             intf.m \
600             macosx.m \
601             misc.h \
602             misc.m \
603             open.h \
604             open.m \
605             output.h \
606             output.m \
607             playlist.h \
608             playlist.m \
609             playlistinfo.h \
610             playlistinfo.m \
611             prefs_widgets.h \
612             prefs_widgets.m \
613             prefs.h \
614             prefs.m \
615             simple_prefs.h \
616             simple_prefs.m \
617             vout.h \
618             voutgl.m \
619             wizard.h \
620             wizard.m \
621             extended.h \
622             extended.m \
623             bookmarks.h \
624             bookmarks.m \
625             coredialogs.h \
626             coredialogs.m \
627             embeddedwindow.h \
628             embeddedwindow.m \
629             fspanel.h \
630             fspanel.m \
631             vout.m; do \
632           cp "$(srcdir)/modules/gui/macosx/$$i" \
633              $(top_builddir)/tmp/modules/gui/macosx; \
634         done
635         $(AM_V_GEN)cd $(top_builddir)/tmp/extras/package/macosx && \
636         xcodebuild -target vlc SYMROOT=../../../build $(silentstd) && \
637         cd ../../../../ && \
638         cp -R $(top_builddir)/tmp/build/Default/VLC.bundle $(top_builddir)/VLC.app
639         $(INSTALL) -d $(top_builddir)/VLC.app/Contents/MacOS
640         touch $(top_builddir)/VLC.app/Contents/MacOS/VLC
641         chmod +x $(top_builddir)/VLC.app/Contents/MacOS/VLC
642         $(INSTALL) $(top_builddir)/bin/.libs/vlc $(top_builddir)/VLC.app/Contents/MacOS/VLC
643         ln -sf ../../../modules $(top_builddir)/VLC.app/Contents/MacOS/modules
644         install -d $(top_builddir)/VLC.app/Contents/MacOS/share
645         for i in `ls $(srcdir)/share`; do \
646            ln -sf `pwd`/$(srcdir)/share/$$i $(top_builddir)/VLC.app/Contents/MacOS/share/; \
647         done
648         $(INSTALL) -d $(top_builddir)/VLC.app/Contents/MacOS/share/locale
649         cat $(top_srcdir)/po/LINGUAS | while read i; do \
650           mkdir -p $(top_builddir)/VLC.app/Contents/MacOS/share/locale/$${i}/LC_MESSAGES ; \
651           ln -sfn `pwd`/$(srcdir)/po/$${i}.gmo $(top_builddir)/VLC.app/Contents/MacOS/share/locale/$${i}/LC_MESSAGES/vlc.mo || true ; \
652           mkdir -p $(top_builddir)/VLC.app/Contents/Resources/$${i}.lproj ; \
653           ln -sf ../English.lproj/InfoPlist.strings \
654               $(top_builddir)/VLC.app/Contents/Resources/$${i}.lproj ; \
655           ln -sf ../English.lproj/MainMenu.nib \
656               $(top_builddir)/VLC.app/Contents/Resources/$${i}.lproj ; \
657         done
658         printf "APPLVLC#" >| $(top_builddir)/VLC.app/Contents/PkgInfo
659
660 ###############################################################################
661 # Building architecture-specific binary packages
662 ###############################################################################
663
664 # XXX: this rule is probably only useful to you if you have exactly
665 # the same setup as the maintaner(s).
666 #
667
668 ############################################################################
669 ## Win                                                                    ##
670 ############################################################################
671 win32_destdir=$(top_builddir)/vlc-$(VERSION)
672 win32_xpi_destdir=$(win32_destdir)/vlc-plugin
673 win32_debugdir=$(top_builddir)/symbols-$(VERSION)
674 npvlc=vlc-$(VERSION)/mozilla/npvlc$(LIBEXT)
675 axvlc=vlc-$(VERSION)/activex/axvlc$(LIBEXT)
676 win32_lua_destdir=$(win32_destdir)/lua
677 win32_http_destdir=$(win32_destdir)/http
678
679 #Win-common if for win32 and wince
680 package-win-common:
681 # Check that tmp isn't in the way
682         @if test -e "$(win32_destdir)"; then \
683           echo "Error: please remove $(win32_destdir), it is in the way"; \
684           false; \
685         else \
686           echo "OK."; mkdir -p "$(win32_destdir)"; \
687         fi
688 # Same for debug symbols dir
689         @if test -e "$(win32_debugdir)"; then \
690           echo "Error: please remove $(win32_debugdir), it is in the way"; \
691           false; \
692         else \
693           echo "OK."; mkdir -p "$(win32_debugdir)"; \
694         fi
695
696 # Copy relevant files
697 # Copy executables, major libs+manifests
698         cp "$(top_builddir)/bin/.libs/vlc$(EXEEXT)" "$(win32_destdir)/"
699         cp "$(top_builddir)/bin/.libs/vlc-cache-gen$(EXEEXT)" "$(win32_destdir)/"
700         cp "$(top_srcdir)/extras/package/win32/vlc.exe.manifest" "$(win32_destdir)/"
701         cp "$(top_srcdir)/extras/package/win32/libvlc.dll.manifest" "$(win32_destdir)/"
702         cp "$(top_builddir)/src/.libs/libvlccore$(LIBEXT)" "$(win32_destdir)/"
703         cp "$(top_builddir)/src/.libs/libvlc$(LIBEXT)" "$(win32_destdir)/"
704
705 # Copy Text files
706         for file in AUTHORS THANKS ; \
707           do sed 's/@/_AT_/' < "$(srcdir)/$$file" > "$(win32_destdir)/$${file}.txt" ; done;
708         for file in NEWS COPYING README; \
709           do cp "$(srcdir)/$$file" "$(win32_destdir)/$${file}.txt"; done
710         unix2dos "$(win32_destdir)/"*.txt || echo "WARNING: this shouldn't happen"
711
712 # Necessary icons
713         cp $(srcdir)/share/vlc.ico $(win32_destdir)/
714
715 # Copy the locales
716         mkdir -p $(win32_destdir)/locale
717         cat $(top_srcdir)/po/LINGUAS | while read i; do \
718           mkdir -p "$(win32_destdir)/locale/$${i}/LC_MESSAGES" ; \
719           cp "$(srcdir)/po/$${i}.gmo" \
720             "$(win32_destdir)/locale/$${i}/LC_MESSAGES/vlc.mo" \
721             || true ; \
722         done
723         mkdir -p $(win32_destdir)/locale/qt4/
724         cp $(QT4LOCALEDIR)/*.qm $(win32_destdir)/locale/qt4/ || true
725
726 #  Mozilla plugin
727 if BUILD_MOZILLA
728         mkdir -p "$(win32_destdir)/mozilla"
729         cp $(top_builddir)/projects/mozilla/.libs/npvlc$(LIBEXT) $(win32_destdir)/mozilla/
730         cp $(top_srcdir)/projects/mozilla/npvlc.dll.manifest $(win32_destdir)/mozilla/
731 endif
732
733 # ActiveX plugin
734 if BUILD_ACTIVEX
735         mkdir -p "$(win32_destdir)/activex"
736         cp $(srcdir)/projects/activex/README.TXT  $(win32_destdir)/activex/
737         cp $(srcdir)/projects/activex/test.html  $(win32_destdir)/activex/
738         unix2dos $(win32_destdir)/activex/*
739
740         cp $(top_builddir)/projects/activex/.libs/axvlc$(LIBEXT) $(win32_destdir)/activex/
741         cp $(top_srcdir)/projects/activex/axvlc.dll.manifest $(win32_destdir)/activex/
742 endif
743
744 # Rebase all those DLLs to speed up loading (need cygwin rebase)
745         if rebase -b 0x42 /dev/null >/dev/null 2>&1; then \
746                 find $(win32_destdir) -type f -name '*.dll' -print | rebase -b 0x70000000 -T -; \
747         fi
748
749 package-win32-xpi: package-win-common-strip
750         mkdir -p "$(win32_xpi_destdir)/plugins"
751         cp $(top_builddir)/projects/mozilla/install.rdf "$(win32_xpi_destdir)"
752         cp $(win32_destdir)/mozilla/npvlc$(LIBEXT) \
753                 "$(win32_xpi_destdir)/plugins"
754         cp $(top_srcdir)/projects/mozilla/npvlc.dll.manifest \
755                 "$(win32_xpi_destdir)/plugins"
756         cp "$(top_srcdir)/extras/package/win32/libvlc.dll.manifest" \
757                 "$(win32_xpi_destdir)/plugins"
758         cp "$(win32_destdir)/libvlccore$(LIBEXT)" \
759                 "$(win32_xpi_destdir)/plugins"
760         cp "$(win32_destdir)/libvlc$(LIBEXT)" \
761                 "$(win32_xpi_destdir)/plugins"
762         mkdir -p "$(win32_xpi_destdir)/plugins/plugins"
763         cp $(win32_destdir)/plugins/*$(LIBEXT) \
764                 "$(win32_xpi_destdir)/plugins/plugins"
765         rm -rf "$(win32_xpi_destdir)/plugins/plugins/*qt*"
766         rm -rf "$(win32_xpi_destdir)/plugins/plugins/*skins*"
767         cd $(win32_xpi_destdir) && zip -r vlc-$(VERSION).xpi install.rdf plugins
768
769 package-win32-base-debug: package-win-common
770 # Copy relevant files
771 # Script installer
772         cp "$(top_builddir)/extras/package/win32/vlc.win32.nsi" "$(win32_destdir)/"
773         cp "$(top_builddir)/extras/package/win32/spad.nsi" "$(win32_destdir)/"
774         mkdir "$(win32_destdir)/languages"
775         cp $(srcdir)/extras/package/win32/languages/*.nsh "$(win32_destdir)/languages/"
776
777 # Plugins
778         mkdir -p "$(win32_destdir)/plugins"
779         find modules/ -name '*_plugin$(LIBEXT)' | while read i; do \
780           if test -n "$$i" ; then \
781             $(INSTALL) "$$i" "vlc-$(VERSION)/plugins/" ; \
782           fi ; done
783
784 #Enable DEP and ASLR for all the binaries
785 if USE_PEFLAGS
786         find $(win32_destdir) -type f -name '*.dll' -print -o -name '*.exe' -print | while read i; do \
787         $(PEFLAGS) --dynamicbase=true --nxcompat=true "$$i" ; \
788         done
789 endif
790
791 # Copy the lua scripts (HTTP)
792 if BUILD_LUA
793         mkdir -p "$(win32_lua_destdir)/http/images"
794         mkdir -p "$(win32_lua_destdir)/http/requests"
795         mkdir -p "$(win32_lua_destdir)/http/js"
796         mkdir -p "$(win32_lua_destdir)/http/dialogs"
797         cp $(srcdir)/share/lua/http/*.html $(win32_lua_destdir)/http/
798         unix2dos $(win32_lua_destdir)/http/*.html
799         cp $(srcdir)/share/lua/http/.hosts $(win32_lua_destdir)/http/
800         unix2dos $(win32_lua_destdir)/http/.hosts
801         cp $(srcdir)/share/lua/http/*.css $(win32_lua_destdir)/http/
802         unix2dos $(win32_lua_destdir)/http/*.css
803         cp $(srcdir)/share/lua/http/js/*.js $(win32_lua_destdir)/http/js/
804         unix2dos $(win32_lua_destdir)/http/js/*.js
805         cp $(srcdir)/share/lua/http/*.lua $(win32_lua_destdir)/http/
806         unix2dos $(win32_lua_destdir)/http/*.lua
807         cp $(srcdir)/share/lua/http/dialogs/* $(win32_lua_destdir)/http/dialogs/
808         unix2dos $(win32_lua_destdir)/http/dialogs/*
809         cp $(srcdir)/share/lua/http/dialogs/.hosts $(win32_lua_destdir)/http/dialogs/
810         unix2dos $(win32_lua_destdir)/http/dialogs/.hosts
811         cp $(srcdir)/share/lua/http/*.ico $(win32_lua_destdir)/http/
812         cp $(srcdir)/share/lua/http/images/*.png $(win32_lua_destdir)/http/images/
813         cp $(srcdir)/share/lua/http/requests/*.xml $(win32_lua_destdir)/http/requests/
814         unix2dos $(win32_lua_destdir)/http/requests/*.xml
815         cp $(srcdir)/share/lua/http/requests/readme $(win32_lua_destdir)/http/requests/readme.txt
816         unix2dos $(win32_lua_destdir)/http/requests/readme.txt
817 endif
818
819 if BUILD_LUA
820 #Lua Scripts
821         $(INSTALL) -d $(win32_lua_destdir)
822         for i in $(srcdir)/share/lua/*.* ; do \
823           $(INSTALL) -m 644 -- "$${i}" $(win32_lua_destdir)/`basename $${i}` ; \
824         done
825         $(INSTALL) -d $(win32_lua_destdir)/playlist
826         for i in $(srcdir)/share/lua/playlist/*.* ; do \
827           $(INSTALL) -m 644 -- "$${i}" $(win32_lua_destdir)/playlist/`basename $${i}` ; \
828         done
829         $(INSTALL) -d $(win32_lua_destdir)/meta/art
830         for i in $(srcdir)/share/lua/meta/art/*.lua ; do \
831           $(INSTALL) -m 644 -- "$${i}" $(win32_lua_destdir)/meta/art/`basename $${i}` ; \
832         done
833         $(INSTALL) -d $(win32_lua_destdir)/meta/reader
834         for i in $(srcdir)/share/lua/meta/reader/*.lua ; do \
835           $(INSTALL) -m 644 -- "$${i}" $(win32_lua_destdir)/meta/reader/`basename $${i}` ; \
836         done
837         $(INSTALL) -d $(win32_lua_destdir)/intf
838         for i in $(srcdir)/share/lua/intf/*.* ; do \
839           $(INSTALL) -m 644 -- "$${i}" $(win32_lua_destdir)/intf/`basename $${i}` ; \
840         done
841         $(INSTALL) -d $(win32_lua_destdir)/intf/modules
842         for i in $(srcdir)/share/lua/intf/modules/*.* ; do \
843           $(INSTALL) -m 644 -- "$${i}" $(win32_lua_destdir)/intf/modules/`basename $${i}` ; \
844         done
845 endif
846
847 # Copy the http files
848 if BUILD_HTTPD
849         mkdir -p "$(win32_http_destdir)/images"
850         mkdir -p "$(win32_http_destdir)/requests"
851         mkdir -p "$(win32_http_destdir)/js"
852         mkdir -p "$(win32_http_destdir)/dialogs"
853         cp $(srcdir)/share/http/*.html $(win32_http_destdir)/
854         unix2dos $(win32_http_destdir)/*.html
855         cp $(srcdir)/share/http/.hosts $(win32_http_destdir)/
856         unix2dos $(win32_http_destdir)/.hosts
857         cp $(srcdir)/share/http/*.css $(win32_http_destdir)/
858         unix2dos $(win32_http_destdir)/*.css
859         cp $(srcdir)/share/http/js/*.js $(win32_http_destdir)/js/
860         unix2dos $(win32_http_destdir)/js/*.js
861         cp $(srcdir)/share/http/dialogs/* $(win32_http_destdir)/dialogs/
862         unix2dos $(win32_http_destdir)/dialogs/*
863         cp $(srcdir)/share/http/dialogs/.hosts $(win32_http_destdir)/dialogs/
864         unix2dos $(win32_http_destdir)/dialogs/.hosts
865         cp $(srcdir)/share/http/*.ico $(win32_http_destdir)/
866         cp $(srcdir)/share/http/images/*.png $(win32_http_destdir)/images/
867         cp $(srcdir)/share/http/requests/*.xml $(win32_http_destdir)/requests/
868         unix2dos $(win32_http_destdir)/requests/*.xml
869         cp $(srcdir)/share/http/requests/readme $(win32_http_destdir)/requests/readme.txt
870         unix2dos $(win32_http_destdir)/requests/readme.txt
871
872 endif
873
874 if BUILD_SKINS
875 # Skins
876         mkdir -p $(win32_destdir)/skins/fonts
877         for i in $(srcdir)/share/skins2/fonts/*.*; do \
878           cp -- "$$i" $(win32_destdir)/skins/fonts/ || true ; \
879         done
880         for i in $(top_builddir)/share/skins2/*.*; do \
881           cp -- "$$i" $(win32_destdir)/skins/ || true ; \
882         done
883         cp -- $(srcdir)/share/skins2/skin.catalog $(win32_destdir)/skins/ || true ;
884         cp -- $(srcdir)/share/skins2/skin.dtd $(win32_destdir)/skins/ || true ;
885 endif
886
887 if BUILD_OSDMENU
888 #OSD Menu
889         mkdir -p "$(win32_destdir)/osdmenu"
890         cp $(srcdir)/share/osdmenu/*.* "$(win32_destdir)/osdmenu"
891         for dir in default default/selected default/selection default/volume ;do \
892                 mkdir -p "$(win32_destdir)/osdmenu/$$dir"; \
893                 for file in $(srcdir)/share/osdmenu/$${dir}/*.png;do \
894                          cp -- "$$file" "$(win32_destdir)/osdmenu/$$dir"; \
895                 done; \
896         done
897         unix2dos $(win32_destdir)/osdmenu/*.cfg;
898         for file in $(win32_destdir)/osdmenu/*.cfg; do \
899                 sed 's%share/osdmenu%osdmenu%g' "$$file" > "$$file.tmp" || exit $$? ; \
900                 sed 's%/%\\%g' "$$file.tmp" > "$$file" || exit$$? ; \
901                 rm -f -- "$$file.tmp"; \
902         done
903 endif
904
905 # SDK
906         mkdir -p "$(win32_destdir)/sdk.tmp"
907         mkdir -p "$(win32_destdir)/sdk"
908         d=$$(pwd) && \
909         cd src && \
910         make install DESTDIR="$$d/vlc-$(VERSION)/sdk.tmp"
911         cd vlc-$(VERSION) && mv sdk.tmp/$(prefix)/* sdk/
912         find vlc-$(VERSION)/sdk.tmp -type d | sort -r | xargs rmdir
913         rm -Rf vlc-$(VERSION)/sdk/bin
914
915 # Strip DLLs
916 package-win-common-strip: package-win32-base-debug
917         for i in "" $(win32_destdir)/*$(LIBEXT) \
918                     $(win32_destdir)/*$(EXEEXT) \
919                     $(win32_destdir)/activex/*$(LIBEXT) \
920                     $(win32_destdir)/mozilla/*$(LIBEXT) \
921                     $(win32_destdir)/plugins/*$(LIBEXT) \
922         ; do \
923           if test -n "$$i" ; then \
924             $(OBJCOPY) --only-keep-debug "$$i" "$$i.dbg"; \
925             $(OBJCOPY) --strip-all "$$i" ; \
926             $(OBJCOPY) --add-gnu-debuglink="$$i.dbg" "$$i" ; \
927             mv "$$i.dbg" "$(win32_debugdir)"; \
928           fi ; \
929         done
930
931 package-win32-base: package-win-common-strip
932
933 package-win32-base-exe: package-win32-base
934 # Create package
935         rm -Rf $(win32_destdir)/sdk
936         if makensis -VERSION >/dev/null 2>&1; then \
937             MAKENSIS="makensis"; \
938         elif [ -x "/cygdrive/c/Program Files/NSIS/makensis" ]; then \
939             MAKENSIS="/cygdrive/c/Program\ Files/NSIS/makensis"; \
940         elif [ -x "$(PROGRAMFILES)/NSIS/makensis" ]; then \
941             MAKENSIS="$(PROGRAMFILES)/NSIS/makensis"; \
942         elif wine --version >/dev/null 2>&1; then \
943             MAKENSIS="wine C:/Program\ Files/NSIS/makensis.exe"; \
944         else \
945             echo 'Error: cannot locate makensis tool'; exit 1; \
946         fi; \
947         eval "$$MAKENSIS $(win32_destdir)/spad.nsi"; \
948         eval "$$MAKENSIS $(win32_destdir)/vlc.win32.nsi"
949
950 package-win32-base-zip: package-win32-base
951 # Create package 
952         rm -f -- vlc-$(VERSION)-win32.zip
953         zip -r -9 vlc-$(VERSION)-win32.zip vlc-$(VERSION)
954
955 package-win32-base-debug-zip: package-win32-base-debug
956 # Create package
957         rm -f -- vlc-$(VERSION)-win32-debug.zip
958         zip -r -9 vlc-$(VERSION)-win32-debug.zip vlc-$(VERSION)
959
960 package-win32-base-7zip: package-win32-base
961 # Create package 
962         7z a -t7z -m0=lzma -mx=9 -mfb=64 -md=32m -ms=on vlc-$(VERSION)-win32.7z vlc-$(VERSION)
963
964 package-win32-base-debug-7zip: package-win32-base-debug
965 # Create package
966         7z a -t7z -m0=lzma -mx=9 -mfb=64 -md=32m -ms=on vlc-$(VERSION)-win32-debug.7z vlc-$(VERSION)
967
968 package-win32-cleanup:
969         rm -Rf $(win32_destdir)
970         rm -Rf $(win32_debugdir)
971
972 package-win32-exe: package-win32-base package-win32-base-exe package-win32-cleanup
973
974 package-win32-zip: package-win32-base-zip package-win32-cleanup
975
976 package-win32-debug-zip: package-win32-base-debug-zip package-win32-cleanup
977
978 package-win32-7zip: package-win32-base-7zip package-win32-cleanup
979
980 package-win32-debug-7zip: package-win32-base-debug-7zip package-win32-cleanup
981
982 package-win32-no-clean: package-win32-base-zip package-win32-base-7zip package-win32-base-exe 
983
984 package-win32: package-win32-no-clean package-win32-cleanup
985
986 package-win32-debug: package-win32-base-debug-zip package-win32-base-debug-7zip package-win32-cleanup
987
988 #######
989 # WinCE
990 #######
991 package-wince-base: package-win-common-strip
992
993 package-wince-base-zip: package-wince-base
994 # Create package 
995         rm -f -- vlc-$(VERSION)-wince.zip
996         zip -r -9 vlc-$(VERSION)-wince.zip vlc-$(VERSION)
997
998 package-wince: package-wince-base-zip package-win32-cleanup
999
1000
1001 #####################################################################
1002 ##   BeOS                                                          ##
1003 #####################################################################
1004 package-beos:
1005 # Check that tmp isn't in the way
1006         @if test -e $(srcdir)/tmp; then \
1007           echo "Error: please remove $(srcdir)/tmp, it is in the way"; \
1008           false ; \
1009         else \
1010           echo "OK." ; mkdir $(srcdir)/tmp ; \
1011         fi
1012
1013 # Copy relevant files
1014         mkdir -p $(srcdir)/tmp/vlc
1015         cd $(srcdir) && cp -R vlc-bundle/* AUTHORS COPYING ChangeLog README \
1016           THANKS NEWS tmp/vlc/
1017
1018 # Create debug package
1019         xres -o $(srcdir)/tmp/vlc/vlc $(srcdir)/share/vlc_beos.rsrc
1020         find $(srcdir)/tmp/vlc -exec mimeset -f {} \;
1021         mv $(srcdir)/tmp/vlc $(srcdir)/tmp/vlc-$(VERSION)
1022         (cd $(srcdir)/tmp && zip -9 -r vlc-$(VERSION)-BeOS-debug.zip vlc-$(VERSION) )
1023         mv $(srcdir)/tmp/vlc-$(VERSION)-BeOS-debug.zip $(srcdir)/
1024         mv $(srcdir)/tmp/vlc-$(VERSION) $(srcdir)/tmp/vlc
1025
1026 # Create normal package
1027         $(STRIP) --strip-debug --strip-unneeded $(srcdir)/tmp/vlc/vlc
1028         find $(srcdir)/tmp/vlc -name 'lib*.so' -exec $(STRIP) \
1029           --strip-debug --strip-unneeded "{}" \;
1030         xres -o $(srcdir)/tmp/vlc/vlc $(srcdir)/share/vlc_beos.rsrc
1031         find $(srcdir)/tmp/vlc -exec mimeset -f {} \;
1032         mv $(srcdir)/tmp/vlc $(srcdir)/tmp/vlc-$(VERSION)
1033         (cd $(srcdir)/tmp &&  zip -9 -r vlc-$(VERSION)-BeOS.zip vlc-$(VERSION) )
1034         mv $(srcdir)/tmp/vlc-$(VERSION)-BeOS.zip $(srcdir)/
1035
1036 # Clean up
1037         rm -Rf $(srcdir)/tmp
1038
1039 #########################################################################
1040 ## MacOS X                                                             ##
1041 #########################################################################
1042 package-macosx: VLC-release.app ChangeLog
1043 # Check that the temporary location isn't in the way
1044         @if test -e "$(top_builddir)/vlc-$(VERSION)/"; then \
1045           rm -Rf "$(top_builddir)/vlc-$(VERSION)/" ; \
1046         fi
1047
1048         echo "Create package directory: vlc-$(VERSION)/";
1049         mkdir -p "$(top_builddir)/vlc-$(VERSION)/";
1050
1051 # Copy relevant files 
1052         @if test -e "$(top_builddir)/VLC-release.app/"; then \
1053           cp -R "$(top_builddir)/VLC-release.app" "$(top_builddir)/vlc-$(VERSION)/VLC.app"; \
1054         else \
1055           cp -R "$(top_builddir)/VLC.app" "$(top_builddir)/vlc-$(VERSION)/VLC.app"; \
1056         fi
1057         mkdir -p $(top_builddir)/vlc-$(VERSION)/Goodies/ && \
1058           mkdir -p $(top_builddir)/vlc-$(VERSION)/.background/ && \
1059           cp $(srcdir)/AUTHORS $(srcdir)/COPYING $(srcdir)/README $(srcdir)/THANKS $(srcdir)/NEWS $(top_builddir)/vlc-$(VERSION)/Goodies/ && \
1060           cp -R  $(srcdir)/extras/package/macosx/Delete_Preferences.app $(top_builddir)/vlc-$(VERSION)/Goodies/Delete\ VLC\ Preferences.app && \
1061           cp $(srcdir)/extras/package/macosx/README.MacOSX.rtf $(top_builddir)/vlc-$(VERSION)/Read\ Me.rtf && \
1062           cp $(srcdir)/extras/package/macosx/Resources/about_bg.png $(top_builddir)/vlc-$(VERSION)/.background/background.png
1063         cp -L $(top_builddir)/ChangeLog $(top_builddir)/vlc-$(VERSION)/Goodies/
1064
1065 # Place a link to the application folder
1066         ln -s /Applications $(top_builddir)/vlc-$(VERSION)/Applications
1067
1068 # Create disk image (temporarily taken from the 0.8.6-bugfix branch to provide reliable NBs)
1069         echo "Creating disk image"
1070         rm -f "$(top_builddir)/vlc-$(VERSION).dmg"
1071         hdiutil create -verbose -srcfolder "$(top_builddir)/vlc-$(VERSION)" \
1072           "$(top_builddir)/vlc-$(VERSION).dmg" -scrub
1073         echo "Disk image creation completed:"
1074         ls -la "$(top_builddir)/vlc-$(VERSION).dmg" ; echo
1075
1076 # Create disk image 
1077 #       echo "Creating disk image"
1078 #       rm -f "$(top_builddir)/vlc-$(VERSION).dmg"
1079 #       hdiutil create -verbose -srcfolder "$(top_builddir)/vlc-$(VERSION)" \
1080 #         "$(top_builddir)/vlc-$(VERSION).dmg" -format UDRW \
1081 #         -scrub -imagekey zlib-level=9 -attach
1082
1083 # Make sure the root window of the dmg will pop up when the dmg is mounted.
1084 # Note: We dont mount in /Volumes to be sure we won't collide with an other
1085 # finder mounted dmg with the same name.
1086 #       echo "Make sure the root window of the dmg will pop up when the dmg is mounted"
1087 #       mkdir -p $(top_builddir)/vlcmnt
1088 #       hdiutil attach -nokernel -readwrite -noverify -noautoopen -private "$(top_builddir)/vlc-$(VERSION).dmg" -mountpoint "$(top_builddir)/vlcmnt/vlc-$(VERSION)"
1089 #       bless --folder "$(top_builddir)/vlcmnt/vlc-$(VERSION)/" --openfolder "$(top_builddir)/vlcmnt/vlc-$(VERSION)"
1090 #       sleep 1 # Make sure operation completes
1091 #       cd "$(srcdir)"
1092
1093 # Unmount the image now
1094 #       hdiutil detach "$(top_builddir)/vlcmnt/vlc-$(VERSION)"
1095 #       rm -R $(top_builddir)/vlcmnt
1096
1097 # Make sure the image is not writable
1098 # Note: We can't directly create a read only dmg as we do the bless stuff
1099         echo "Make the disk image read-only"
1100         mv "$(top_builddir)/vlc-$(VERSION).dmg" "$(top_builddir)/vlc-$(VERSION)-rw.dmg"
1101         hdiutil convert "$(top_builddir)/vlc-$(VERSION)-rw.dmg" -format UDBZ -o "$(top_builddir)/vlc-$(VERSION).dmg"
1102         rm "$(top_builddir)/vlc-$(VERSION)-rw.dmg"
1103
1104 # We are done
1105         echo "Disk image creation completed:"
1106         ls -la "$(top_builddir)/vlc-$(VERSION).dmg" ; echo
1107
1108 # Clean up
1109         rm -Rf "$(top_builddir)/vlc-$(VERSION)"
1110
1111 package-macosx-zip: VLC-release.app
1112         rm -Rf $(top_builddir)/vlc-$(VERSION)
1113         mkdir -p $(top_builddir)/vlc-$(VERSION)
1114         cp -R $(top_builddir)/VLC-release.app $(top_builddir)/vlc-$(VERSION)/VLC.app
1115         mkdir -p $(top_builddir)/vlc-$(VERSION)/Goodies
1116         for i in AUTHORS COPYING ChangeLog README THANKS NEWS; do \
1117           cp $(srcdir)/$$i $(top_builddir)/vlc-$(VERSION)/Goodies; \
1118         done
1119         cp -R  $(srcdir)/extras/package/macosx/Delete_Preferences.app \
1120              $(top_builddir)/vlc-$(VERSION)/Goodies
1121         cp $(srcdir)/extras/package/macosx/README.MacOSX.rtf \
1122            $(top_builddir)/vlc-$(VERSION)/Read\ Me.rtf
1123         zip -r $(top_builddir)/vlc-$(VERSION).zip $(top_builddir)/vlc-$(VERSION)
1124         rm -Rf $(top_builddir)/vlc-$(VERSION)
1125
1126 package-macosx-framework-zip:
1127         rm -Rf $(top_builddir)/vlckit-$(VERSION)
1128         mkdir -p $(top_builddir)/vlckit-$(VERSION)
1129         cp -R $(srcdir)/projects/macosx/framework/build/Debug/VLCKit.framework \
1130           $(top_builddir)/vlckit-$(VERSION)/VLCKit.framework
1131         mkdir -p $(top_builddir)/vlc-$(VERSION)/Goodies
1132         for i in AUTHORS COPYING ChangeLog README THANKS NEWS; do \
1133           cp $(srcdir)/$$i $(top_builddir)/vlckit-$(VERSION)/Goodies; \
1134         done
1135         zip -r $(top_builddir)/vlckit-$(VERSION).zip $(top_builddir)/vlckit-$(VERSION)
1136         rm -Rf $(top_builddir)/vlc-$(VERSION)
1137
1138 package-macosx-plugin:
1139 if BUILD_MOZILLA
1140 # Create Installer
1141         rm -rf "$(top_builddir)/macosx-plugin-instdata/"; true
1142         mkdir -p "$(top_builddir)/macosx-plugin-instdata"
1143         rm -f "$(top_builddir)/projects/mozilla/VLC Plugin.plugin/Contents/MacOS/modules/libmacosx_plugin.dylib" 
1144         cp -R "$(top_builddir)/projects/mozilla/VLC Plugin.plugin" "$(top_builddir)/macosx-plugin-instdata"
1145         rm -rf "$(top_builddir)/VLC Internet Plug-In.pkg"
1146         export PACKAGEMAKER=
1147         if test -x /Developer/Tools/packagemaker; then \
1148            export PACKAGEMAKER=/Developer/Tools/packagemaker; \
1149         fi; \
1150         if test -x /Developer/Applications/Utilities/PackageMaker.app/Contents/MacOS/PackageMaker; then \
1151            export PACKAGEMAKER=/Developer/Applications/Utilities/PackageMaker.app/Contents/MacOS/PackageMaker; \
1152         fi; \
1153         $${PACKAGEMAKER} -build -ds -p "$(top_builddir)/VLC Internet Plug-In.pkg" \
1154         -f "$(top_builddir)/macosx-plugin-instdata" \
1155         -i "$(top_builddir)/extras/package/macosx/plugin/InstallerInfo.plist" \
1156         -d "$(top_srcdir)/extras/package/macosx/plugin/InstallerDescription.plist"; true
1157         rm -rf "$(top_builddir)/macosx-plugin-instdata/"
1158
1159 # Create disk image 
1160         rm -f "$(top_builddir)/vlc-plugin-$(VERSION).dmg"; true
1161         rm -rf "$(top_builddir)/vlc-plugin-$(VERSION)/"; true
1162         mkdir -p "$(top_builddir)/vlc-plugin-$(VERSION)/"
1163         mv "$(top_builddir)/VLC Internet Plug-In.pkg" "$(top_builddir)/vlc-plugin-$(VERSION)/"
1164         hdiutil create -srcfolder "$(top_builddir)/vlc-plugin-$(VERSION)" \
1165           "$(top_builddir)/vlc-plugin-$(VERSION).dmg" -format UDBZ \
1166           -scrub -imagekey zlib-level=9
1167         echo "Disk image creation completed:"
1168         rm -rf "$(top_builddir)/vlc-plugin-$(VERSION)"
1169 endif
1170
1171 package-macosx-xpi:
1172 if BUILD_MOZILLA
1173         mkdir -p "$(top_builddir)/macosx-xpi/plugins"
1174         cp $(top_builddir)/projects/mozilla/install.rdf \
1175                 "$(top_builddir)/macosx-xpi/"
1176         cp -R "$(top_builddir)/projects/mozilla/VLC Plugin.plugin" \
1177                 "$(top_builddir)/macosx-xpi/plugins"
1178         cd "$(top_builddir)/macosx-xpi" && zip -r vlc-$(VERSION).xpi install.rdf plugins
1179 endif
1180
1181 package-translations:
1182         @if test -e "$(srcdir)/vlc-translations-$(VERSION)"; then \
1183           echo "Error: please remove $(srcdir)/vlc-translations-$(VERSION), it is in the way"; \
1184           false; \
1185         else \
1186           echo "OK."; mkdir -p "$(srcdir)/vlc-translations-$(VERSION)"; \
1187         fi
1188 # Copy translations
1189         cat $(top_srcdir)/po/LINGUAS | while read i; do \
1190           cp "$(srcdir)/po/$${i}.po" \
1191             "$(srcdir)/vlc-translations-$(VERSION)/$${i}.po" \
1192             || true ; \
1193         done
1194         cp "$(srcdir)/doc/translations.txt" \
1195           "$(srcdir)/vlc-translations-$(VERSION)/README.txt"
1196
1197         echo "#!/bin/sh" >>"$(srcdir)/vlc-translations-$(VERSION)/convert.po.sh"
1198         echo "" >>"$(srcdir)/vlc-translations-$(VERSION)/convert.po.sh"
1199         echo 'if test $$# != 1; then' >>"$(srcdir)/vlc-translations-$(VERSION)/convert.po.sh"
1200         echo "  echo \"Usage: convert-po.sh <.po file>\"" >>"$(srcdir)/vlc-translations-$(VERSION)/convert.po.sh"
1201         echo "  exit 1" >>"$(srcdir)/vlc-translations-$(VERSION)/convert.po.sh"
1202         echo "fi" >>"$(srcdir)/vlc-translations-$(VERSION)/convert.po.sh"
1203         echo "" >>"$(srcdir)/vlc-translations-$(VERSION)/convert.po.sh"
1204         echo 'msgfmt --statistics -o vlc.mo $$1' >>"$(srcdir)/vlc-translations-$(VERSION)/convert.po.sh"
1205
1206         $(AMTAR) chof - $(srcdir)/vlc-translations-$(VERSION) \
1207           | GZIP=$(GZIP_ENV) gzip -c >$(srcdir)/vlc-translations-$(VERSION).tar.gz
1208
1209 ###############################################################################
1210 # PO translation files update
1211 ###############################################################################
1212 .PHONY: update-po
1213
1214 update-po:
1215         cd po && $(MAKE) POTFILES vlc.pot update-po
1216
1217
1218 ###############################################################################
1219 # Enforce Mac OS X deployment target environment variable
1220 ###############################################################################
1221 macosx-sdk: Makefile.in $(HEADERS_include) vlc-config
1222         export MACOSX_DEPLOYMENT_TARGET=$(MACOSX_DEPLOYMENT_TARGET)