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