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