]> git.sesse.net Git - vlc/blob - Makefile.am
* include/vlc_bits.h: bit stream reader/writer.
[vlc] / 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 doc
15 DIST_SUBDIRS = $(SUBDIRS) src debian 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/ninput.h \
75         include/input_ext-dec.h \
76         include/input_ext-intf.h \
77         include/input_ext-plugins.h \
78         include/intf_eject.h \
79         include/iso_lang.h \
80         include/httpd.h \
81         include/main.h \
82         include/mmx.h \
83         include/modules.h \
84         include/modules_inner.h \
85         include/mtime.h \
86         include/network.h \
87         include/os_specific.h \
88         include/stream_control.h \
89         include/stream_output.h \
90         include/variables.h \
91         include/video_output.h \
92         include/vlc_block.h \
93         include/vlc_bits.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_error.h \
100         include/vlc_help.h \
101         include/vlc_interface.h \
102         include/vlc_keys.h \
103         include/vlc_messages.h \
104         include/vlc_objects.h \
105         include/vlc_playlist.h \
106         include/vlc_threads.h \
107         include/vlc_threads_funcs.h \
108         include/vlc_video.h \
109         include/vout_synchro.h \
110         include/win32_specific.h \
111         include/osd.h \
112         $(NULL)
113
114 HEADERS_include_built = \
115         include/vlc_symbols.h \
116         $(NULL)
117
118 include/vlc_symbols.h: Makefile $(HEADERS_include)
119         srcdir=$(srcdir) $(srcdir)/toolbox --update-includes
120
121 src/misc/modules_plugin.h: Makefile src/misc/modules_plugin.h.in $(HEADERS_include)
122         srcdir=$(srcdir) $(srcdir)/toolbox --update-includes
123
124 src/misc/modules_builtin.h: Makefile src/misc/modules_builtin.h.in
125         srcdir=$(srcdir) $(srcdir)/toolbox --update-includes
126
127 # These dependencies are mandatory
128 $(SOURCES): include/vlc_symbols.h
129 $(SOURCES_libvlc): src/misc/modules_plugin.h src/misc/modules_builtin.h $(LIB_intl)
130
131 ###############################################################################
132 # Optional libintl - FIXME, bad dependencies
133 ###############################################################################
134
135 intl/libintl.a: FORCE
136         cd $(top_builddir)/intl && $(MAKE) $(AM_MAKEFLAGS)
137
138 if BUILD_INTL
139 LIB_intl = intl/libintl.a
140 endif
141
142 ###############################################################################
143 # MacOS X project
144 ###############################################################################
145
146 EXTRA_DIST += \
147         extras/MacOSX/Resources/English.lproj/MainMenu.nib/classes.nib \
148         extras/MacOSX/Resources/English.lproj/MainMenu.nib/info.nib \
149         extras/MacOSX/Resources/English.lproj/MainMenu.nib/objects.nib \
150         extras/MacOSX/Resources/English.lproj/InfoPlist.strings \
151         extras/MacOSX/Resources/English.lproj/vlc.scriptTerminology \
152         extras/MacOSX/Resources/a52.icns \
153         extras/MacOSX/Resources/aac.icns \
154         extras/MacOSX/Resources/asf.icns \
155         extras/MacOSX/Resources/asx.icns \
156         extras/MacOSX/Resources/avi.icns \
157         extras/MacOSX/Resources/bin.icns \
158         extras/MacOSX/Resources/cue.icns \
159         extras/MacOSX/Resources/dat.icns \
160         extras/MacOSX/Resources/divx.icns \
161         extras/MacOSX/Resources/dv.icns \
162         extras/MacOSX/Resources/generic.icns \
163         extras/MacOSX/Resources/m3u.icns \
164         extras/MacOSX/Resources/mov.icns \
165         extras/MacOSX/Resources/mp3.icns \
166         extras/MacOSX/Resources/mp4.icns \
167         extras/MacOSX/Resources/mpeg.icns \
168         extras/MacOSX/Resources/mpeg1.icns \
169         extras/MacOSX/Resources/mpeg2.icns \
170         extras/MacOSX/Resources/mpeg4.icns \
171         extras/MacOSX/Resources/mpg.icns \
172         extras/MacOSX/Resources/ogg.icns \
173         extras/MacOSX/Resources/ogm.icns \
174         extras/MacOSX/Resources/pls.icns \
175         extras/MacOSX/Resources/srt.icns \
176         extras/MacOSX/Resources/sub.icns \
177         extras/MacOSX/Resources/vlc.icns \
178         extras/MacOSX/Resources/vob.icns \
179         extras/MacOSX/Resources/wma.icns \
180         extras/MacOSX/Resources/wmv.icns \
181         extras/MacOSX/Resources/pause.png \
182         extras/MacOSX/Resources/pause_blue.png \
183         extras/MacOSX/Resources/play.png \
184         extras/MacOSX/Resources/play_blue.png \
185         extras/MacOSX/Resources/stop.png \
186         extras/MacOSX/Resources/stop_blue.png \
187         extras/MacOSX/Resources/display.png \
188         extras/MacOSX/Resources/display_slider.png \
189         extras/MacOSX/Resources/display_track.png \
190         extras/MacOSX/Resources/fullscreen_active.png \
191         extras/MacOSX/Resources/fullscreen_blue.png \
192         extras/MacOSX/Resources/next_active.png \
193         extras/MacOSX/Resources/next_blue.png \
194         extras/MacOSX/Resources/playlistdrawer_active.png \
195         extras/MacOSX/Resources/playlistdrawer_blue.png \
196         extras/MacOSX/Resources/previous_active.png \
197         extras/MacOSX/Resources/previous_blue.png \
198         extras/MacOSX/Resources/skip_forward_active.png \
199         extras/MacOSX/Resources/skip_forward_blue.png \
200         extras/MacOSX/Resources/skip_previous_active.png \
201         extras/MacOSX/Resources/skip_previous_blue.png \
202         extras/MacOSX/Resources/volume_high.png \
203         extras/MacOSX/Resources/volume_low.png \
204         extras/MacOSX/Resources/volumeslider_blue.png \
205         extras/MacOSX/Resources/volumeslider_normal.png \
206         extras/MacOSX/Resources/volumetrack.png \
207         extras/MacOSX/Resources/about_bg.png \
208         extras/MacOSX/Resources/vlc.scriptSuite \
209         extras/MacOSX/Resources/README \
210         extras/MacOSX/vlc.pbproj/project.pbxproj \
211         extras/MacOSX/macosx-dmg \
212         $(NULL)
213
214 ###############################################################################
215 # MS Visual Studio and eMbedded Visual Studio projects
216 ###############################################################################
217
218 EXTRA_DIST += \
219         msvc/vlc.dsw \
220         msvc/libvlc.dsp.in \
221         msvc/plugins.dsp.in \
222         msvc/vlc.dsp.in \
223         msvc/config.h.in \
224         msvc/modules_builtin_msvc.h \
225         evc/vlc.vcw \
226         evc/libvlc.vcp.in \
227         evc/vlc.vcp.in \
228         evc/plugins.vcp.in \
229         evc/vlc.c \
230         evc/config.h.in \
231         evc/modules_builtin_evc.h \
232         $(NULL)
233
234 dist-hook:
235         mv $(distdir)/vlc.ebuild $(distdir)/vlc-${VERSION}.ebuild
236         cd $(distdir) && srcdir=$(srcdir) $(srcdir)/toolbox --update-vc
237
238 ###############################################################################
239 # Building libvlc
240 ###############################################################################
241
242 bin_SCRIPTS = vlc-config
243
244 lib_LIBRARIES = lib/libvlc.a $(LIBRARIES_libvlc_pic)
245
246 lib_libvlc_a_SOURCES = $(SOURCES_libvlc)
247 dist_lib_libvlc_a_SOURCES = src/misc/modules_plugin.h
248 lib_libvlc_a_CFLAGS = `$(VLC_CONFIG) --cflags vlc`
249 lib_libvlc_a_CXXFLAGS = `$(VLC_CONFIG) --cxxflags vlc`
250 lib_libvlc_a_OBJCFLAGS = `$(VLC_CONFIG) --objcflags vlc`
251
252 lib_libvlc_pic_a_SOURCES = $(SOURCES_libvlc)
253 lib_libvlc_pic_a_CFLAGS = `$(VLC_CONFIG) --cflags vlc pic`
254 lib_libvlc_pic_a_CXXFLAGS = `$(VLC_CONFIG) --cxxflags vlc pic`
255 lib_libvlc_pic_a_OBJCFLAGS = `$(VLC_CONFIG) --objcflags vlc pic`
256
257 if HAVE_BEOS
258 OPT_SOURCES_libvlc_beos = $(SOURCES_libvlc_beos)
259 endif
260 if HAVE_DARWIN
261 OPT_SOURCES_libvlc_darwin = $(SOURCES_libvlc_darwin)
262 endif
263 if HAVE_WIN32
264 OPT_SOURCES_libvlc_win32 = $(SOURCES_libvlc_win32)
265 endif
266 if BUILD_DIRENT
267 OPT_SOURCES_libvlc_dirent = $(SOURCES_libvlc_dirent)
268 endif
269 if BUILD_GETOPT
270 OPT_SOURCES_libvlc_getopt = $(SOURCES_libvlc_getopt)
271 endif
272 if BUILD_MOZILLA
273 if !HAVE_WIN32
274 LIBRARIES_libvlc_pic = lib/libvlc_pic.a
275 endif
276 endif
277
278 EXTRA_DIST += \
279         $(SOURCES_libvlc_beos) \
280         $(SOURCES_libvlc_darwin) \
281         $(SOURCES_libvlc_win32) \
282         $(SOURCES_libvlc_dirent) \
283         $(SOURCES_libvlc_getopt) \
284         $(NULL)
285
286 SOURCES_libvlc_beos = \
287         src/misc/beos_specific.cpp \
288         $(NULL)
289
290 SOURCES_libvlc_darwin = \
291         src/misc/darwin_specific.m \
292         $(NULL)
293
294 SOURCES_libvlc_win32 = \
295         src/misc/win32_specific.c \
296         $(NULL)
297
298 SOURCES_libvlc_dirent = \
299         src/extras/dirent.c \
300         src/extras/dirent.h \
301         $(NULL)
302
303 SOURCES_libvlc_getopt = \
304         src/extras/getopt.c \
305         src/extras/getopt.h \
306         src/extras/getopt1.c \
307         $(NULL)
308
309 SOURCES_libvlc_common = \
310         src/libvlc.c \
311         src/libvlc.h \
312         src/interface/interface.c \
313         src/interface/intf_eject.c \
314         src/playlist/playlist.c \
315         src/playlist/sort.c \
316         src/playlist/loadsave.c \
317         src/playlist/group.c \
318         src/playlist/item.c \
319         src/input/input.c \
320         src/input/stream.c \
321         src/input/demux.c \
322         src/input/subtitles.c \
323         src/input/input_ext-plugins.c \
324         src/input/input_ext-dec.c \
325         src/input/input_ext-intf.c \
326         src/input/input_dec.c \
327         src/input/input_programs.c \
328         src/input/input_clock.c \
329         src/input/input_info.c \
330         src/video_output/video_output.c \
331         src/video_output/vout_pictures.c \
332         src/video_output/vout_pictures.h \
333         src/video_output/video_text.c \
334         src/video_output/vout_subpictures.c \
335         src/video_output/vout_synchro.c \
336         src/audio_output/common.c \
337         src/audio_output/dec.c \
338         src/audio_output/filters.c \
339         src/audio_output/input.c \
340         src/audio_output/mixer.c \
341         src/audio_output/output.c \
342         src/audio_output/intf.c \
343         src/stream_output/stream_output.c \
344         src/misc/charset.c \
345         src/misc/mtime.c \
346         src/misc/block.c \
347         src/misc/modules.c \
348         src/misc/threads.c \
349         src/misc/cpu.c \
350         src/misc/configuration.c \
351         src/misc/iso_lang.c \
352         src/misc/iso-639_def.h \
353         src/misc/messages.c \
354         src/misc/objects.c \
355         src/misc/variables.c \
356         src/misc/error.c \
357         src/extras/libc.c \
358         $(NULL)
359
360 SOURCES_libvlc = \
361         $(SOURCES_libvlc_common) \
362         $(OPT_SOURCES_libvlc_beos) \
363         $(OPT_SOURCES_libvlc_darwin) \
364         $(OPT_SOURCES_libvlc_win32) \
365         $(OPT_SOURCES_libvlc_dirent) \
366         $(OPT_SOURCES_libvlc_getopt) \
367         $(NULL)
368
369 ###############################################################################
370 # Building vlc
371 ###############################################################################
372
373 bin_PROGRAMS = vlc
374
375 vlc_SOURCES = src/vlc.c
376
377 vlc_LDFLAGS = `$(VLC_CONFIG) --libs vlc builtin`
378 vlc_LDADD = lib/libvlc.a $(DATA_win32_rc) $(LIB_intl)
379 vlc_CFLAGS = `$(VLC_CONFIG) --cflags vlc`
380
381 # We use DEPENDENCIES_vlc instead of vlc_DEPENDENCIES because of an
382 # old automake-1.5 bug (automake/279).
383 DEPENDENCIES_vlc = lib/libvlc.a $(DATA_win32_rc) $(LIB_intl)
384
385 vlc$(EXEEXT): $(vlc_OBJECTS) $(DEPENDENCIES_vlc) stamp-builtin
386         @rm -f $(top_builddir)/vlc$(EXEEXT)
387         @case `$(VLC_CONFIG) --linkage vlc builtin` in \
388           c++) echo $(CXXLINK) $(vlc_OBJECTS) $(vlc_LDADD) $(vlc_LDFLAGS) $(LIBS) ; $(CXXLINK) $(vlc_OBJECTS) $(vlc_LDADD) $(vlc_LDFLAGS) $(LIBS) ;; \
389           objc) echo $(OBJCLINK) $(vlc_OBJECTS) $(vlc_LDADD) $(vlc_LDFLAGS) $(LIBS) ; $(OBJCLINK) $(vlc_OBJECTS) $(vlc_LDADD) $(vlc_LDFLAGS) $(LIBS) ;; \
390           c|*) echo $(LINK) $(vlc_OBJECTS) $(vlc_LDADD) $(vlc_LDFLAGS) $(LIBS) ; $(LINK) $(vlc_OBJECTS) $(vlc_LDADD) $(vlc_LDFLAGS) $(LIBS) ;; \
391         esac
392
393 if HAVE_BEOS
394         xres -o $@ $(srcdir)/share/vlc_beos.rsrc
395         mimeset -f $@
396         rm -Rf $(srcdir)/locale ; mkdir -p "$(srcdir)/locale"
397         for i in $(ALL_LINGUAS); do \
398           mkdir -p "$(srcdir)/locale/$${i}/LC_MESSAGES" ; \
399           cp "$(srcdir)/po/$${i}.gmo" \
400             "$(srcdir)/locale/$${i}/LC_MESSAGES/vlc.mo" || true ; \
401         done
402 endif
403
404 # Install the modules and the symlinks
405 install-exec-local:
406         for i in "" `$(VLC_CONFIG) --target plugin` ; do if test -n "$$i" ; then \
407           echo $(INSTALL) -m 755 "$$i$(LIBEXT)" "$(DESTDIR)$(libdir)/vlc/`echo $$i | sed -e 's,.*modules/\([^/]*\).*,\1,'`" ; \
408           $(INSTALL) -m 755 "$$i$(LIBEXT)" "$(DESTDIR)$(libdir)/vlc/`echo $$i | sed -e 's,.*modules/\([^/]*\).*,\1,'`" ; \
409         fi ; done
410         for i in "" `$(VLC_CONFIG) --target builtin` ; do if test -n "$$i" ; then \
411           echo $(INSTALL) -m 644 "$$i" "$(DESTDIR)$(libdir)/vlc" ; \
412           $(INSTALL) -m 644 "$$i" "$(DESTDIR)$(libdir)/vlc" ; \
413         fi ; done
414 if BUILD_MOZILLA
415         for i in "" `$(VLC_CONFIG) --target builtin pic` ; do if test -n "$$i" ; then \
416           echo $(INSTALL) -m 644 "$$i" "$(DESTDIR)$(libdir)/vlc" ; \
417           $(INSTALL) -m 644 "$$i" "$(DESTDIR)$(libdir)/vlc" ; \
418         fi ; done
419 endif
420         for i in "" $(ALIASES) ; do if test -n "$$i" ; then \
421           rm -f "$(DESTDIR)$(bindir)/$$i" && \
422           ln -s vlc "$(DESTDIR)$(bindir)/$$i" ; \
423         fi ; done
424
425 if HAVE_DARWIN
426 # Create the MacOS X app
427 vlc_app_DATA = VLC.app
428 vlc_appdir = $(bindir)
429 VLC.app: vlc
430         @if test -e "$(top_builddir)/tmp"; then \
431           echo "Error: please remove $(top_builddir)/tmp, it is in the way"; \
432           false; \
433         else \
434           echo "OK."; mkdir -p "$(top_builddir)/tmp/extras"; \
435         fi
436         rm -Rf $(top_builddir)/VLC.app
437         cp -r $(srcdir)/extras/MacOSX $(top_builddir)/tmp/extras
438         for i in AUTHORS COPYING README.MacOSX.rtf THANKS; do \
439           cp "$(srcdir)/$$i" $(top_builddir)/tmp; \
440         done
441         mkdir -p $(top_builddir)/tmp/modules/audio_output
442         cp $(srcdir)/modules/audio_output/coreaudio.c \
443            $(top_builddir)/tmp/modules/audio_output/coreaudio.c
444         mkdir -p $(top_builddir)/tmp/modules/gui/macosx
445         for i in \
446             about.h \
447             about.m \
448             applescript.h \
449             applescript.m \
450             controls.h \
451             controls.m \
452             info.h \
453             info.m \
454             intf.h \
455             intf.m \
456             macosx.m \
457             misc.h \
458             misc.m \
459             open.h \
460             open.m \
461             output.h \
462             output.m \
463             playlist.h \
464             playlist.m \
465             prefs.h \
466             prefs.m \
467             vout.h \
468             vout.m; do \
469           cp "$(srcdir)/modules/gui/macosx/$$i" \
470              $(top_builddir)/tmp/modules/gui/macosx; \
471         done
472         cd $(top_builddir)/tmp/extras/MacOSX && xcodebuild -target vlc | grep -v '^\([ \t]\|$$\)'
473         cp -r $(top_builddir)/tmp/extras/MacOSX/build/vlc.bundle \
474               $(top_builddir)/VLC.app
475         rm -Rf $(top_builddir)/tmp
476         $(INSTALL) -d $(top_builddir)/VLC.app/Contents/MacOS
477         $(INSTALL) $(top_builddir)/vlc \
478                    $(top_builddir)/VLC.app/Contents/MacOS/VLC
479         $(INSTALL) -d $(top_builddir)/VLC.app/Contents/MacOS/modules
480         for i in "" `$(VLC_CONFIG) --target plugin` ; do \
481           if test -n "$$i" ; \
482             then $(INSTALL) "$$i$(LIBEXT)" \
483                            "$(top_builddir)/VLC.app/Contents/MacOS/modules" ; \
484           fi ; done
485         if test -d $(top_builddir)/extras/contrib/vlc-lib; then \
486           cp -R $(top_builddir)/extras/contrib/vlc-lib \
487             $(top_builddir)/VLC.app/Contents/MacOS/lib ; \
488         fi
489         $(INSTALL) -d $(top_builddir)/VLC.app/Contents/MacOS/share
490         $(INSTALL) -d $(top_builddir)/VLC.app/Contents/MacOS/share/http
491         $(INSTALL) -m 644 $(srcdir)/share/http/*.html \
492             $(top_builddir)/VLC.app/Contents/MacOS/share/http
493         $(INSTALL) -d $(top_builddir)/VLC.app/Contents/MacOS/share/http/admin
494         $(INSTALL) -m 644 $(srcdir)/share/http/admin/*.html \
495             $(top_builddir)/VLC.app/Contents/MacOS/share/http/admin
496         $(INSTALL) -d $(top_builddir)/VLC.app/Contents/MacOS/locale
497         for i in $(ALL_LINGUAS); do \
498           mkdir -p $(top_builddir)/VLC.app/Contents/MacOS/locale/$${i}/LC_MESSAGES ; \
499           cp $(srcdir)/po/$${i}.gmo $(top_builddir)/VLC.app/Contents/MacOS/locale/$${i}/LC_MESSAGES/vlc.mo || true ; \
500           mkdir -p $(top_builddir)/VLC.app/Contents/Resources/$${i}.lproj ; \
501           ln -sf ../English.lproj/InfoPlist.strings \
502               $(top_builddir)/VLC.app/Contents/Resources/$${i}.lproj ; \
503           ln -sf ../English.lproj/MainMenu.nib \
504               $(top_builddir)/VLC.app/Contents/Resources/$${i}.lproj ; \
505           ln -sf ../English.lproj/vlc.scriptTerminology \
506               $(top_builddir)/VLC.app/Contents/Resources/$${i}.lproj ; \
507         done
508         printf "APPLVLC#" >| $(top_builddir)/VLC.app/Contents/PkgInfo
509 endif
510
511 if HAVE_WIN32
512 DATA_win32_rc = $(noinst_share_vlc_win32_rc_DATA)
513 noinst_share_vlc_win32_rc_DATA = share/vlc_win32_rc.$(OBJEXT)
514 noinst_share_vlc_win32_rcdir = $(libdir)
515 share/vlc_win32_rc.$(OBJEXT): share/vlc_win32_rc.rc
516         $(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 $@
517 endif
518
519 ###############################################################################
520 # Building specific source packages
521 ###############################################################################
522
523 dist-woody: distdir
524         $(remove_distdir_woody)
525         mv $(distdir) $(PACKAGE)-woody-$(VERSION)
526         $(srcdir)/toolbox --make-woody $(PACKAGE)-woody-$(VERSION)
527         $(AMTAR) chof - $(PACKAGE)-woody-$(VERSION) \
528           | GZIP=$(GZIP_ENV) gzip -c >$(PACKAGE)-woody-$(VERSION).tar.gz
529         $(remove_distdir_woody)
530
531 remove_distdir_woody = \
532   { test ! -d $(PACKAGE)-woody-$(VERSION) \
533     || { find $(PACKAGE)-woody-$(VERSION) -type d ! -perm -200 \
534            -exec chmod u+w {} ';' \
535          && rm -fr $(PACKAGE)-woody-$(VERSION); }; }
536
537 ###############################################################################
538 # Building architecture-specific binary packages
539 ###############################################################################
540
541 # XXX: this rule is probably only useful to you if you have exactly
542 # the same setup as me. Contact sam@zoy.org if you need to use it.
543 #
544 # Check that tmp isn't in the way
545 package-win32-base:
546         @if test -e "$(srcdir)/vlc-${VERSION}"; then \
547           echo "Error: please remove $(srcdir)/vlc-${VERSION}, it is in the way"; \
548           false; \
549         else \
550           echo "OK."; mkdir -p "$(srcdir)/vlc-${VERSION}"; \
551         fi
552 # Create installation script
553         cp "$(srcdir)/install-win32" "$(srcdir)/vlc-${VERSION}/nsi"
554 # Copy relevant files
555         cp "$(top_builddir)/vlc$(EXEEXT)" "$(srcdir)/vlc-${VERSION}/"
556         $(STRIP) "$(srcdir)/vlc-${VERSION}/vlc$(EXEEXT)"
557         for file in AUTHORS MAINTAINERS THANKS NEWS COPYING README ; \
558           do cp "$(srcdir)/$$file" "$(srcdir)/vlc-${VERSION}/$${file}.txt" ; \
559           unix2dos "$(srcdir)/vlc-${VERSION}/$${file}.txt" ; done
560
561         mkdir -p "$(srcdir)/vlc-${VERSION}/plugins"
562         for i in "" `$(VLC_CONFIG) --target plugin` ; do \
563           if test -n "$$i" ; then \
564             $(INSTALL) "$(srcdir)/$$i$(LIBEXT)" \
565             "$(srcdir)/vlc-${VERSION}/plugins/" ; \
566           fi ; done
567
568         for i in "" $(srcdir)/vlc-${VERSION}/plugins/*$(LIBEXT) ; \
569           do if test -n "$$i" ; then $(STRIP) "$$i" ; fi ; done
570
571         mkdir $(srcdir)/vlc-${VERSION}/locale
572         for i in $(ALL_LINGUAS); do \
573           mkdir -p "$(srcdir)/vlc-${VERSION}/locale/$${i}/LC_MESSAGES" ; \
574           cp "$(srcdir)/po/$${i}.gmo" \
575             "$(srcdir)/vlc-${VERSION}/locale/$${i}/LC_MESSAGES/vlc.mo" \
576             || true ; \
577         done
578
579         mkdir -p $(srcdir)/vlc-${VERSION}/skins/default
580         for i in $(srcdir)/share/skins/default/*.*; do \
581           cp $$i $(srcdir)/vlc-${VERSION}/skins/default/ || true ; \
582         done
583         for i in $(srcdir)/doc/skins/*.txt; do \
584           cp $$i $(srcdir)/vlc-${VERSION}/skins/ || true ; \
585         done
586
587         mkdir -p "$(srcdir)/vlc-${VERSION}/http/admin"
588         cp $(srcdir)/share/http/*.html $(srcdir)/vlc-${VERSION}/http/ ;
589         cp $(srcdir)/share/http/*.css $(srcdir)/vlc-${VERSION}/http/ ;
590         cp $(srcdir)/share/http/admin/*.html \
591            $(srcdir)/vlc-${VERSION}/http/admin/ ;
592         cp $(srcdir)/share/http/admin/.access \
593            $(srcdir)/vlc-${VERSION}/http/admin/ ;
594
595         mkdir -p "$(srcdir)/vlc-${VERSION}/mozilla"
596 if BUILD_MOZILLA
597         cp $(srcdir)/mozilla/*$(LIBEXT) $(srcdir)/vlc-${VERSION}/mozilla/ ;
598         $(STRIP) $(srcdir)/vlc-${VERSION}/mozilla/*$(LIBEXT);
599         cp $(srcdir)/mozilla/vlcintf.xpt  $(srcdir)/vlc-${VERSION}/mozilla/ ;
600 endif
601
602 package-win32-base-exe:
603 # Create package 
604         wine ~/.wine/fake_windows/Program\ Files/NSIS/makensis.exe \
605              -- /DVERSION=${VERSION} $(srcdir)/vlc-${VERSION}/nsi
606
607 package-win32-base-zip:
608 # Create package 
609         zip -r vlc-${VERSION}-win32.zip vlc-${VERSION}
610
611 package-win32-exe: package-win32-base package-win32-base-exe
612 # Clean up
613         rm -Rf $(srcdir)/vlc-${VERSION}
614
615 package-win32-zip: package-win32-base package-win32-base-zip
616 # Clean up
617         rm -Rf $(srcdir)/vlc-${VERSION}
618
619 package-win32: package-win32-base package-win32-base-exe package-win32-base-zip
620 # Clean up
621         rm -Rf $(srcdir)/vlc-${VERSION}
622
623 package-beos:
624 # Check that tmp isn't in the way
625         @if test -e $(srcdir)/tmp; then \
626           echo "Error: please remove $(srcdir)/tmp, it is in the way"; \
627           false; \
628         else \
629           echo "OK."; mkdir $(srcdir)/tmp; \
630         fi
631
632 # Copy relevant files
633         mkdir -p $(srcdir)/tmp/vlc
634         cd $(srcdir) && \
635           cp vlc AUTHORS COPYING ChangeLog README THANKS NEWS tmp/vlc/
636 # We cannot use ${PLUGIN_FILES} as it looks like it is too "long" for the BeOS shell...
637         if [ `find $(srcdir)/modules -name "lib*_plugin.so" | wc -l` -gt 0 ]; then \
638           mkdir -p $(srcdir)/tmp/vlc/plugins; \
639           find $(srcdir)/modules -name "lib*_plugin.so" | xargs -i{} cp {} $(srcdir)/tmp/vlc/plugins/; \
640         fi
641         for i in $(ALL_LINGUAS); do \
642           mkdir -p $(srcdir)/tmp/vlc/locale/$${i}/LC_MESSAGES ; \
643           cp $(srcdir)/po/$${i}.gmo $(srcdir)/tmp/vlc/locale/$${i}/LC_MESSAGES/vlc.mo || true ; \
644         done
645
646 # Create package with debug symbols
647         mimeset -f $(srcdir)/tmp/vlc/* $(srcdir)/tmp/vlc/*/*
648         mv $(srcdir)/tmp/vlc $(srcdir)/tmp/vlc-${VERSION}
649         (cd $(srcdir)/tmp ; zip -9 -r vlc-${VERSION}-BeOS-debug.zip vlc-${VERSION} )
650         mv $(srcdir)/tmp/vlc-${VERSION}-BeOS-debug.zip $(srcdir)/
651
652 # Create package without debug symbols
653         mv $(srcdir)/tmp/vlc-${VERSION} $(srcdir)/tmp/vlc
654         strip $(srcdir)/tmp/vlc/vlc
655         if [ -d $(srcdir)/tmp/vlc/plugins ]; then \
656           strip $(srcdir)/tmp/vlc/plugins/lib*_plugin.so; \
657         fi
658         xres -o $(srcdir)/tmp/vlc/vlc $(srcdir)/share/vlc_beos.rsrc
659         mimeset -f $(srcdir)/tmp/vlc/* $(srcdir)/tmp/vlc/*/*
660         mv $(srcdir)/tmp/vlc $(srcdir)/tmp/vlc-${VERSION}
661         (cd $(srcdir)/tmp ; zip -9 -r vlc-${VERSION}-BeOS.zip vlc-${VERSION} )
662         mv $(srcdir)/tmp/vlc-${VERSION}-BeOS.zip $(srcdir)/
663
664 # Clean up
665         rm -Rf $(srcdir)/tmp
666
667 package-macosx:
668 # Check that tmp isn't in the way
669         @if test -e "$(top_builddir)/tmp"; then \
670           echo "Error: please remove $(top_builddir)/tmp, it is in the way"; \
671           false; \
672         else \
673           echo "OK."; mkdir -p "$(top_builddir)/tmp"; \
674         fi
675
676 # Copy relevant files 
677         cp -R "$(top_builddir)/VLC.app" "$(top_builddir)/tmp/"
678         cd "$(srcdir)" && cp AUTHORS COPYING ChangeLog README README.MacOSX.rtf THANKS NEWS $(top_builddir)/tmp/
679
680 # Create disk image 
681         $(srcdir)/extras/MacOSX/macosx-dmg 25 "vlc-${VERSION}" $(top_builddir)/tmp/* 
682
683 # Clean up
684         rm -Rf $(top_builddir)/tmp
685
686 ###############################################################################
687 # Stamp rules
688 ###############################################################################
689 clean: clean-stamp
690 clean-stamp:
691         rm -f stamp-builtin
692
693 stamp-builtin: FORCE
694         @for dep in "" `$(VLC_CONFIG) --target builtin`; do \
695           if test "$${dep}" -nt "$(top_builddir)/vlc$(EXEEXT)"; then \
696             rm -f $@; \
697             break; \
698           fi; \
699         done
700         @if test ! -f $@; then printf "" > $@; fi
701
702 ###############################################################################
703 # Force rule
704 ###############################################################################
705 FORCE: