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