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