* modules/codec/subsdec/subsdec.c: reordered the list of encodings. Should
[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 SUBDIRS = intl modules po . mozilla share m4
15 DIST_SUBDIRS = $(SUBDIRS) src debian doc ipkg lib autotools
16
17 EXTRA_DIST = \
18         HACKING \
19         INSTALL.win32 \
20         MAINTAINERS \
21         README.MacOSX.rtf \
22         bootstrap \
23         install-win32 \
24         src/extras/COPYING \
25         toolbox \
26         vlc-config.in.in \
27         vlc.ebuild \
28         vlc.spec \
29         vlc.spec.mdk \
30         $(NULL)
31
32 BUILT_SOURCES =
33 SUFFIXES = 
34
35 # Tell aclocal to use -I m4. Wonder if it really works.
36 ACLOCAL_AMFLAGS = -I m4
37
38 # XXX: these flags could be set in configure.ac, but we set them here
39 # because old versions of automake don't support them in configure.ac.
40 AUTOMAKE_OPTIONS = dist-bzip2 subdir-objects
41
42 ###############################################################################
43 # Headers
44 ###############################################################################
45
46 BUILT_SOURCES += \
47         include/vlc_symbols.h \
48         src/misc/modules_builtin.h \
49         src/misc/modules_plugin.h \
50         $(NULL)
51
52 pkgincludedir = $(includedir)/vlc
53
54 dist_pkginclude_HEADERS = \
55         include/vlc/vlc.h \
56         include/vlc/aout.h \
57         include/vlc/vout.h \
58         include/vlc/sout.h \
59         include/vlc/decoder.h \
60         include/vlc/input.h \
61         include/vlc/intf.h \
62         $(NULL)
63
64 noinst_HEADERS = $(HEADERS_include) $(HEADERS_include_built)
65
66 HEADERS_include = \
67         include/aout_internal.h \
68         include/audio_output.h \
69         include/beos_specific.h \
70         include/configuration.h \
71         include/darwin_specific.h \
72         include/charset.h \
73         include/codecs.h \
74         include/encoder.h \
75         include/ninput.h \
76         include/input_ext-dec.h \
77         include/input_ext-intf.h \
78         include/input_ext-plugins.h \
79         include/intf_eject.h \
80         include/iso_lang.h \
81         include/httpd.h \
82         include/main.h \
83         include/mmx.h \
84         include/modules.h \
85         include/modules_inner.h \
86         include/mtime.h \
87         include/network.h \
88         include/os_specific.h \
89         include/stream_control.h \
90         include/stream_output.h \
91         include/variables.h \
92         include/video_output.h \
93         include/vlc_common.h \
94         include/vlc_config.h \
95         include/vlc_cpu.h \
96         include/vlc_error.h \
97         include/vlc_interface.h \
98         include/vlc_messages.h \
99         include/vlc_objects.h \
100         include/vlc_playlist.h \
101         include/vlc_threads.h \
102         include/vlc_threads_funcs.h \
103         include/vlc_video.h \
104         include/vout_synchro.h \
105         include/win32_specific.h \
106         include/osd.h \
107         $(NULL)
108
109 HEADERS_include_built = \
110         include/vlc_symbols.h \
111         $(NULL)
112
113 include/vlc_symbols.h: Makefile $(HEADERS_include)
114         srcdir=$(srcdir) $(srcdir)/toolbox --update-includes
115
116 src/misc/modules_plugin.h: Makefile src/misc/modules_plugin.h.in $(HEADERS_include)
117         srcdir=$(srcdir) $(srcdir)/toolbox --update-includes
118
119 src/misc/modules_builtin.h: Makefile src/misc/modules_builtin.h.in
120         srcdir=$(srcdir) $(srcdir)/toolbox --update-includes
121
122 # These dependencies are mandatory
123 $(SOURCES): include/vlc_symbols.h
124 $(SOURCES_libvlc): src/misc/modules_plugin.h src/misc/modules_builtin.h $(LIB_intl)
125
126 ###############################################################################
127 # Optional libintl - FIXME, bad dependencies
128 ###############################################################################
129
130 intl/libintl.a: FORCE
131         cd $(top_builddir)/intl && $(MAKE) $(AM_MAKEFLAGS)
132
133 if BUILD_INTL
134 LIB_intl = intl/libintl.a
135 endif
136
137 ###############################################################################
138 # MacOS X project
139 ###############################################################################
140
141 EXTRA_DIST += \
142         extras/MacOSX/Resources/English.lproj/MainMenu.nib/classes.nib \
143         extras/MacOSX/Resources/English.lproj/MainMenu.nib/info.nib \
144         extras/MacOSX/Resources/English.lproj/MainMenu.nib/objects.nib \
145         extras/MacOSX/Resources/English.lproj/InfoPlist.strings \
146         extras/MacOSX/Resources/English.lproj/vlc.scriptTerminology \
147         extras/MacOSX/Resources/a52.icns \
148         extras/MacOSX/Resources/aac.icns \
149         extras/MacOSX/Resources/asf.icns \
150         extras/MacOSX/Resources/asx.icns \
151         extras/MacOSX/Resources/avi.icns \
152         extras/MacOSX/Resources/bin.icns \
153         extras/MacOSX/Resources/cue.icns \
154         extras/MacOSX/Resources/dat.icns \
155         extras/MacOSX/Resources/divx.icns \
156         extras/MacOSX/Resources/dv.icns \
157         extras/MacOSX/Resources/generic.icns \
158         extras/MacOSX/Resources/m3u.icns \
159         extras/MacOSX/Resources/mov.icns \
160         extras/MacOSX/Resources/mp3.icns \
161         extras/MacOSX/Resources/mp4.icns \
162         extras/MacOSX/Resources/mpeg.icns \
163         extras/MacOSX/Resources/mpeg1.icns \
164         extras/MacOSX/Resources/mpeg2.icns \
165         extras/MacOSX/Resources/mpeg4.icns \
166         extras/MacOSX/Resources/mpg.icns \
167         extras/MacOSX/Resources/ogg.icns \
168         extras/MacOSX/Resources/ogm.icns \
169         extras/MacOSX/Resources/pls.icns \
170         extras/MacOSX/Resources/srt.icns \
171         extras/MacOSX/Resources/sub.icns \
172         extras/MacOSX/Resources/vlc.icns \
173         extras/MacOSX/Resources/vob.icns \
174         extras/MacOSX/Resources/wma.icns \
175         extras/MacOSX/Resources/wmv.icns \
176         extras/MacOSX/Resources/back.png \
177         extras/MacOSX/Resources/begin.png \
178         extras/MacOSX/Resources/end.png \
179         extras/MacOSX/Resources/forw.png \
180         extras/MacOSX/Resources/list.png \
181         extras/MacOSX/Resources/pause.png \
182         extras/MacOSX/Resources/play.png \
183         extras/MacOSX/Resources/prefs.png \
184         extras/MacOSX/Resources/slow.png \
185         extras/MacOSX/Resources/stop.png \
186         extras/MacOSX/Resources/vlc_hg.png \
187         extras/MacOSX/Resources/about_bg.png \
188         extras/MacOSX/Resources/vlc.scriptSuite \
189         extras/MacOSX/Resources/README \
190         extras/MacOSX/vlc.pbproj/project.pbxproj \
191         extras/MacOSX/macosx-dmg \
192         $(NULL)
193
194 ###############################################################################
195 # MS Visual Studio and eMbedded Visual Studio projects
196 ###############################################################################
197
198 EXTRA_DIST += \
199         msvc/vlc.dsw \
200         msvc/libvlc.dsp.in \
201         msvc/plugins.dsp.in \
202         msvc/vlc.dsp.in \
203         msvc/config.h.in \
204         msvc/modules_builtin_msvc.h \
205         evc/vlc.vcw \
206         evc/libvlc.vcp.in \
207         evc/vlc.vcp.in \
208         evc/plugins.vcp.in \
209         evc/vlc.c \
210         evc/config.h.in \
211         evc/modules_builtin_evc.h \
212         $(NULL)
213
214 dist-hook:
215         mv $(distdir)/vlc.ebuild $(distdir)/vlc-${VERSION}.ebuild
216         cd $(distdir) && srcdir=$(srcdir) $(srcdir)/toolbox --update-vc
217
218 ###############################################################################
219 # Building libvlc
220 ###############################################################################
221
222 bin_SCRIPTS = vlc-config
223
224 lib_LIBRARIES = lib/libvlc.a $(LIBRARIES_libvlc_pic)
225
226 lib_libvlc_a_SOURCES = $(SOURCES_libvlc)
227 dist_lib_libvlc_a_SOURCES = src/misc/modules_plugin.h
228 lib_libvlc_a_CFLAGS = `$(VLC_CONFIG) --cflags vlc`
229 lib_libvlc_a_CXXFLAGS = `$(VLC_CONFIG) --cxxflags vlc`
230 lib_libvlc_a_OBJCFLAGS = `$(VLC_CONFIG) --objcflags vlc`
231
232 lib_libvlc_pic_a_SOURCES = $(SOURCES_libvlc)
233 lib_libvlc_pic_a_CFLAGS = `$(VLC_CONFIG) --cflags vlc pic`
234 lib_libvlc_pic_a_CXXFLAGS = `$(VLC_CONFIG) --cxxflags vlc pic`
235 lib_libvlc_pic_a_OBJCFLAGS = `$(VLC_CONFIG) --objcflags vlc pic`
236
237 if HAVE_BEOS
238 OPT_SOURCES_libvlc_beos = $(SOURCES_libvlc_beos)
239 endif
240 if HAVE_DARWIN
241 OPT_SOURCES_libvlc_darwin = $(SOURCES_libvlc_darwin)
242 endif
243 if HAVE_WIN32
244 OPT_SOURCES_libvlc_win32 = $(SOURCES_libvlc_win32)
245 endif
246 if BUILD_DIRENT
247 OPT_SOURCES_libvlc_dirent = $(SOURCES_libvlc_dirent)
248 endif
249 if BUILD_GETOPT
250 OPT_SOURCES_libvlc_getopt = $(SOURCES_libvlc_getopt)
251 endif
252 if BUILD_MOZILLA
253 LIBRARIES_libvlc_pic = lib/libvlc_pic.a
254 endif
255
256 EXTRA_DIST += \
257         $(SOURCES_libvlc_beos) \
258         $(SOURCES_libvlc_darwin) \
259         $(SOURCES_libvlc_win32) \
260         $(SOURCES_libvlc_dirent) \
261         $(SOURCES_libvlc_getopt) \
262         $(NULL)
263
264 SOURCES_libvlc_beos = \
265         src/misc/beos_specific.cpp \
266         $(NULL)
267
268 SOURCES_libvlc_darwin = \
269         src/misc/darwin_specific.m \
270         $(NULL)
271
272 SOURCES_libvlc_win32 = \
273         src/misc/win32_specific.c \
274         $(NULL)
275
276 SOURCES_libvlc_dirent = \
277         src/extras/dirent.c \
278         src/extras/dirent.h \
279         $(NULL)
280
281 SOURCES_libvlc_getopt = \
282         src/extras/getopt.c \
283         src/extras/getopt.h \
284         src/extras/getopt1.c \
285         $(NULL)
286
287 SOURCES_libvlc_common = \
288         src/libvlc.c \
289         src/libvlc.h \
290         src/interface/interface.c \
291         src/interface/intf_eject.c \
292         src/playlist/playlist.c \
293         src/input/input.c \
294         src/input/stream.c \
295         src/input/demux.c \
296         src/input/input_ext-plugins.c \
297         src/input/input_ext-dec.c \
298         src/input/input_ext-intf.c \
299         src/input/input_dec.c \
300         src/input/input_programs.c \
301         src/input/input_clock.c \
302         src/input/input_info.c \
303         src/video_output/video_output.c \
304         src/video_output/vout_pictures.c \
305         src/video_output/vout_pictures.h \
306         src/video_output/video_text.c \
307         src/video_output/video_text.h \
308         src/video_output/vout_subpictures.c \
309         src/video_output/vout_synchro.c \
310         src/audio_output/common.c \
311         src/audio_output/dec.c \
312         src/audio_output/filters.c \
313         src/audio_output/input.c \
314         src/audio_output/mixer.c \
315         src/audio_output/output.c \
316         src/audio_output/intf.c \
317         src/stream_output/stream_output.c \
318         src/misc/charset.c \
319         src/misc/mtime.c \
320         src/misc/modules.c \
321         src/misc/threads.c \
322         src/misc/cpu.c \
323         src/misc/configuration.c \
324         src/misc/iso_lang.c \
325         src/misc/iso-639_def.h \
326         src/misc/messages.c \
327         src/misc/objects.c \
328         src/misc/variables.c \
329         src/misc/error.c \
330         src/extras/libc.c \
331         $(NULL)
332
333 SOURCES_libvlc = \
334         $(SOURCES_libvlc_common) \
335         $(OPT_SOURCES_libvlc_beos) \
336         $(OPT_SOURCES_libvlc_darwin) \
337         $(OPT_SOURCES_libvlc_win32) \
338         $(OPT_SOURCES_libvlc_dirent) \
339         $(OPT_SOURCES_libvlc_getopt) \
340         $(NULL)
341
342 ###############################################################################
343 # Building vlc
344 ###############################################################################
345
346 bin_PROGRAMS = vlc
347
348 vlc_SOURCES = src/vlc.c
349
350 vlc_LDFLAGS = `$(VLC_CONFIG) --libs vlc builtin`
351 vlc_LDADD = lib/libvlc.a $(DATA_win32_rc) $(LIB_intl)
352 vlc_CFLAGS = `$(VLC_CONFIG) --cflags vlc`
353
354 # We use DEPENDENCIES_vlc instead of vlc_DEPENDENCIES because of an
355 # old automake-1.5 bug (automake/279).
356 DEPENDENCIES_vlc = lib/libvlc.a $(DATA_win32_rc) $(LIB_intl)
357
358 vlc$(EXEEXT): $(vlc_OBJECTS) $(DEPENDENCIES_vlc) stamp-builtin
359         @rm -f $(top_builddir)/vlc$(EXEEXT)
360         @case `$(VLC_CONFIG) --linkage vlc builtin` in \
361           c++) echo $(CXXLINK) $(vlc_OBJECTS) $(vlc_LDADD) $(vlc_LDFLAGS) $(LIBS) ; $(CXXLINK) $(vlc_OBJECTS) $(vlc_LDADD) $(vlc_LDFLAGS) $(LIBS) ;; \
362           objc) echo $(OBJCLINK) $(vlc_OBJECTS) $(vlc_LDADD) $(vlc_LDFLAGS) $(LIBS) ; $(OBJCLINK) $(vlc_OBJECTS) $(vlc_LDADD) $(vlc_LDFLAGS) $(LIBS) ;; \
363           c|*) echo $(LINK) $(vlc_OBJECTS) $(vlc_LDADD) $(vlc_LDFLAGS) $(LIBS) ; $(LINK) $(vlc_OBJECTS) $(vlc_LDADD) $(vlc_LDFLAGS) $(LIBS) ;; \
364         esac
365
366 if HAVE_BEOS
367         xres -o $@ $(srcdir)/share/vlc_beos.rsrc
368         mimeset -f $@
369         rm -Rf $(srcdir)/locale ; mkdir -p "$(srcdir)/locale"
370         for i in $(ALL_LINGUAS); do \
371           mkdir -p "$(srcdir)/locale/$${i}/LC_MESSAGES" ; \
372           cp "$(srcdir)/po/$${i}.gmo" \
373             "$(srcdir)/locale/$${i}/LC_MESSAGES/vlc.mo" || true ; \
374         done
375 endif
376
377 # Install the modules and the symlinks
378 install-exec-local:
379         for i in "" `$(VLC_CONFIG) --target plugin` ; do if test -n "$$i" ; then \
380           echo $(INSTALL) -m 755 "$$i$(LIBEXT)" "$(DESTDIR)$(libdir)/vlc/`echo $$i | sed -e 's,.*modules/\([^/]*\).*,\1,'`" ; \
381           $(INSTALL) -m 755 "$$i$(LIBEXT)" "$(DESTDIR)$(libdir)/vlc/`echo $$i | sed -e 's,.*modules/\([^/]*\).*,\1,'`" ; \
382         fi ; done
383         for i in "" `$(VLC_CONFIG) --target builtin` ; do if test -n "$$i" ; then \
384           echo $(INSTALL) -m 644 "$$i" "$(DESTDIR)$(libdir)/vlc" ; \
385           $(INSTALL) -m 644 "$$i" "$(DESTDIR)$(libdir)/vlc" ; \
386         fi ; done
387 if BUILD_MOZILLA
388         for i in "" `$(VLC_CONFIG) --target builtin pic` ; do if test -n "$$i" ; then \
389           echo $(INSTALL) -m 644 "$$i" "$(DESTDIR)$(libdir)/vlc" ; \
390           $(INSTALL) -m 644 "$$i" "$(DESTDIR)$(libdir)/vlc" ; \
391         fi ; done
392 endif
393         for i in "" $(ALIASES) ; do if test -n "$$i" ; then \
394           rm -f "$(DESTDIR)$(bindir)/$$i" && \
395           ln -s vlc "$(DESTDIR)$(bindir)/$$i" ; \
396         fi ; done
397
398 if HAVE_DARWIN
399 # Create the MacOS X app
400 vlc_app_DATA = VLC.app
401 vlc_appdir = $(bindir)
402 VLC.app: vlc
403         cd $(top_builddir)
404         rm -Rf VLC.app
405         rm -Rf extras
406         mkdir extras
407         cp -r $(srcdir)/extras/MacOSX extras
408         cd extras/MacOSX && pbxbuild -target vlc | grep -v '^\([ \t]\|$$\)'
409         cd $(top_builddir)
410         cp -r extras/MacOSX/build/vlc.bundle VLC.app
411         $(INSTALL) -d VLC.app/Contents/MacOS
412         $(INSTALL) vlc VLC.app/Contents/MacOS/VLC
413         $(INSTALL) -d VLC.app/Contents/MacOS/modules
414         for i in "" `$(VLC_CONFIG) --target plugin` ; do \
415           if test -n "$$i" ; then $(INSTALL) "$$i$(LIBEXT)" \
416             "VLC.app/Contents/MacOS/modules" ; \
417           fi ; done
418         $(INSTALL) -d VLC.app/Contents/MacOS/share
419         $(INSTALL) -d VLC.app/Contents/MacOS/share/http
420         $(INSTALL) -m 644 $(srcdir)/share/http/*.html VLC.app/Contents/MacOS/share/http
421         $(INSTALL) -d VLC.app/Contents/MacOS/share/http/admin
422         $(INSTALL) -m 644 $(srcdir)/share/http/admin/*.html VLC.app/Contents/MacOS/share/http/admin
423         $(INSTALL) -d VLC.app/Contents/MacOS/locale
424         for i in $(ALL_LINGUAS); do \
425           mkdir -p VLC.app/Contents/MacOS/locale/$${i}/LC_MESSAGES ; \
426           cp $(srcdir)/po/$${i}.gmo VLC.app/Contents/MacOS/locale/$${i}/LC_MESSAGES/vlc.mo || true ; \
427           mkdir -p VLC.app/Contents/Resources/$${i}.lproj ; \
428           ln -sf ../English.lproj/InfoPlist.strings VLC.app/Contents/Resources/$${i}.lproj ; \
429           ln -sf ../English.lproj/MainMenu.nib VLC.app/Contents/Resources/$${i}.lproj ; \
430           ln -sf ../English.lproj/vlc.scriptTerminology VLC.app/Contents/Resources/$${i}.lproj ; \
431         done
432         printf "APPLVLC#" >| VLC.app/Contents/PkgInfo
433 endif
434
435 if HAVE_WIN32
436 DATA_win32_rc = $(noinst_share_vlc_win32_rc_DATA)
437 noinst_share_vlc_win32_rc_DATA = share/vlc_win32_rc.$(OBJEXT)
438 noinst_share_vlc_win32_rcdir = $(libdir)
439 share/vlc_win32_rc.$(OBJEXT): share/vlc_win32_rc.rc
440         $(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 $@
441 endif
442
443 ###############################################################################
444 # Building specific source packages
445 ###############################################################################
446
447 dist-woody: distdir
448         $(remove_distdir_woody)
449         mv $(distdir) $(PACKAGE)-woody-$(VERSION)
450         $(srcdir)/toolbox --make-woody $(PACKAGE)-woody-$(VERSION)
451         $(AMTAR) chof - $(PACKAGE)-woody-$(VERSION) \
452           | GZIP=$(GZIP_ENV) gzip -c >$(PACKAGE)-woody-$(VERSION).tar.gz
453         $(remove_distdir_woody)
454
455 remove_distdir_woody = \
456   { test ! -d $(PACKAGE)-woody-$(VERSION) \
457     || { find $(PACKAGE)-woody-$(VERSION) -type d ! -perm -200 \
458            -exec chmod u+w {} ';' \
459          && rm -fr $(PACKAGE)-woody-$(VERSION); }; }
460
461 ###############################################################################
462 # Building architecture-specific binary packages
463 ###############################################################################
464
465 # XXX: this rule is probably only useful to you if you have exactly
466 # the same setup as me. Contact sam@zoy.org if you need to use it.
467 #
468 # Check that tmp isn't in the way
469 package-win32:
470         @if test -e "$(srcdir)/tmp"; then \
471           echo "Error: please remove $(srcdir)/tmp, it is in the way"; \
472           false; \
473         else \
474           echo "OK."; mkdir -p "$(srcdir)/tmp"; \
475         fi
476 # Create installation script
477         cp "$(srcdir)/install-win32" "$(srcdir)/tmp/nsi"
478 # Copy relevant files
479         cp "$(top_builddir)/vlc$(EXEEXT)" "$(srcdir)/tmp/"
480         $(STRIP) "$(srcdir)/tmp/vlc$(EXEEXT)"
481         for file in AUTHORS MAINTAINERS THANKS NEWS COPYING README ; \
482           do cp "$(srcdir)/$$file" "$(srcdir)/tmp/$${file}.txt" ; \
483           unix2dos "$(srcdir)/tmp/$${file}.txt" ; done
484
485         mkdir -p "$(srcdir)/tmp/plugins"
486         for i in "" `$(VLC_CONFIG) --target plugin` ; do \
487           if test -n "$$i" ; then \
488             $(INSTALL) "$(srcdir)/$$i$(LIBEXT)" "$(srcdir)/tmp/plugins/" ; \
489           fi ; done
490
491         for i in "" $(srcdir)/tmp/plugins/*$(LIBEXT) ; \
492           do if test -n "$$i" ; then $(STRIP) "$$i" ; fi ; done
493
494         mkdir $(srcdir)/tmp/locale
495         for i in $(ALL_LINGUAS); do \
496           mkdir -p "$(srcdir)/tmp/locale/$${i}/LC_MESSAGES" ; \
497           cp "$(srcdir)/po/$${i}.gmo" \
498             "$(srcdir)/tmp/locale/$${i}/LC_MESSAGES/vlc.mo" || true ; \
499         done
500
501         mkdir -p $(srcdir)/tmp/skins/default
502         for i in $(srcdir)/share/skins/default/*.*; do \
503           cp $$i $(srcdir)/tmp/skins/default/ || true ; \
504         done
505         for i in $(srcdir)/doc/skins/*.txt; do \
506           cp $$i $(srcdir)/tmp/skins/ || true ; \
507         done
508
509         mkdir -p "$(srcdir)/tmp/http/admin"
510         cp $(srcdir)/share/http/*.html $(srcdir)/tmp/http/ ;
511         cp $(srcdir)/share/http/admin/*.html $(srcdir)/tmp/http/admin/ ;
512         cp $(srcdir)/share/http/admin/.access $(srcdir)/tmp/http/admin/ ;
513
514 # Create package 
515         wine ~/.wine/fake_windows/Program\ Files/NSIS/makensis.exe -- /DVERSION=${VERSION} $(srcdir)/tmp/nsi
516 # Clean up
517         rm -Rf $(srcdir)/tmp
518
519 package-beos:
520 # Check that tmp isn't in the way
521         @if test -e $(srcdir)/tmp; then \
522           echo "Error: please remove $(srcdir)/tmp, it is in the way"; \
523           false; \
524         else \
525           echo "OK."; mkdir $(srcdir)/tmp; \
526         fi
527
528 # Copy relevant files
529         mkdir -p $(srcdir)/tmp/vlc
530         cd $(srcdir) && \
531           cp vlc AUTHORS COPYING ChangeLog README THANKS NEWS tmp/vlc/
532 # We cannot use ${PLUGIN_FILES} as it looks like it is too "long" for the BeOS shell...
533         if [ `find $(srcdir)/modules -name "lib*_plugin.so" | wc -l` -gt 0 ]; then \
534           mkdir -p $(srcdir)/tmp/vlc/plugins; \
535           find $(srcdir)/modules -name "lib*_plugin.so" | xargs -i{} cp {} $(srcdir)/tmp/vlc/plugins/; \
536         fi
537         for i in $(ALL_LINGUAS); do \
538           mkdir -p $(srcdir)/tmp/vlc/locale/$${i}/LC_MESSAGES ; \
539           cp $(srcdir)/po/$${i}.gmo $(srcdir)/tmp/vlc/locale/$${i}/LC_MESSAGES/vlc.mo || true ; \
540         done
541
542 # Create package with debug symbols
543         mimeset -f $(srcdir)/tmp/vlc/* $(srcdir)/tmp/vlc/*/*
544         mv $(srcdir)/tmp/vlc $(srcdir)/tmp/vlc-${VERSION}
545         (cd $(srcdir)/tmp ; zip -9 -r vlc-${VERSION}-BeOS-debug.zip vlc-${VERSION} )
546         mv $(srcdir)/tmp/vlc-${VERSION}-BeOS-debug.zip $(srcdir)/
547
548 # Create package without debug symbols
549         mv $(srcdir)/tmp/vlc-${VERSION} $(srcdir)/tmp/vlc
550         strip $(srcdir)/tmp/vlc/vlc
551         if [ -d $(srcdir)/tmp/vlc/plugins ]; then \
552           strip $(srcdir)/tmp/vlc/plugins/lib*_plugin.so; \
553         fi
554         xres -o $(srcdir)/tmp/vlc/vlc $(srcdir)/share/vlc_beos.rsrc
555         mimeset -f $(srcdir)/tmp/vlc/* $(srcdir)/tmp/vlc/*/*
556         mv $(srcdir)/tmp/vlc $(srcdir)/tmp/vlc-${VERSION}
557         (cd $(srcdir)/tmp ; zip -9 -r vlc-${VERSION}-BeOS.zip vlc-${VERSION} )
558         mv $(srcdir)/tmp/vlc-${VERSION}-BeOS.zip $(srcdir)/
559
560 # Clean up
561         rm -Rf $(srcdir)/tmp
562
563 package-macosx:
564 # Check that tmp isn't in the way
565         @if test -e "$(srcdir)/tmp"; then \
566           echo "Error: please remove $(srcdir)/tmp, it is in the way"; \
567           false; \
568         else \
569           echo "OK."; mkdir -p "$(srcdir)/tmp"; \
570         fi
571
572 # Copy relevant files 
573         cp -R "$(srcdir)/VLC.app" "$(srcdir)/tmp/"
574         cd "$(srcdir)" && cp AUTHORS COPYING ChangeLog README README.MacOSX.rtf THANKS NEWS tmp/
575
576 # Create disk image 
577         $(srcdir)/extras/MacOSX/macosx-dmg 18 "vlc-${VERSION}" $(srcdir)/tmp/* 
578
579 # Clean up
580         rm -Rf $(srcdir)/tmp
581
582 ###############################################################################
583 # Stamp rules
584 ###############################################################################
585 clean: clean-stamp
586 clean-stamp:
587         rm -f stamp-builtin
588
589 stamp-builtin: FORCE
590         @for dep in "" `$(VLC_CONFIG) --target builtin`; do \
591           if test "$${dep}" -nt "$(top_builddir)/vlc$(EXEEXT)"; then \
592             rm -f $@; \
593             break; \
594           fi; \
595         done
596         @if test ! -f $@; then printf "" > $@; fi
597
598 ###############################################################################
599 # Force rule
600 ###############################################################################
601 FORCE: