4e608f1eba51a7ef1620373bed42306f93e99e9a
[vlc.git] / Makefile.am
1 ###############################################################################
2 # Automake targets and declarations
3 ###############################################################################
4
5 NULL =
6
7 # SUBDIRS stores the directories where a "make" is required when building
8 # something. DIST_SUBDIRS stores the directories where nothing is built but
9 # which have makefiles with distribution information.
10 #  - intl should come before modules and . because all the code uses gettext
11 #  - modules should come before . because vlc needs the builtins
12 #  - . should come before mozilla because the plugin needs libvlc_pic.a
13 #  - po should come before . because VLC.app needs the pofiles
14 #  - loader should come before modules because some plugins need it
15 SUBDIRS = intl loader modules po . mozilla activex share m4 doc
16 DIST_SUBDIRS = $(SUBDIRS) src debian ipkg lib
17
18 EXTRA_DIST = \
19         HACKING \
20         INSTALL.win32 \
21         vlc.exe.manifest \
22         MAINTAINERS \
23         README.MacOSX.rtf \
24         bootstrap \
25         src/extras/COPYING \
26         toolbox \
27         vlc-api.pl \
28         vlc-config.in.in \
29         vlc.spec \
30         vlc.spec.mdk \
31         vlc.win32.nsi \
32         $(NULL)
33
34 BUILT_SOURCES =
35 SUFFIXES = 
36
37 # Tell aclocal to use -I m4. Wonder if it really works.
38 ACLOCAL_AMFLAGS = -I m4
39
40 # XXX: these flags could be set in configure.ac, but we set them here
41 # because old versions of automake don't support them in configure.ac.
42 AUTOMAKE_OPTIONS = dist-bzip2 subdir-objects
43
44 ###############################################################################
45 # Headers
46 ###############################################################################
47
48 BUILT_SOURCES += \
49         stamp-api \
50         src/misc/modules_builtin.h \
51         $(NULL)
52
53 pkgincludedir = $(includedir)/vlc
54
55 dist_pkginclude_HEADERS = \
56         include/vlc/vlc.h \
57         include/vlc/aout.h \
58         include/vlc/vout.h \
59         include/vlc/sout.h \
60         include/vlc/decoder.h \
61         include/vlc/input.h \
62         include/vlc/intf.h \
63         include/vlc/control.h \
64         $(NULL)
65
66 noinst_HEADERS = $(HEADERS_include)
67
68 HEADERS_include = \
69         include/aout_internal.h \
70         include/audio_output.h \
71         include/beos_specific.h \
72         include/charset.h \
73         include/codecs.h \
74         include/configuration.h \
75         include/darwin_specific.h \
76         include/intf_eject.h \
77         include/iso_lang.h \
78         include/main.h \
79         include/mmx.h \
80         include/modules.h \
81         include/modules_inner.h \
82         include/mtime.h \
83         include/network.h \
84         include/osd.h \
85         include/os_specific.h \
86         include/snapshot.h \
87         include/stream_output.h \
88         include/variables.h \
89         include/video_output.h \
90         include/vlc_access.h \
91         include/vlc_acl.h \
92         include/vlc_bits.h \
93         include/vlc_block.h \
94         include/vlc_block_helper.h \
95         include/vlc_codec.h \
96         include/vlc_common.h \
97         include/vlc_config.h \
98         include/vlc_cpu.h \
99         include/vlc_demux.h \
100         include/vlc_error.h \
101         include/vlc_es.h \
102         include/vlc_es_out.h \
103         include/vlc_filter.h \
104         include/vlc_config_cat.h \
105         include/vlc_httpd.h \
106         include/vlc_tls.h \
107         include/vlc_md5.h \
108         include/vlc_image.h \
109         include/vlc_input.h \
110         include/vlc_interface.h \
111         include/vlc_keys.h \
112         include/vlc_messages.h \
113         include/vlc_meta.h \
114         include/vlc_objects.h \
115         include/vlc_osd.h \
116         include/vlc_playlist.h \
117         include/vlc_spu.h \
118         include/vlc_stream.h \
119         include/vlc_symbols.h \
120         include/vlc_threads_funcs.h \
121         include/vlc_threads.h \
122         include/vlc_video.h \
123         include/vlc_vlm.h \
124         include/vlc_vod.h \
125         include/vlc_xml.h \
126         include/vout_synchro.h \
127         include/win32_specific.h \
128         $(NULL)
129
130 src/misc/modules_builtin.h: Makefile src/misc/modules_builtin.h.in vlc-config
131         srcdir=$(srcdir) $(srcdir)/toolbox --update-includes
132         touch $@
133
134 # These dependencies are mandatory
135 $(SOURCES_libvlc): src/misc/modules_builtin.h $(LIB_intl)
136
137 ###############################################################################
138 # Optional libintl - FIXME, bad dependencies
139 ###############################################################################
140
141 intl/libintl.a: FORCE
142         cd $(top_builddir)/intl && $(MAKE) $(AM_MAKEFLAGS)
143
144 if BUILD_INTL
145 LIB_intl = intl/libintl.a
146 endif
147
148 ###############################################################################
149 # MacOS X project
150 ###############################################################################
151
152 EXTRA_DIST += \
153         extras/MacOSX/Resources/English.lproj/MainMenu.nib/classes.nib \
154         extras/MacOSX/Resources/English.lproj/MainMenu.nib/info.nib \
155         extras/MacOSX/Resources/English.lproj/MainMenu.nib/keyedobjects.nib \
156         extras/MacOSX/Resources/English.lproj/About.nib/classes.nib \
157         extras/MacOSX/Resources/English.lproj/About.nib/info.nib \
158         extras/MacOSX/Resources/English.lproj/About.nib/keyedobjects.nib \
159         extras/MacOSX/Resources/English.lproj/Open.nib/classes.nib \
160         extras/MacOSX/Resources/English.lproj/Open.nib/info.nib \
161         extras/MacOSX/Resources/English.lproj/Open.nib/keyedobjects.nib \
162         extras/MacOSX/Resources/English.lproj/Preferences.nib/classes.nib \
163         extras/MacOSX/Resources/English.lproj/Preferences.nib/info.nib \
164         extras/MacOSX/Resources/English.lproj/Preferences.nib/keyedobjects.nib \
165         extras/MacOSX/Resources/English.lproj/Wizard.nib/classes.nib \
166         extras/MacOSX/Resources/English.lproj/Wizard.nib/info.nib \
167         extras/MacOSX/Resources/English.lproj/Wizard.nib/keyedobjects.nib \
168         extras/MacOSX/Resources/English.lproj/Bookmarks.nib/classes.nib \
169         extras/MacOSX/Resources/English.lproj/Bookmarks.nib/info.nib \
170         extras/MacOSX/Resources/English.lproj/Bookmarks.nib/keyedobjects.nib \
171         extras/MacOSX/Resources/English.lproj/InfoPlist.strings \
172         extras/MacOSX/Resources/a52.icns \
173         extras/MacOSX/Resources/aac.icns \
174         extras/MacOSX/Resources/asf.icns \
175         extras/MacOSX/Resources/asx.icns \
176         extras/MacOSX/Resources/avi.icns \
177         extras/MacOSX/Resources/bin.icns \
178         extras/MacOSX/Resources/cue.icns \
179         extras/MacOSX/Resources/dat.icns \
180         extras/MacOSX/Resources/divx.icns \
181         extras/MacOSX/Resources/dv.icns \
182         extras/MacOSX/Resources/generic.icns \
183         extras/MacOSX/Resources/m3u.icns \
184         extras/MacOSX/Resources/mov.icns \
185         extras/MacOSX/Resources/mp3.icns \
186         extras/MacOSX/Resources/mp4.icns \
187         extras/MacOSX/Resources/mpeg.icns \
188         extras/MacOSX/Resources/mpeg1.icns \
189         extras/MacOSX/Resources/mpeg2.icns \
190         extras/MacOSX/Resources/mpeg4.icns \
191         extras/MacOSX/Resources/mpg.icns \
192         extras/MacOSX/Resources/ogg.icns \
193         extras/MacOSX/Resources/ogm.icns \
194         extras/MacOSX/Resources/pls.icns \
195         extras/MacOSX/Resources/srt.icns \
196         extras/MacOSX/Resources/sub.icns \
197         extras/MacOSX/Resources/vlc.icns \
198         extras/MacOSX/Resources/vob.icns \
199         extras/MacOSX/Resources/wma.icns \
200         extras/MacOSX/Resources/wmv.icns \
201         extras/MacOSX/Resources/pause.png \
202         extras/MacOSX/Resources/pause_blue.png \
203         extras/MacOSX/Resources/play.png \
204         extras/MacOSX/Resources/play_blue.png \
205         extras/MacOSX/Resources/stop.png \
206         extras/MacOSX/Resources/stop_blue.png \
207         extras/MacOSX/Resources/display.png \
208         extras/MacOSX/Resources/display_slider.png \
209         extras/MacOSX/Resources/display_track.png \
210         extras/MacOSX/Resources/equalizerdrawer_active.png \
211         extras/MacOSX/Resources/equalizerdrawer_blue.png \
212         extras/MacOSX/Resources/fullscreen_active.png \
213         extras/MacOSX/Resources/fullscreen_blue.png \
214         extras/MacOSX/Resources/next_active.png \
215         extras/MacOSX/Resources/next_blue.png \
216         extras/MacOSX/Resources/playlistdrawer_active.png \
217         extras/MacOSX/Resources/playlistdrawer_blue.png \
218         extras/MacOSX/Resources/previous_active.png \
219         extras/MacOSX/Resources/previous_blue.png \
220         extras/MacOSX/Resources/skip_forward_active.png \
221         extras/MacOSX/Resources/skip_forward_blue.png \
222         extras/MacOSX/Resources/skip_previous_active.png \
223         extras/MacOSX/Resources/skip_previous_blue.png \
224         extras/MacOSX/Resources/volume_high.png \
225         extras/MacOSX/Resources/volume_low.png \
226         extras/MacOSX/Resources/volumeslider_blue.png \
227         extras/MacOSX/Resources/volumeslider_normal.png \
228         extras/MacOSX/Resources/volumetrack.png \
229         extras/MacOSX/Resources/about_bg.png \
230         extras/MacOSX/Resources/vlc.scriptSuite \
231         extras/MacOSX/Resources/vlc.scriptTerminology \
232         extras/MacOSX/Resources/README \
233         extras/MacOSX/vlc.pbproj/project.pbxproj \
234         extras/MacOSX/macosx-dmg \
235         \
236         extras/Makefile \
237         extras/zsh.cpp \
238         $(NULL)
239
240 ###############################################################################
241 # MS Visual Studio and eMbedded Visual Studio projects
242 ###############################################################################
243
244 EXTRA_DIST += \
245         msvc/vlc.dsw \
246         msvc/libvlc.dsp.in \
247         msvc/plugins.dsp.in \
248         msvc/vlc.dsp.in \
249         msvc/config.h.in \
250         msvc/modules_builtin_msvc.h \
251         evc/vlc.vcw \
252         evc/libvlc.vcp.in \
253         evc/vlc.vcp.in \
254         evc/plugins.vcp.in \
255         evc/errno.h \
256         evc/config.h.in \
257         evc/modules_builtin_evc.h \
258         $(NULL)
259
260 dist-hook:
261         cd $(distdir) && srcdir=$(srcdir) $(srcdir)/toolbox --update-vc
262         distdir=$(distdir) srcdir=$(srcdir) $(srcdir)/toolbox --dist-contrib
263
264 ###############################################################################
265 # Building libvlc
266 ###############################################################################
267
268 bin_SCRIPTS = vlc-config
269 vlc-config: $(top_builddir)/config.status $(top_builddir)/vlc-config.in
270         cd $(top_builddir) && $(SHELL) ./config.status --file=$@
271         -cd $(top_builddir) && chmod 0755 $@
272
273 vlc-config.in: vlc-config.in.in
274         ./config.status --recheck
275
276 $(SOURCES): vlc-config
277
278 CLEANFILES = $(BUILT_SOURCES)
279
280 lib_LIBRARIES = lib/libvlc.a $(LIBRARIES_libvlc_pic)
281
282 lib_libvlc_a_SOURCES = $(SOURCES_libvlc)
283 lib_libvlc_a_CFLAGS = `$(VLC_CONFIG) --cflags vlc`
284 lib_libvlc_a_CXXFLAGS = `$(VLC_CONFIG) --cxxflags vlc`
285 lib_libvlc_a_OBJCFLAGS = `$(VLC_CONFIG) --objcflags vlc`
286
287 lib_libvlc_pic_a_SOURCES = $(SOURCES_libvlc)
288 lib_libvlc_pic_a_CFLAGS = `$(VLC_CONFIG) --cflags vlc pic`
289 lib_libvlc_pic_a_CXXFLAGS = `$(VLC_CONFIG) --cxxflags vlc pic`
290 lib_libvlc_pic_a_OBJCFLAGS = `$(VLC_CONFIG) --objcflags vlc pic`
291
292 if HAVE_BEOS
293 OPT_SOURCES_libvlc_beos = $(SOURCES_libvlc_beos)
294 endif
295 if HAVE_DARWIN
296 OPT_SOURCES_libvlc_darwin = $(SOURCES_libvlc_darwin)
297 endif
298 if HAVE_WIN32
299 OPT_SOURCES_libvlc_win32 = $(SOURCES_libvlc_win32)
300 endif
301 if HAVE_WINCE
302 OPT_SOURCES_libvlc_win32 = $(SOURCES_libvlc_win32)
303 endif
304 if BUILD_DIRENT
305 OPT_SOURCES_libvlc_dirent = $(SOURCES_libvlc_dirent)
306 endif
307 if BUILD_GETOPT
308 OPT_SOURCES_libvlc_getopt = $(SOURCES_libvlc_getopt)
309 endif
310 if BUILD_MOZILLA
311 if !HAVE_WIN32
312 LIBRARIES_libvlc_pic = lib/libvlc_pic.a
313 endif
314 endif
315
316 EXTRA_DIST += \
317         $(SOURCES_libvlc_beos) \
318         $(SOURCES_libvlc_darwin) \
319         $(SOURCES_libvlc_win32) \
320         $(SOURCES_libvlc_dirent) \
321         $(SOURCES_libvlc_getopt) \
322         $(NULL)
323
324 SOURCES_libvlc_beos = \
325         src/misc/beos_specific.cpp \
326         $(NULL)
327
328 SOURCES_libvlc_darwin = \
329         src/misc/darwin_specific.m \
330         $(NULL)
331
332 SOURCES_libvlc_win32 = \
333         src/misc/win32_specific.c \
334         $(NULL)
335
336 SOURCES_libvlc_dirent = \
337         src/extras/dirent.c \
338         $(NULL)
339
340 SOURCES_libvlc_getopt = \
341         src/extras/getopt.c \
342         src/extras/getopt.h \
343         src/extras/getopt1.c \
344         $(NULL)
345
346 SOURCES_libvlc_common = \
347         src/libvlc.c \
348         src/libvlc.h \
349         src/interface/interface.c \
350         src/interface/intf_eject.c \
351         src/playlist/playlist.c \
352         src/playlist/sort.c \
353         src/playlist/loadsave.c \
354         src/playlist/view.c \
355         src/playlist/item.c \
356         src/playlist/item-ext.c \
357         src/playlist/services_discovery.c \
358         src/input/access.c \
359         src/input/clock.c \
360         src/input/control.c \
361         src/input/decoder.c \
362         src/input/demux.c \
363         src/input/es_out.c \
364         src/input/input.c \
365         src/input/input_internal.h \
366         src/input/stream.c \
367         src/input/mem_stream.c \
368         src/input/subtitles.c \
369         src/input/var.c \
370         src/video_output/video_output.c \
371         src/video_output/vout_pictures.c \
372         src/video_output/vout_pictures.h \
373         src/video_output/video_text.c \
374         src/video_output/video_widgets.c \
375         src/video_output/vout_subpictures.c \
376         src/video_output/vout_synchro.c \
377         src/video_output/vout_intf.c \
378         src/audio_output/common.c \
379         src/audio_output/dec.c \
380         src/audio_output/filters.c \
381         src/audio_output/input.c \
382         src/audio_output/mixer.c \
383         src/audio_output/output.c \
384         src/audio_output/intf.c \
385         src/stream_output/stream_output.c \
386         src/stream_output/announce.c \
387         src/stream_output/sap.c \
388         src/stream_output/acl.c \
389         src/osd/osd.c \
390         src/osd/osd_widgets.c \
391         src/osd/osd_parser.c \
392         src/misc/charset.c \
393         src/misc/httpd.c \
394         src/misc/tls.c \
395         src/misc/md5.c \
396         src/misc/mtime.c \
397         src/misc/block.c \
398         src/misc/modules.c \
399         src/misc/threads.c \
400         src/misc/unicode.c \
401         src/misc/cpu.c \
402         src/misc/configuration.c \
403         src/misc/image.c \
404         src/misc/iso_lang.c \
405         src/misc/iso-639_def.h \
406         src/misc/messages.c \
407         src/misc/objects.c \
408         src/misc/variables.c \
409         src/misc/error.c \
410         src/misc/net.c \
411         src/misc/getaddrinfo.c \
412         src/misc/vlm.c \
413         src/misc/xml.c \
414         src/extras/libc.c \
415         src/control/core.c \
416         src/control/util.c \
417         src/control/audio_video.c \
418         $(NULL)
419
420 SOURCES_libvlc = \
421         $(SOURCES_libvlc_common) \
422         $(OPT_SOURCES_libvlc_beos) \
423         $(OPT_SOURCES_libvlc_darwin) \
424         $(OPT_SOURCES_libvlc_win32) \
425         $(OPT_SOURCES_libvlc_dirent) \
426         $(OPT_SOURCES_libvlc_getopt) \
427         $(NULL)
428
429 ###############################################################################
430 # Building vlc
431 ###############################################################################
432
433 bin_PROGRAMS = vlc
434
435 vlc_SOURCES = src/vlc.c
436
437 # Work around a bug in the arm-wince-pe linker
438 if HAVE_WINCE
439 vlc_WORKAROUNDLDFLAGS = lib/libvlc.a
440 endif
441
442 vlc_LDFLAGS = `$(VLC_CONFIG) --libs vlc builtin` $(vlc_WORKAROUNDLDFLAGS)
443 vlc_LDADD = lib/libvlc.a $(DATA_win32_rc) $(LIB_intl)
444 vlc_CFLAGS = `$(VLC_CONFIG) --cflags vlc`
445
446 # We use DEPENDENCIES_vlc instead of vlc_DEPENDENCIES because of an
447 # old automake-1.5 bug (automake/279).
448 DEPENDENCIES_vlc = lib/libvlc.a $(DATA_win32_rc) $(LIB_intl)
449
450 vlc$(EXEEXT): $(vlc_OBJECTS) $(DEPENDENCIES_vlc) stamp-builtin
451         @rm -f $(top_builddir)/vlc$(EXEEXT)
452         @case `$(VLC_CONFIG) --linkage vlc builtin` in \
453           c++) echo $(CXXLINK) $(vlc_OBJECTS) $(vlc_LDFLAGS) $(LIBS) ; $(CXXLINK) $(vlc_OBJECTS) $(vlc_LDADD) $(vlc_LDFLAGS) $(LIBS) $(vlc_LDADD) ;; \
454           objc) echo $(OBJCLINK) $(vlc_OBJECTS) $(vlc_LDFLAGS) $(LIBS) ; $(OBJCLINK) $(vlc_OBJECTS) $(vlc_LDADD) $(vlc_LDFLAGS) $(LIBS) $(vlc_LDADD) ;; \
455           c|*) echo $(LINK) $(vlc_OBJECTS) $(vlc_LDFLAGS) $(LIBS) ; $(LINK) $(vlc_OBJECTS) $(vlc_LDADD) $(vlc_LDFLAGS) $(LIBS) $(vlc_LDADD) ;; \
456         esac
457
458 if HAVE_BEOS
459 noinst_DATA = vlc-bundle
460 vlc-bundle: vlc
461         rm -Rf $(top_builddir)/vlc-bundle ; mkdir -p $(top_builddir)/vlc-bundle
462         cp $(top_builddir)/vlc $(top_builddir)/vlc-bundle/
463         xres -o $(top_builddir)/vlc-bundle/vlc $(srcdir)/share/vlc_beos.rsrc
464         for i in "" `$(VLC_CONFIG) --target plugin` ; do \
465           if test -n "$$i" ; then \
466             mkdir -p $(top_builddir)/vlc-bundle/plugins ; \
467             cp "$$i$(LIBEXT)" $(top_builddir)/vlc-bundle/plugins/ ; \
468           fi ; \
469         done
470         if test -d $(top_builddir)/extras/contrib/vlc-lib ; then \
471           mkdir -p $(top_builddir)/vlc-bundle/lib ; \
472           for i in $(top_builddir)/extras/contrib/vlc-lib/*.so ; do \
473             cp $$i $(top_builddir)/vlc-bundle/lib/ ; \
474           done ; \
475         fi
476         for i in $(ALL_LINGUAS); do \
477           mkdir -p "$(top_builddir)/vlc-bundle/locale/$$i/LC_MESSAGES" ; \
478           cp "$(top_builddir)/po/$$i.gmo" \
479             "$(top_builddir)/vlc-bundle/locale/$$i/LC_MESSAGES/vlc.mo" || true ; \
480         done
481         find $(top_builddir)/vlc-bundle -type f -exec mimeset -f "{}" \;
482 endif
483
484 # Install the modules and the symlinks
485 install-exec-local:
486         for i in "" `$(VLC_CONFIG) --target plugin` ; do if test -n "$$i" ; then \
487           echo $(INSTALL) -m 755 "$$i$(LIBEXT)" "$(DESTDIR)$(libdir)/vlc/`echo $$i | sed -e 's,.*modules/\([^/]*\).*,\1,'`" ; \
488           $(INSTALL) -m 755 "$$i$(LIBEXT)" "$(DESTDIR)$(libdir)/vlc/`echo $$i | sed -e 's,.*modules/\([^/]*\).*,\1,'`" ; \
489         fi ; done
490         for i in "" `$(VLC_CONFIG) --target builtin` ; do if test -n "$$i" ; then \
491           echo $(INSTALL) -m 644 "$$i" "$(DESTDIR)$(libdir)/vlc" ; \
492           $(INSTALL) -m 644 "$$i" "$(DESTDIR)$(libdir)/vlc" ; \
493         fi ; done
494 if BUILD_MOZILLA
495         for i in "" `$(VLC_CONFIG) --target builtin pic` ; do if test -n "$$i" ; then \
496           echo $(INSTALL) -m 644 "$$i" "$(DESTDIR)$(libdir)/vlc" ; \
497           $(INSTALL) -m 644 "$$i" "$(DESTDIR)$(libdir)/vlc" ; \
498         fi ; done
499 endif
500         for i in "" $(ALIASES) ; do if test -n "$$i" ; then \
501           rm -f "$(DESTDIR)$(bindir)/$$i" && \
502           ln -s vlc "$(DESTDIR)$(bindir)/$$i" ; \
503         fi ; done
504
505 # the opposite of install-{data,exec}-local
506 uninstall-local:
507         @for i in "" `$(VLC_CONFIG) --target plugin` ; do if test -n "$$i" ; then \
508           echo rm -f "$(DESTDIR)$(libdir)/vlc/`echo $$i | sed -e 's,.*modules/\([^/]*\).*,\1,'`/$$(basename $$i$(LIBEXT))" ; \
509           rm -f "$(DESTDIR)$(libdir)/vlc/`echo $$i | sed -e 's,.*modules/\([^/]*\).*,\1,'`/$$(basename $$i$(LIBEXT))" ; \
510         fi ; done
511         @for i in "" `$(VLC_CONFIG) --target builtin` ; do if test -n "$$i" ; then \
512           echo rm -f "$(DESTDIR)$(libdir)/vlc/$$(basename $$i)" ; \
513           rm -f "$(DESTDIR)$(libdir)/vlc/$$(basename $$i)" ; \
514         fi ; done
515 if BUILD_MOZILLA
516         @for i in "" `$(VLC_CONFIG) --target builtin pic` ; do if test -n "$$i" ; then \
517           echo rm -f "$$i" "$(DESTDIR)$(libdir)/vlc/$$(basename $$i)" ; \
518           rm -f "$$i" "$(DESTDIR)$(libdir)/vlc/$$(basename $$i)" ; \
519         fi ; done
520 endif
521         for i in "" $(ALIASES) ; do if test -n "$$i" ; then \
522           rm -f "$(DESTDIR)$(bindir)/$$i" ; \
523         fi ; done
524
525 if HAVE_DARWIN
526 # Create the MacOS X app
527 vlc_app_DATA = VLC.app
528 vlc_appdir = $(bindir)
529 # VLC-release.app is the old VLC.app target
530 VLC-release.app: vlc
531         @if test -e "$(top_builddir)/tmp"; then \
532           echo "Error: please remove $(top_builddir)/tmp, it is in the way"; \
533           false; \
534         else \
535           echo "OK."; mkdir -p "$(top_builddir)/tmp/extras"; \
536         fi
537         rm -Rf $(top_builddir)/VLC-release.app
538         cp -r $(srcdir)/extras/MacOSX $(top_builddir)/tmp/extras
539         for i in AUTHORS COPYING README.MacOSX.rtf THANKS; do \
540           cp "$(srcdir)/$$i" $(top_builddir)/tmp; \
541         done
542         mkdir -p $(top_builddir)/tmp/modules/audio_output
543         cp $(srcdir)/modules/audio_output/coreaudio.c \
544            $(top_builddir)/tmp/modules/audio_output/coreaudio.c
545         mkdir -p $(top_builddir)/tmp/modules/gui/macosx
546         for i in \
547             about.h \
548             about.m \
549             applescript.h \
550             applescript.m \
551             controls.h \
552             controls.m \
553             equalizer.h \
554             equalizer.m \
555             intf.h \
556             intf.m \
557             macosx.m \
558             misc.h \
559             misc.m \
560             open.h \
561             open.m \
562             output.h \
563             output.m \
564             playlist.h \
565             playlist.m \
566             playlistinfo.h \
567             playlistinfo.m \
568             prefs_widgets.h \
569             prefs_widgets.m \
570             prefs.h \
571             prefs.m \
572             vout.h \
573             voutqt.m \
574             voutgl.m \
575             wizard.h \
576             wizard.m \
577             extended.h \
578             extended.m \
579         bookmarks.h \
580         bookmarks.m \
581             vout.m; do \
582           cp "$(srcdir)/modules/gui/macosx/$$i" \
583              $(top_builddir)/tmp/modules/gui/macosx; \
584         done
585         case $(target_triplet) in \
586           *darwin6*) cd $(top_builddir)/tmp/extras/MacOSX && pbxbuild -target vlc | grep -v '^\([ \t]\|$$\)'; \
587             cd ../../../; \
588             cp -r $(top_builddir)/tmp/extras/MacOSX/build/VLC.bundle \
589                   $(top_builddir)/VLC-release.app;; \
590           *darwin7*) cd $(top_builddir)/tmp/extras/MacOSX && xcodebuild -target vlc | grep -v '^\([ \t]\|$$\)'; \
591             cd ../../../; \
592             cp -r $(top_builddir)/tmp/extras/MacOSX/build/VLC.bundle \
593                   $(top_builddir)/VLC-release.app;; \
594           *darwin8*) cd $(top_builddir)/tmp/extras/MacOSX && xcodebuild -target vlc | grep -v '^\([ \t]\|$$\)'; \
595             cd ../../../; \
596             cp -r $(top_builddir)/tmp/extras/MacOSX/build/Default/VLC.bundle \
597                   $(top_builddir)/VLC-release.app;; \
598         esac
599         rm -Rf $(top_builddir)/tmp
600         $(INSTALL) -d $(top_builddir)/VLC-release.app/Contents/MacOS
601         $(INSTALL) $(top_builddir)/vlc \
602                    $(top_builddir)/VLC-release.app/Contents/MacOS/VLC
603         ln -sf ./VLC $(top_builddir)/VLC-release.app/Contents/MacOS/clivlc
604         $(INSTALL) -d $(top_builddir)/VLC-release.app/Contents/MacOS/modules
605         for i in "" `$(VLC_CONFIG) --target plugin` ; do \
606           if test -n "$$i" ; \
607             then $(INSTALL) "$$i$(LIBEXT)" \
608                            "$(top_builddir)/VLC-release.app/Contents/MacOS/modules" ; \
609           fi ; done
610         if test -d $(top_builddir)/extras/contrib/vlc-lib; then \
611           mkdir -p $(top_builddir)/VLC-release.app/Contents/MacOS/lib ; \
612           for i in $(top_builddir)/extras/contrib/vlc-lib/*.dylib ; do \
613             $(INSTALL) -m 644 $${i} $(top_builddir)/VLC-release.app/Contents/MacOS/lib/vlc_`basename $${i}` ; \
614           done ; \
615         fi
616         $(INSTALL) -d $(top_builddir)/VLC-release.app/Contents/MacOS/share
617         $(INSTALL) -d $(top_builddir)/VLC-release.app/Contents/MacOS/share/http
618         for i in $(srcdir)/share/http/* ; do \
619           $(INSTALL) -m 644 $${i} $(top_builddir)/VLC-release.app/Contents/MacOS/share/http/`basename $${i}` ; \
620         done ; \
621         $(INSTALL) -d $(top_builddir)/VLC-release.app/Contents/MacOS/share/http/vlm
622         for i in $(srcdir)/share/http/vlm/* ; do \
623           $(INSTALL) -m 644 $${i} $(top_builddir)/VLC-release.app/Contents/MacOS/share/http/vlm/`basename $${i}` ; \
624         done ; \
625         $(INSTALL) -d $(top_builddir)/VLC-release.app/Contents/MacOS/share/http/admin
626         for i in $(srcdir)/share/http/admin/* ; do \
627           $(INSTALL) -m 644 $${i} $(top_builddir)/VLC-release.app/Contents/MacOS/share/http/admin/`basename $${i}` ; \
628         done ; \
629         $(INSTALL) -m 644 $(srcdir)/share/http/admin/.access $(top_builddir)/VLC-release.app/Contents/MacOS/share/http/admin/.access
630         $(INSTALL) -d $(top_builddir)/VLC-release.app/Contents/MacOS/locale
631         for i in $(ALL_LINGUAS); do \
632           mkdir -p $(top_builddir)/VLC-release.app/Contents/MacOS/locale/$${i}/LC_MESSAGES ; \
633           cp $(srcdir)/po/$${i}.gmo $(top_builddir)/VLC-release.app/Contents/MacOS/locale/$${i}/LC_MESSAGES/vlc.mo || true ; \
634           mkdir -p $(top_builddir)/VLC-release.app/Contents/Resources/$${i}.lproj ; \
635           ln -sf ../English.lproj/InfoPlist.strings \
636               $(top_builddir)/VLC-release.app/Contents/Resources/$${i}.lproj ; \
637           ln -sf ../English.lproj/MainMenu.nib \
638               $(top_builddir)/VLC-release.app/Contents/Resources/$${i}.lproj ; \
639           ln -sf ../English.lproj/vlc.scriptTerminology \
640               $(top_builddir)/VLC-release.app/Contents/Resources/$${i}.lproj ; \
641         done
642         printf "APPLVLC#" >| $(top_builddir)/VLC-release.app/Contents/PkgInfo
643
644 VLC.app: vlc
645         @if test -e "$(top_builddir)/tmp"; then \
646           echo "Error: please remove $(top_builddir)/tmp, it is in the way"; \
647           false; \
648         else \
649           echo "OK."; mkdir -p "$(top_builddir)/tmp/extras"; \
650         fi
651         rm -Rf $(top_builddir)/VLC.app
652         cp -r $(srcdir)/extras/MacOSX $(top_builddir)/tmp/extras
653         for i in AUTHORS COPYING README.MacOSX.rtf THANKS; do \
654           cp "$(srcdir)/$$i" $(top_builddir)/tmp; \
655         done
656         mkdir -p $(top_builddir)/tmp/modules/audio_output
657         cp $(srcdir)/modules/audio_output/coreaudio.c \
658            $(top_builddir)/tmp/modules/audio_output/coreaudio.c
659         mkdir -p $(top_builddir)/tmp/modules/gui/macosx
660         for i in \
661             about.h \
662             about.m \
663             applescript.h \
664             applescript.m \
665             controls.h \
666             controls.m \
667             equalizer.h \
668             equalizer.m \
669             intf.h \
670             intf.m \
671             macosx.m \
672             misc.h \
673             misc.m \
674             open.h \
675             open.m \
676             output.h \
677             output.m \
678             playlist.h \
679             playlist.m \
680             playlistinfo.h \
681             playlistinfo.m \
682             prefs_widgets.h \
683             prefs_widgets.m \
684             prefs.h \
685             prefs.m \
686             vout.h \
687             voutqt.m \
688             voutgl.m \
689             wizard.h \
690             wizard.m \
691             extended.h \
692             extended.m \
693         bookmarks.h \
694         bookmarks.m \
695             vout.m; do \
696           cp "$(srcdir)/modules/gui/macosx/$$i" \
697              $(top_builddir)/tmp/modules/gui/macosx; \
698         done
699         case $(target_triplet) in \
700           *darwin6*) cd $(top_builddir)/tmp/extras/MacOSX && pbxbuild -target vlc | grep -v '^\([ \t]\|$$\)'; \
701             cd ../../../; \
702             cp -r $(top_builddir)/tmp/extras/MacOSX/build/VLC.bundle \
703                   $(top_builddir)/VLC.app;; \
704           *darwin7*) cd $(top_builddir)/tmp/extras/MacOSX && xcodebuild -target vlc | grep -v '^\([ \t]\|$$\)'; \
705             cd ../../../; \
706             cp -r $(top_builddir)/tmp/extras/MacOSX/build/VLC.bundle \
707                   $(top_builddir)/VLC.app;; \
708           *darwin8*) cd $(top_builddir)/tmp/extras/MacOSX && xcodebuild -target vlc | grep -v '^\([ \t]\|$$\)'; \
709             cd ../../../; \
710             cp -r $(top_builddir)/tmp/extras/MacOSX/build/Default/VLC.bundle \
711                   $(top_builddir)/VLC.app;; \
712         esac
713         rm -Rf $(top_builddir)/tmp
714         $(INSTALL) -d $(top_builddir)/VLC.app/Contents/MacOS
715         $(INSTALL) $(top_builddir)/vlc \
716                    $(top_builddir)/VLC.app/Contents/MacOS/VLC
717         ln -sf ./VLC $(top_builddir)/VLC.app/Contents/MacOS/clivlc
718         $(INSTALL) -d $(top_builddir)/VLC.app/Contents/MacOS/modules
719         for i in "" `$(VLC_CONFIG) --target plugin` ; do \
720           if test -n "$$i" ; \
721             then ln -sfn "`pwd`/$$i$(LIBEXT)" \
722                            "$(top_builddir)/VLC.app/Contents/MacOS/modules" ; \
723           fi ; done
724         if test -d $(top_builddir)/extras/contrib/vlc-lib; then \
725           mkdir -p $(top_builddir)/VLC.app/Contents/MacOS/lib ; \
726           for i in $(top_builddir)/extras/contrib/vlc-lib/*.dylib ; do \
727             ln -sfn `pwd`/$${i} $(top_builddir)/VLC.app/Contents/MacOS/lib/vlc_`basename $${i}` ; \
728           done ; \
729         fi
730         ln -sfn `pwd`/share $(top_builddir)/VLC.app/Contents/MacOS/
731         $(INSTALL) -d $(top_builddir)/VLC.app/Contents/MacOS/locale
732         for i in $(ALL_LINGUAS); do \
733           mkdir -p $(top_builddir)/VLC.app/Contents/MacOS/locale/$${i}/LC_MESSAGES ; \
734           ln -sfn `pwd`/po/$${i}.gmo $(top_builddir)/VLC.app/Contents/MacOS/locale/$${i}/LC_MESSAGES/vlc.mo || true ; \
735           mkdir -p $(top_builddir)/VLC.app/Contents/Resources/$${i}.lproj ; \
736           ln -sf ../English.lproj/InfoPlist.strings \
737               $(top_builddir)/VLC.app/Contents/Resources/$${i}.lproj ; \
738           ln -sf ../English.lproj/MainMenu.nib \
739               $(top_builddir)/VLC.app/Contents/Resources/$${i}.lproj ; \
740         done
741         printf "APPLVLC#" >| $(top_builddir)/VLC.app/Contents/PkgInfo
742 endif
743
744 if HAVE_WIN32
745 DATA_win32_rc = $(noinst_share_vlc_win32_rc_DATA)
746 noinst_share_vlc_win32_rc_DATA = share/vlc_win32_rc.$(OBJEXT)
747 noinst_share_vlc_win32_rcdir = $(libdir)
748 share/vlc_win32_rc.$(OBJEXT): share/vlc_win32_rc.rc
749         $(WINDRES) -DVERSION=$(VERSION) -DVERSION_NUMBER=`echo $(VERSION).0.0.0 | sed 's/\([0-9]*\)[^.]*\.*\([0-9]*\)[^.]*\.*\([0-9]*\)[^.]*\.*\([0-9]*\).*/\1,\2,\3,\4/'` --include-dir $(srcdir)/share -i $< -o $@
750 endif
751
752
753 ###############################################################################
754 # Building specific source packages
755 ###############################################################################
756
757 dist-woody: distdir
758         $(remove_distdir_woody)
759         mv $(distdir) $(PACKAGE)-woody-$(VERSION)
760         $(srcdir)/toolbox --make-woody $(PACKAGE)-woody-$(VERSION)
761         $(AMTAR) chof - $(PACKAGE)-woody-$(VERSION) \
762           | GZIP=$(GZIP_ENV) gzip -c >$(PACKAGE)-woody-$(VERSION).tar.gz
763         $(remove_distdir_woody)
764
765 remove_distdir_woody = \
766   { test ! -d $(PACKAGE)-woody-$(VERSION) \
767     || { find $(PACKAGE)-woody-$(VERSION) -type d ! -perm -200 \
768            -exec chmod u+w {} ';' \
769          && rm -fr $(PACKAGE)-woody-$(VERSION); }; }
770
771 ###############################################################################
772 # Building architecture-specific binary packages
773 ###############################################################################
774
775 # XXX: this rule is probably only useful to you if you have exactly
776 # the same setup as me. Contact sam@zoy.org if you need to use it.
777 #
778 package-win32-base:
779 # Check that tmp isn't in the way
780         @if test -e "$(top_builddir)/vlc-${VERSION}"; then \
781           echo "Error: please remove $(top_builddir)/vlc-${VERSION}, it is in the way"; \
782           false; \
783         else \
784           echo "OK."; mkdir -p "$(top_builddir)/vlc-${VERSION}"; \
785         fi
786
787 # Copy relevant files
788         cp "$(srcdir)/vlc.win32.nsi" "$(top_builddir)/vlc-${VERSION}/"
789         cp "$(top_builddir)/vlc$(EXEEXT)" "$(top_builddir)/vlc-${VERSION}/"
790         cp "$(top_srcdir)/vlc.exe.manifest" "$(top_builddir)/vlc-${VERSION}/"
791         $(STRIP) "$(top_builddir)/vlc-${VERSION}/vlc$(EXEEXT)"
792
793         for file in AUTHORS MAINTAINERS THANKS NEWS COPYING README ; \
794           do sed 's/@/_AT_/' < "$(srcdir)/$$file" > "$(top_builddir)/vlc-${VERSION}/$${file}.txt" ; \
795           unix2dos "$(top_builddir)/vlc-${VERSION}/$${file}.txt" ; done
796
797         mkdir -p "$(top_builddir)/vlc-${VERSION}/plugins"
798         for i in "" `$(VLC_CONFIG) --target plugin` ; do \
799           if test -n "$$i" ; then \
800             $(INSTALL) "$(top_builddir)/$$i$(LIBEXT)" \
801             "$(top_builddir)/vlc-${VERSION}/plugins/" ; \
802           fi ; done
803
804         for i in "" $(top_builddir)/vlc-${VERSION}/plugins/*$(LIBEXT) ; \
805           do if test -n "$$i" ; then $(STRIP) "$$i" ; fi ; done
806
807         mkdir $(top_builddir)/vlc-${VERSION}/locale
808         for i in $(ALL_LINGUAS); do \
809           mkdir -p "$(top_builddir)/vlc-${VERSION}/locale/$${i}/LC_MESSAGES" ; \
810           cp "$(srcdir)/po/$${i}.gmo" \
811             "$(top_builddir)/vlc-${VERSION}/locale/$${i}/LC_MESSAGES/vlc.mo" \
812             || true ; \
813         done
814
815         mkdir -p $(top_builddir)/vlc-${VERSION}/skins/fonts
816         for i in $(srcdir)/share/skins2/fonts/*.*; do \
817           cp $$i $(top_builddir)/vlc-${VERSION}/skins/fonts/ || true ; \
818         done
819         for i in $(srcdir)/share/skins2/*.*; do \
820           cp $$i $(top_builddir)/vlc-${VERSION}/skins/ || true ; \
821         done
822
823         mkdir -p "$(top_builddir)/vlc-${VERSION}/osdmenu"
824         mkdir -p "$(top_builddir)/vlc-${VERSION}/osdmenu/dvd"
825         mkdir -p "$(top_builddir)/vlc-${VERSION}/osdmenu/dvd/selected"
826         mkdir -p "$(top_builddir)/vlc-${VERSION}/osdmenu/dvd/unselect"
827         mkdir -p "$(top_builddir)/vlc-${VERSION}/osdmenu/dvd/selection"
828         mkdir -p "$(top_builddir)/vlc-${VERSION}/osdmenu/dvd/volume"
829         for i in $(srcdir)/share/osdmenu/*.*; do \
830           cp $$i $(top_builddir)/vlc-${VERSION}/osdmenu/ || true ; \
831           unix2dos $(top_builddir)/vlc-${VERSION}/osdmenu/`basename $$i` ; \
832         done
833         for i in $(srcdir)/share/osdmenu/dvd/*.*; do \
834           cp $$i $(top_builddir)/vlc-${VERSION}/osdmenu/dvd || true ; \
835         done
836         for i in $(srcdir)/share/osdmenu/dvd/unselect/*.*; do \
837           cp $$i $(top_builddir)/vlc-${VERSION}/osdmenu/dvd/unselect || true ; \
838         done
839         for i in $(srcdir)/share/osdmenu/dvd/selected/*.*; do \
840           cp $$i $(top_builddir)/vlc-${VERSION}/osdmenu/dvd/selected/ || true ; \
841         done
842         for i in $(srcdir)/share/osdmenu/dvd/selection/*.*; do \
843           cp $$i $(top_builddir)/vlc-${VERSION}/osdmenu/dvd/selection/ || true ; \
844         done
845         for i in $(srcdir)/share/osdmenu/dvd/volume/*.*; do \
846           cp $$i $(top_builddir)/vlc-${VERSION}/osdmenu/dvd/volume/ || true ; \
847         done
848
849         mkdir -p "$(top_builddir)/vlc-${VERSION}/osdmenu/default"
850         mkdir -p "$(top_builddir)/vlc-${VERSION}/osdmenu/default/selected"
851         mkdir -p "$(top_builddir)/vlc-${VERSION}/osdmenu/default/selection"
852         mkdir -p "$(top_builddir)/vlc-${VERSION}/osdmenu/default/volume"
853         for i in $(srcdir)/share/osdmenu/default/*.*; do \
854           cp $$i $(top_builddir)/vlc-${VERSION}/osdmenu/default || true ; \
855         done
856         for i in $(srcdir)/share/osdmenu/default/selected/*.*; do \
857           cp $$i $(top_builddir)/vlc-${VERSION}/osdmenu/default/selected/ || true ; \
858         done
859         for i in $(srcdir)/share/osdmenu/default/selection/*.*; do \
860           cp $$i $(top_builddir)/vlc-${VERSION}/osdmenu/default/selection/ || true ; \
861         done
862         for i in $(srcdir)/share/osdmenu/default/volume/*.*; do \
863           cp $$i $(top_builddir)/vlc-${VERSION}/osdmenu/default/volume/ || true ; \
864         done
865
866         mkdir -p "$(top_builddir)/vlc-${VERSION}/http/admin"
867         mkdir -p "$(top_builddir)/vlc-${VERSION}/http/vlm"
868         cp $(srcdir)/share/http/*.html $(top_builddir)/vlc-${VERSION}/http/ ;
869         unix2dos $(top_builddir)/vlc-${VERSION}/http/*.html ;
870         cp $(srcdir)/share/http/*.css $(top_builddir)/vlc-${VERSION}/http/ ;
871         unix2dos $(top_builddir)/vlc-${VERSION}/http/*.css ;
872         cp $(srcdir)/share/http/*.png $(top_builddir)/vlc-${VERSION}/http/
873         cp $(srcdir)/share/http/*.ico $(top_builddir)/vlc-${VERSION}/http/ ;
874         cp $(srcdir)/share/http/admin/*.html \
875            $(top_builddir)/vlc-${VERSION}/http/admin/ ;
876         unix2dos $(top_builddir)/vlc-${VERSION}/http/admin/*.html ;
877         cp $(srcdir)/share/http/admin/dboxfiles.html \
878            $(top_builddir)/vlc-${VERSION}/http/admin/ ;
879         cp $(srcdir)/share/http/admin/.access \
880            $(top_builddir)/vlc-${VERSION}/http/admin/ ;
881         unix2dos $(top_builddir)/vlc-${VERSION}/http/admin/.access ;
882         cp $(srcdir)/share/http/vlm/*.html \
883            $(top_builddir)/vlc-${VERSION}/http/vlm/ ;
884         unix2dos $(top_builddir)/vlc-${VERSION}/http/vlm/*.html ;
885
886         cp $(srcdir)/share/vlc48x48new.ico $(top_builddir)/vlc-${VERSION}/ ;
887
888         mkdir -p "$(top_builddir)/vlc-${VERSION}/mozilla"
889 if BUILD_MOZILLA
890         cp $(top_builddir)/mozilla/*$(LIBEXT) $(top_builddir)/vlc-${VERSION}/mozilla/ ;
891         $(STRIP) $(top_builddir)/vlc-${VERSION}/mozilla/*$(LIBEXT);
892         cp $(top_builddir)/mozilla/vlcintf.xpt  $(top_builddir)/vlc-${VERSION}/mozilla/ ;
893 endif
894
895         mkdir -p "$(top_builddir)/vlc-${VERSION}/activex"
896 if BUILD_ACTIVEX
897         cp $(srcdir)/activex/README.TXT  $(top_builddir)/vlc-${VERSION}/activex/ ;
898         cp $(srcdir)/activex/test.html  $(top_builddir)/vlc-${VERSION}/activex/ ;
899         unix2dos $(top_builddir)/vlc-${VERSION}/activex/* ;
900
901         cp $(top_builddir)/activex/*$(LIBEXT) $(top_builddir)/vlc-${VERSION}/activex/ ;
902         $(STRIP) $(top_builddir)/vlc-${VERSION}/activex/*$(LIBEXT);
903 endif
904 # Rebase all those DLLs to speed up loading (need cygwin rebase)
905         if [ -x rebase ]; then \
906                 find $(top_builddir)/vlc-${VERSION} -type f -name '*.dll' -print | rebase -b 0x70000000 -T -; \
907         fi
908
909 package-win32-base-exe:
910 # Create package
911         wine C:/Program\ Files/NSIS/makensis.exe \
912              /DVERSION=${VERSION} $(top_builddir)/vlc-${VERSION}/vlc.win32.nsi
913
914 package-win32-base-exe-cygwin:
915 # Create package
916         C:/Program\ Files/NSIS/makensis.exe \
917              /DVERSION=${VERSION} $(top_builddir)/vlc-${VERSION}/vlc.win32.nsi
918
919 package-win32-base-exe-linux:
920 # Create package
921         makensis -DVERSION=${VERSION} $(top_builddir)/vlc-${VERSION}/vlc.win32.nsi
922
923 package-win32-base-zip:
924 # Create package 
925         zip -r vlc-${VERSION}-win32.zip vlc-${VERSION}
926
927 package-win32-exe: package-win32-base package-win32-base-exe
928 # Clean up
929         rm -Rf $(top_builddir)/vlc-${VERSION}
930
931 package-win32-exe-linux: package-win32-base package-win32-base-exe-linux
932 # Clean up
933         rm -Rf $(top_builddir)/vlc-${VERSION}
934
935 package-win32-zip: package-win32-base package-win32-base-zip
936 # Clean up
937         rm -Rf $(top_builddir)/vlc-${VERSION}
938
939 package-win32: package-win32-base package-win32-base-exe package-win32-base-zip
940 # Clean up
941         rm -Rf $(top_builddir)/vlc-${VERSION}
942
943 package-beos:
944 # Check that tmp isn't in the way
945         @if test -e $(srcdir)/tmp; then \
946           echo "Error: please remove $(srcdir)/tmp, it is in the way"; \
947           false ; \
948         else \
949           echo "OK." ; mkdir $(srcdir)/tmp ; \
950         fi
951
952 # Copy relevant files
953         mkdir -p $(srcdir)/tmp/vlc ;
954         cd $(srcdir) && cp -R vlc-bundle/* AUTHORS COPYING ChangeLog README \
955           THANKS NEWS tmp/vlc/ ;
956
957 # Create debug package
958         xres -o $(srcdir)/tmp/vlc/vlc $(srcdir)/share/vlc_beos.rsrc ;
959         find $(srcdir)/tmp/vlc -exec mimeset -f {} \; ;
960         mv $(srcdir)/tmp/vlc $(srcdir)/tmp/vlc-${VERSION} ;
961         (cd $(srcdir)/tmp ; zip -9 -r vlc-${VERSION}-BeOS-debug.zip vlc-${VERSION} )
962         mv $(srcdir)/tmp/vlc-${VERSION}-BeOS-debug.zip $(srcdir)/ ;
963         mv $(srcdir)/tmp/vlc-${VERSION} $(srcdir)/tmp/vlc ;
964
965 # Create normal package
966         $(STRIP) --strip-debug --strip-unneeded $(srcdir)/tmp/vlc/vlc ;
967         find $(srcdir)/tmp/vlc -name 'lib*.so' -exec $(STRIP) \
968           --strip-debug --strip-unneeded "{}" \; ;
969         xres -o $(srcdir)/tmp/vlc/vlc $(srcdir)/share/vlc_beos.rsrc ;
970         find $(srcdir)/tmp/vlc -exec mimeset -f {} \; ;
971         mv $(srcdir)/tmp/vlc $(srcdir)/tmp/vlc-${VERSION} ;
972         (cd $(srcdir)/tmp ; zip -9 -r vlc-${VERSION}-BeOS.zip vlc-${VERSION} )
973         mv $(srcdir)/tmp/vlc-${VERSION}-BeOS.zip $(srcdir)/ ;
974
975 # Clean up
976         rm -Rf $(srcdir)/tmp ;
977
978 package-macosx:
979 # Check that tmp isn't in the way
980         @if test -e "$(top_builddir)/tmp"; then \
981           echo "Error: please remove $(top_builddir)/tmp, it is in the way"; \
982           false; \
983         else \
984           echo "OK."; mkdir -p "$(top_builddir)/tmp"; \
985         fi
986
987 # Copy relevant files 
988         cp -R "$(top_builddir)/VLC-release.app" "$(top_builddir)/tmp/VLC.app"
989         cd "$(srcdir)" && cp AUTHORS COPYING ChangeLog README README.MacOSX.rtf THANKS NEWS $(top_builddir)/tmp/
990
991 # Create disk image 
992         $(srcdir)/extras/MacOSX/macosx-dmg "vlc-${VERSION}" $(top_builddir)/tmp
993
994 # Clean up
995         rm -Rf $(top_builddir)/tmp
996
997 package-translations:
998         @if test -e "$(srcdir)/vlc-translations-${VERSION}"; then \
999           echo "Error: please remove $(srcdir)/vlc-translations-${VERSION}, it is in the way"; \
1000           false; \
1001         else \
1002           echo "OK."; mkdir -p "$(srcdir)/vlc-translations-${VERSION}"; \
1003         fi
1004 # Copy translations
1005         for i in $(ALL_LINGUAS); do \
1006           cp "$(srcdir)/po/$${i}.po" \
1007             "$(srcdir)/vlc-translations-${VERSION}/$${i}.po" \
1008             || true ; \
1009         done
1010         cp "$(srcdir)/doc/translations.txt" \
1011           "$(srcdir)/vlc-translations-${VERSION}/README.txt"
1012
1013         echo "#!/bin/sh" >>"$(srcdir)/vlc-translations-$(VERSION)/convert.po.sh"
1014         echo "" >>"$(srcdir)/vlc-translations-$(VERSION)/convert.po.sh"
1015         echo 'if test $$# != 1; then' >>"$(srcdir)/vlc-translations-$(VERSION)/convert.po.sh"
1016         echo "  echo \"Usage: convert-po.sh <.po file>\"" >>"$(srcdir)/vlc-translations-$(VERSION)/convert.po.sh"
1017         echo "  exit 1" >>"$(srcdir)/vlc-translations-$(VERSION)/convert.po.sh"
1018         echo "fi" >>"$(srcdir)/vlc-translations-$(VERSION)/convert.po.sh"
1019         echo "" >>"$(srcdir)/vlc-translations-$(VERSION)/convert.po.sh"
1020         echo 'msgfmt --statistics -o vlc.mo $$1' >>"$(srcdir)/vlc-translations-$(VERSION)/convert.po.sh"
1021
1022         $(AMTAR) chof - $(srcdir)/vlc-translations-$(VERSION) \
1023           | GZIP=$(GZIP_ENV) gzip -c >$(srcdir)/vlc-translations-$(VERSION).tar.gz
1024
1025 ###############################################################################
1026 # PO translation files update
1027 ###############################################################################
1028 .PHONY: update-po
1029
1030 update-po:
1031         rm -f $(top_srcdir)/po/POTFILES.in
1032         { \
1033           cd $(top_srcdir) ; \
1034           echo "# automatically created by make update-po" ; \
1035           echo "" ; \
1036           echo "# main sources" ; \
1037           find include src -name '*.[chm]' -o -name '*.[ch]pp' \
1038             | grep -v '\(vlc_symbols\|misc/modules_\)' \
1039             | sort ; \
1040           echo "" ; \
1041           echo "# modules" ; \
1042           find modules -name '*.[chm]' -o -name '*.[ch]pp' \
1043             | grep -v '\(\.moc\.\|gui/gtk2/\)' \
1044             | sort ; \
1045         } > $(top_srcdir)/po/POTFILES.in
1046         rm -f $(top_srcdir)/po/vlc.pot
1047         cd po && $(MAKE) POTFILES $(top_srcdir)/../po/vlc.pot update-po
1048
1049 #cd po && $(MAKE) update-po
1050
1051 ###############################################################################
1052 # Stamp rules
1053 ###############################################################################
1054 clean: clean-stamp clean-recursive
1055 clean-stamp:
1056         rm -f stamp-builtin stamp-api
1057
1058 stamp-builtin: FORCE
1059         @for dep in "" `$(VLC_CONFIG) --target builtin`; do \
1060           if test "$${dep}" -nt "$(top_builddir)/vlc$(EXEEXT)"; then \
1061             rm -f $@; \
1062             break; \
1063           fi; \
1064         done
1065         @if test ! -f $@; then printf "" > $@; fi
1066
1067 stamp-api: Makefile.in $(HEADERS_include) vlc-config vlc-api.pl src/misc/modules_builtin.h.in
1068         cd $(srcdir) && cat $(HEADERS_include) | perl ./vlc-api.pl
1069         touch stamp-api
1070
1071 ###############################################################################
1072 # Force rule
1073 ###############################################################################
1074 FORCE: