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