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