691e54863b110b8952036ad0614db2781ba7f187
[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 activex 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-api.pl \
27         vlc-config.in.in \
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         stamp-api \
49         src/misc/modules_builtin.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         include/vlc/control.h \
63         $(NULL)
64
65 noinst_HEADERS = $(HEADERS_include)
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_md5.h \
106         include/vlc_image.h \
107         include/vlc_input.h \
108         include/vlc_interface.h \
109         include/vlc_keys.h \
110         include/vlc_messages.h \
111         include/vlc_meta.h \
112         include/vlc_objects.h \
113         include/vlc_playlist.h \
114         include/vlc_spu.h \
115         include/vlc_stream.h \
116         include/vlc_symbols.h \
117         include/vlc_threads_funcs.h \
118         include/vlc_threads.h \
119         include/vlc_video.h \
120         include/vlc_vlm.h \
121         include/vlc_vod.h \
122         include/vlc_xml.h \
123         include/vout_synchro.h \
124         include/win32_specific.h \
125         $(NULL)
126
127 src/misc/modules_builtin.h: Makefile src/misc/modules_builtin.h.in vlc-config
128         srcdir=$(srcdir) $(srcdir)/toolbox --update-includes
129         touch $@
130
131 # These dependencies are mandatory
132 $(SOURCES_libvlc): src/misc/modules_builtin.h $(LIB_intl)
133
134 ###############################################################################
135 # Optional libintl - FIXME, bad dependencies
136 ###############################################################################
137
138 intl/libintl.a: FORCE
139         cd $(top_builddir)/intl && $(MAKE) $(AM_MAKEFLAGS)
140
141 if BUILD_INTL
142 LIB_intl = intl/libintl.a
143 endif
144
145 ###############################################################################
146 # MacOS X project
147 ###############################################################################
148
149 EXTRA_DIST += \
150         extras/MacOSX/Resources/English.lproj/MainMenu.nib/classes.nib \
151         extras/MacOSX/Resources/English.lproj/MainMenu.nib/info.nib \
152         extras/MacOSX/Resources/English.lproj/MainMenu.nib/objects.nib \
153         extras/MacOSX/Resources/English.lproj/About.nib/classes.nib \
154         extras/MacOSX/Resources/English.lproj/About.nib/info.nib \
155         extras/MacOSX/Resources/English.lproj/About.nib/keyedobjects.nib \
156         extras/MacOSX/Resources/English.lproj/Open.nib/classes.nib \
157         extras/MacOSX/Resources/English.lproj/Open.nib/info.nib \
158         extras/MacOSX/Resources/English.lproj/Open.nib/keyedobjects.nib \
159         extras/MacOSX/Resources/English.lproj/Preferences.nib/classes.nib \
160         extras/MacOSX/Resources/English.lproj/Preferences.nib/info.nib \
161         extras/MacOSX/Resources/English.lproj/Preferences.nib/keyedobjects.nib \
162         extras/MacOSX/Resources/English.lproj/InfoPlist.strings \
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/vlc.scriptTerminology \
223         extras/MacOSX/Resources/README \
224         extras/MacOSX/vlc.pbproj/project.pbxproj \
225         extras/MacOSX/macosx-dmg \
226         $(NULL)
227
228 ###############################################################################
229 # MS Visual Studio and eMbedded Visual Studio projects
230 ###############################################################################
231
232 EXTRA_DIST += \
233         msvc/vlc.dsw \
234         msvc/libvlc.dsp.in \
235         msvc/plugins.dsp.in \
236         msvc/vlc.dsp.in \
237         msvc/config.h.in \
238         msvc/modules_builtin_msvc.h \
239         evc/vlc.vcw \
240         evc/libvlc.vcp.in \
241         evc/vlc.vcp.in \
242         evc/plugins.vcp.in \
243         evc/errno.h \
244         evc/config.h.in \
245         evc/modules_builtin_evc.h \
246         $(NULL)
247
248 dist-hook:
249         cd $(distdir) && srcdir=$(srcdir) $(srcdir)/toolbox --update-vc
250         distdir=$(distdir) srcdir=$(srcdir) $(srcdir)/toolbox --dist-contrib
251
252 ###############################################################################
253 # Building libvlc
254 ###############################################################################
255
256 bin_SCRIPTS = vlc-config
257 vlc-config: $(top_builddir)/config.status $(top_builddir)/vlc-config.in
258         cd $(top_builddir) && $(SHELL) ./config.status --file=$@
259         -cd $(top_builddir) && chmod 0755 $@
260
261 $(SOURCES): vlc-config
262
263 CLEANFILES = $(BUILT_SOURCES)
264
265 lib_LIBRARIES = lib/libvlc.a $(LIBRARIES_libvlc_pic)
266
267 lib_libvlc_a_SOURCES = $(SOURCES_libvlc)
268 lib_libvlc_a_CFLAGS = `$(VLC_CONFIG) --cflags vlc`
269 lib_libvlc_a_CXXFLAGS = `$(VLC_CONFIG) --cxxflags vlc`
270 lib_libvlc_a_OBJCFLAGS = `$(VLC_CONFIG) --objcflags vlc`
271
272 lib_libvlc_pic_a_SOURCES = $(SOURCES_libvlc)
273 lib_libvlc_pic_a_CFLAGS = `$(VLC_CONFIG) --cflags vlc pic`
274 lib_libvlc_pic_a_CXXFLAGS = `$(VLC_CONFIG) --cxxflags vlc pic`
275 lib_libvlc_pic_a_OBJCFLAGS = `$(VLC_CONFIG) --objcflags vlc pic`
276
277 if HAVE_BEOS
278 OPT_SOURCES_libvlc_beos = $(SOURCES_libvlc_beos)
279 endif
280 if HAVE_DARWIN
281 OPT_SOURCES_libvlc_darwin = $(SOURCES_libvlc_darwin)
282 endif
283 if HAVE_WIN32
284 OPT_SOURCES_libvlc_win32 = $(SOURCES_libvlc_win32)
285 endif
286 if HAVE_WINCE
287 OPT_SOURCES_libvlc_win32 = $(SOURCES_libvlc_win32)
288 endif
289 if BUILD_DIRENT
290 OPT_SOURCES_libvlc_dirent = $(SOURCES_libvlc_dirent)
291 endif
292 if BUILD_GETOPT
293 OPT_SOURCES_libvlc_getopt = $(SOURCES_libvlc_getopt)
294 endif
295 if BUILD_MOZILLA
296 if !HAVE_WIN32
297 LIBRARIES_libvlc_pic = lib/libvlc_pic.a
298 endif
299 endif
300
301 EXTRA_DIST += \
302         $(SOURCES_libvlc_beos) \
303         $(SOURCES_libvlc_darwin) \
304         $(SOURCES_libvlc_win32) \
305         $(SOURCES_libvlc_dirent) \
306         $(SOURCES_libvlc_getopt) \
307         $(NULL)
308
309 SOURCES_libvlc_beos = \
310         src/misc/beos_specific.cpp \
311         $(NULL)
312
313 SOURCES_libvlc_darwin = \
314         src/misc/darwin_specific.m \
315         $(NULL)
316
317 SOURCES_libvlc_win32 = \
318         src/misc/win32_specific.c \
319         $(NULL)
320
321 SOURCES_libvlc_dirent = \
322         src/extras/dirent.c \
323         $(NULL)
324
325 SOURCES_libvlc_getopt = \
326         src/extras/getopt.c \
327         src/extras/getopt.h \
328         src/extras/getopt1.c \
329         $(NULL)
330
331 SOURCES_libvlc_common = \
332         src/libvlc.c \
333         src/libvlc.h \
334         src/interface/interface.c \
335         src/interface/intf_eject.c \
336         src/playlist/playlist.c \
337         src/playlist/sort.c \
338         src/playlist/loadsave.c \
339         src/playlist/view.c \
340         src/playlist/item.c \
341         src/playlist/item-ext.c \
342         src/playlist/services_discovery.c \
343         src/input/access.c \
344         src/input/clock.c \
345         src/input/control.c \
346         src/input/decoder.c \
347         src/input/demux.c \
348         src/input/es_out.c \
349         src/input/input.c \
350         src/input/input_internal.h \
351         src/input/stream.c \
352         src/input/mem_stream.c \
353         src/input/subtitles.c \
354         src/input/var.c \
355         src/video_output/video_output.c \
356         src/video_output/vout_pictures.c \
357         src/video_output/vout_pictures.h \
358         src/video_output/video_text.c \
359         src/video_output/video_widgets.c \
360         src/video_output/vout_subpictures.c \
361         src/video_output/vout_synchro.c \
362         src/video_output/vout_intf.c \
363         src/audio_output/common.c \
364         src/audio_output/dec.c \
365         src/audio_output/filters.c \
366         src/audio_output/input.c \
367         src/audio_output/mixer.c \
368         src/audio_output/output.c \
369         src/audio_output/intf.c \
370         src/stream_output/stream_output.c \
371         src/stream_output/announce.c \
372         src/stream_output/sap.c \
373         src/misc/charset.c \
374         src/misc/httpd.c \
375         src/misc/tls.c \
376         src/misc/md5.c \
377         src/misc/mtime.c \
378         src/misc/block.c \
379         src/misc/modules.c \
380         src/misc/threads.c \
381         src/misc/cpu.c \
382         src/misc/configuration.c \
383         src/misc/image.c \
384         src/misc/iso_lang.c \
385         src/misc/iso-639_def.h \
386         src/misc/messages.c \
387         src/misc/objects.c \
388         src/misc/variables.c \
389         src/misc/error.c \
390         src/misc/net.c \
391         src/misc/getaddrinfo.c \
392         src/misc/vlm.c \
393         src/misc/xml.c \
394         src/extras/libc.c \
395         src/control/core.c \
396         src/control/util.c \
397         src/control/audio_video.c \
398         $(NULL)
399
400 SOURCES_libvlc = \
401         $(SOURCES_libvlc_common) \
402         $(OPT_SOURCES_libvlc_beos) \
403         $(OPT_SOURCES_libvlc_darwin) \
404         $(OPT_SOURCES_libvlc_win32) \
405         $(OPT_SOURCES_libvlc_dirent) \
406         $(OPT_SOURCES_libvlc_getopt) \
407         $(NULL)
408
409 ###############################################################################
410 # Building vlc
411 ###############################################################################
412
413 bin_PROGRAMS = vlc
414
415 vlc_SOURCES = src/vlc.c
416
417 # Work around a bug in the arm-wince-pe linker
418 if HAVE_WINCE
419 vlc_WORKAROUNDLDFLAGS = lib/libvlc.a
420 endif
421
422 vlc_LDFLAGS = `$(VLC_CONFIG) --libs vlc builtin` $(vlc_WORKAROUNDLDFLAGS)
423 vlc_LDADD = lib/libvlc.a $(DATA_win32_rc) $(LIB_intl)
424 vlc_CFLAGS = `$(VLC_CONFIG) --cflags vlc`
425
426 # We use DEPENDENCIES_vlc instead of vlc_DEPENDENCIES because of an
427 # old automake-1.5 bug (automake/279).
428 DEPENDENCIES_vlc = lib/libvlc.a $(DATA_win32_rc) $(LIB_intl)
429
430 vlc$(EXEEXT): $(vlc_OBJECTS) $(DEPENDENCIES_vlc) stamp-builtin
431         @rm -f $(top_builddir)/vlc$(EXEEXT)
432         @case `$(VLC_CONFIG) --linkage vlc builtin` in \
433           c++) echo $(CXXLINK) $(vlc_OBJECTS) $(vlc_LDADD) $(vlc_LDFLAGS) $(LIBS) ; $(CXXLINK) $(vlc_OBJECTS) $(vlc_LDADD) $(vlc_LDFLAGS) $(LIBS) ;; \
434           objc) echo $(OBJCLINK) $(vlc_OBJECTS) $(vlc_LDADD) $(vlc_LDFLAGS) $(LIBS) ; $(OBJCLINK) $(vlc_OBJECTS) $(vlc_LDADD) $(vlc_LDFLAGS) $(LIBS) ;; \
435           c|*) echo $(LINK) $(vlc_OBJECTS) $(vlc_LDADD) $(vlc_LDFLAGS) $(LIBS) ; $(LINK) $(vlc_OBJECTS) $(vlc_LDADD) $(vlc_LDFLAGS) $(LIBS) ;; \
436         esac
437
438 if HAVE_BEOS
439 noinst_DATA = vlc-bundle
440 vlc-bundle: vlc
441         rm -Rf $(top_builddir)/vlc-bundle ; mkdir -p $(top_builddir)/vlc-bundle
442         cp $(top_builddir)/vlc $(top_builddir)/vlc-bundle/
443         xres -o $(top_builddir)/vlc-bundle/vlc $(srcdir)/share/vlc_beos.rsrc
444         for i in "" `$(VLC_CONFIG) --target plugin` ; do \
445           if test -n "$$i" ; then \
446             mkdir -p $(top_builddir)/vlc-bundle/plugins ; \
447             cp "$$i$(LIBEXT)" $(top_builddir)/vlc-bundle/plugins/ ; \
448           fi ; \
449         done
450         if test -d $(top_builddir)/extras/contrib/vlc-lib ; then \
451           mkdir -p $(top_builddir)/vlc-bundle/lib ; \
452           for i in $(top_builddir)/extras/contrib/vlc-lib/*.so ; do \
453             cp $$i $(top_builddir)/vlc-bundle/lib/ ; \
454           done ; \
455         fi
456         for i in $(ALL_LINGUAS); do \
457           mkdir -p "$(top_builddir)/vlc-bundle/locale/$$i/LC_MESSAGES" ; \
458           cp "$(top_builddir)/po/$$i.gmo" \
459             "$(top_builddir)/vlc-bundle/locale/$$i/LC_MESSAGES/vlc.mo" || true ; \
460         done
461         find $(top_builddir)/vlc-bundle -type f -exec mimeset -f "{}" \;
462 endif
463
464 # Install the modules and the symlinks
465 install-exec-local:
466         for i in "" `$(VLC_CONFIG) --target plugin` ; do if test -n "$$i" ; then \
467           echo $(INSTALL) -m 755 "$$i$(LIBEXT)" "$(DESTDIR)$(libdir)/vlc/`echo $$i | sed -e 's,.*modules/\([^/]*\).*,\1,'`" ; \
468           $(INSTALL) -m 755 "$$i$(LIBEXT)" "$(DESTDIR)$(libdir)/vlc/`echo $$i | sed -e 's,.*modules/\([^/]*\).*,\1,'`" ; \
469         fi ; done
470         for i in "" `$(VLC_CONFIG) --target builtin` ; do if test -n "$$i" ; then \
471           echo $(INSTALL) -m 644 "$$i" "$(DESTDIR)$(libdir)/vlc" ; \
472           $(INSTALL) -m 644 "$$i" "$(DESTDIR)$(libdir)/vlc" ; \
473         fi ; done
474 if BUILD_MOZILLA
475         for i in "" `$(VLC_CONFIG) --target builtin pic` ; do if test -n "$$i" ; then \
476           echo $(INSTALL) -m 644 "$$i" "$(DESTDIR)$(libdir)/vlc" ; \
477           $(INSTALL) -m 644 "$$i" "$(DESTDIR)$(libdir)/vlc" ; \
478         fi ; done
479 endif
480         for i in "" $(ALIASES) ; do if test -n "$$i" ; then \
481           rm -f "$(DESTDIR)$(bindir)/$$i" && \
482           ln -s vlc "$(DESTDIR)$(bindir)/$$i" ; \
483         fi ; done
484
485 if HAVE_DARWIN
486 # Create the MacOS X app
487 vlc_app_DATA = VLC.app
488 vlc_appdir = $(bindir)
489 # VLC-release.app is the old VLC.app target
490 VLC-release.app: vlc
491         @if test -e "$(top_builddir)/tmp"; then \
492           echo "Error: please remove $(top_builddir)/tmp, it is in the way"; \
493           false; \
494         else \
495           echo "OK."; mkdir -p "$(top_builddir)/tmp/extras"; \
496         fi
497         rm -Rf $(top_builddir)/VLC-release.app
498         cp -r $(srcdir)/extras/MacOSX $(top_builddir)/tmp/extras
499         for i in AUTHORS COPYING README.MacOSX.rtf THANKS; do \
500           cp "$(srcdir)/$$i" $(top_builddir)/tmp; \
501         done
502         mkdir -p $(top_builddir)/tmp/modules/audio_output
503         cp $(srcdir)/modules/audio_output/coreaudio.c \
504            $(top_builddir)/tmp/modules/audio_output/coreaudio.c
505         mkdir -p $(top_builddir)/tmp/modules/gui/macosx
506         for i in \
507             about.h \
508             about.m \
509             applescript.h \
510             applescript.m \
511             controls.h \
512             controls.m \
513             equalizer.h \
514             equalizer.m \
515             intf.h \
516             intf.m \
517             macosx.m \
518             misc.h \
519             misc.m \
520             open.h \
521             open.m \
522             output.h \
523             output.m \
524             playlist.h \
525             playlist.m \
526             playlistinfo.h \
527             playlistinfo.m \
528             prefs_widgets.h \
529             prefs_widgets.m \
530             prefs.h \
531             prefs.m \
532             vout.h \
533             voutqt.m \
534             voutgl.m \
535             vout.m; do \
536           cp "$(srcdir)/modules/gui/macosx/$$i" \
537              $(top_builddir)/tmp/modules/gui/macosx; \
538         done
539         cd $(top_builddir)/tmp/extras/MacOSX && xcodebuild -target vlc | grep -v '^\([ \t]\|$$\)'
540         cp -r $(top_builddir)/tmp/extras/MacOSX/build/VLC.bundle \
541               $(top_builddir)/VLC-release.app
542         rm -Rf $(top_builddir)/tmp
543         $(INSTALL) -d $(top_builddir)/VLC-release.app/Contents/MacOS
544         $(INSTALL) $(top_builddir)/vlc \
545                    $(top_builddir)/VLC-release.app/Contents/MacOS/VLC
546         ln -sf ./VLC $(top_builddir)/VLC-release.app/Contents/MacOS/clivlc
547         $(INSTALL) -d $(top_builddir)/VLC-release.app/Contents/MacOS/modules
548         for i in "" `$(VLC_CONFIG) --target plugin` ; do \
549           if test -n "$$i" ; \
550             then $(INSTALL) "$$i$(LIBEXT)" \
551                            "$(top_builddir)/VLC-release.app/Contents/MacOS/modules" ; \
552           fi ; done
553         if test -d $(top_builddir)/extras/contrib/vlc-lib; then \
554           mkdir -p $(top_builddir)/VLC-release.app/Contents/MacOS/lib ; \
555           for i in $(top_builddir)/extras/contrib/vlc-lib/*.dylib ; do \
556             $(INSTALL) -m 644 $${i} $(top_builddir)/VLC-release.app/Contents/MacOS/lib/vlc_`basename $${i}` ; \
557           done ; \
558         fi
559         $(INSTALL) -d $(top_builddir)/VLC-release.app/Contents/MacOS/share
560         $(INSTALL) -d $(top_builddir)/VLC-release.app/Contents/MacOS/share/http
561         for i in $(srcdir)/share/http/* ; do \
562           $(INSTALL) -m 644 $${i} $(top_builddir)/VLC-release.app/Contents/MacOS/share/http/`basename $${i}` ; \
563         done ; \
564         $(INSTALL) -d $(top_builddir)/VLC-release.app/Contents/MacOS/share/http/vlm
565         for i in $(srcdir)/share/http/vlm/* ; do \
566           $(INSTALL) -m 644 $${i} $(top_builddir)/VLC-release.app/Contents/MacOS/share/http/vlm/`basename $${i}` ; \
567         done ; \
568         $(INSTALL) -d $(top_builddir)/VLC-release.app/Contents/MacOS/share/http/admin
569         for i in $(srcdir)/share/http/admin/* ; do \
570           $(INSTALL) -m 644 $${i} $(top_builddir)/VLC-release.app/Contents/MacOS/share/http/admin/`basename $${i}` ; \
571         done ; \
572         $(INSTALL) -m 644 $(srcdir)/share/http/admin/.access $(top_builddir)/VLC-release.app/Contents/MacOS/share/http/admin/.access
573         $(INSTALL) -d $(top_builddir)/VLC-release.app/Contents/MacOS/locale
574         for i in $(ALL_LINGUAS); do \
575           mkdir -p $(top_builddir)/VLC-release.app/Contents/MacOS/locale/$${i}/LC_MESSAGES ; \
576           cp $(srcdir)/po/$${i}.gmo $(top_builddir)/VLC-release.app/Contents/MacOS/locale/$${i}/LC_MESSAGES/vlc.mo || true ; \
577           mkdir -p $(top_builddir)/VLC-release.app/Contents/Resources/$${i}.lproj ; \
578           ln -sf ../English.lproj/InfoPlist.strings \
579               $(top_builddir)/VLC-release.app/Contents/Resources/$${i}.lproj ; \
580           ln -sf ../English.lproj/MainMenu.nib \
581               $(top_builddir)/VLC-release.app/Contents/Resources/$${i}.lproj ; \
582           ln -sf ../English.lproj/vlc.scriptTerminology \
583               $(top_builddir)/VLC-release.app/Contents/Resources/$${i}.lproj ; \
584         done
585         printf "APPLVLC#" >| $(top_builddir)/VLC-release.app/Contents/PkgInfo
586
587 VLC.app: vlc
588         @if test -e "$(top_builddir)/tmp"; then \
589           echo "Error: please remove $(top_builddir)/tmp, it is in the way"; \
590           false; \
591         else \
592           echo "OK."; mkdir -p "$(top_builddir)/tmp/extras"; \
593         fi
594         rm -Rf $(top_builddir)/VLC.app
595         cp -r $(srcdir)/extras/MacOSX $(top_builddir)/tmp/extras
596         for i in AUTHORS COPYING README.MacOSX.rtf THANKS; do \
597           cp "$(srcdir)/$$i" $(top_builddir)/tmp; \
598         done
599         mkdir -p $(top_builddir)/tmp/modules/audio_output
600         cp $(srcdir)/modules/audio_output/coreaudio.c \
601            $(top_builddir)/tmp/modules/audio_output/coreaudio.c
602         mkdir -p $(top_builddir)/tmp/modules/gui/macosx
603         for i in \
604             about.h \
605             about.m \
606             applescript.h \
607             applescript.m \
608             controls.h \
609             controls.m \
610             equalizer.h \
611             equalizer.m \
612             intf.h \
613             intf.m \
614             macosx.m \
615             misc.h \
616             misc.m \
617             open.h \
618             open.m \
619             output.h \
620             output.m \
621             playlist.h \
622             playlist.m \
623             playlistinfo.h \
624             playlistinfo.m \
625             prefs_widgets.h \
626             prefs_widgets.m \
627             prefs.h \
628             prefs.m \
629             vout.h \
630             voutqt.m \
631             voutgl.m \
632             vout.m; do \
633           cp "$(srcdir)/modules/gui/macosx/$$i" \
634              $(top_builddir)/tmp/modules/gui/macosx; \
635         done
636         cd $(top_builddir)/tmp/extras/MacOSX && xcodebuild -target vlc | grep -v '^\([ \t]\|$$\)'
637         cp -r $(top_builddir)/tmp/extras/MacOSX/build/VLC.bundle \
638               $(top_builddir)/VLC.app
639         rm -Rf $(top_builddir)/tmp
640         $(INSTALL) -d $(top_builddir)/VLC.app/Contents/MacOS
641         $(INSTALL) $(top_builddir)/vlc \
642                    $(top_builddir)/VLC.app/Contents/MacOS/VLC
643         ln -sf ./VLC $(top_builddir)/VLC.app/Contents/MacOS/clivlc
644         $(INSTALL) -d $(top_builddir)/VLC.app/Contents/MacOS/modules
645         for i in "" `$(VLC_CONFIG) --target plugin` ; do \
646           if test -n "$$i" ; \
647             then ln -sfn "`pwd`/$$i$(LIBEXT)" \
648                            "$(top_builddir)/VLC.app/Contents/MacOS/modules" ; \
649           fi ; done
650         if test -d $(top_builddir)/extras/contrib/vlc-lib; then \
651           mkdir -p $(top_builddir)/VLC.app/Contents/MacOS/lib ; \
652           for i in $(top_builddir)/extras/contrib/vlc-lib/*.dylib ; do \
653             ln -sfn `pwd`/$${i} $(top_builddir)/VLC.app/Contents/MacOS/lib/vlc_`basename $${i}` ; \
654           done ; \
655         fi
656         ln -sfn `pwd`/share $(top_builddir)/VLC.app/Contents/MacOS/
657         $(INSTALL) -d $(top_builddir)/VLC.app/Contents/MacOS/locale
658         for i in $(ALL_LINGUAS); do \
659           mkdir -p $(top_builddir)/VLC.app/Contents/MacOS/locale/$${i}/LC_MESSAGES ; \
660           ln -sfn `pwd`/po/$${i}.gmo $(top_builddir)/VLC.app/Contents/MacOS/locale/$${i}/LC_MESSAGES/vlc.mo || true ; \
661           mkdir -p $(top_builddir)/VLC.app/Contents/Resources/$${i}.lproj ; \
662           ln -sf ../English.lproj/InfoPlist.strings \
663               $(top_builddir)/VLC.app/Contents/Resources/$${i}.lproj ; \
664           ln -sf ../English.lproj/MainMenu.nib \
665               $(top_builddir)/VLC.app/Contents/Resources/$${i}.lproj ; \
666         done
667         printf "APPLVLC#" >| $(top_builddir)/VLC.app/Contents/PkgInfo
668 endif
669
670 if HAVE_WIN32
671 DATA_win32_rc = $(noinst_share_vlc_win32_rc_DATA)
672 noinst_share_vlc_win32_rc_DATA = share/vlc_win32_rc.$(OBJEXT)
673 noinst_share_vlc_win32_rcdir = $(libdir)
674 share/vlc_win32_rc.$(OBJEXT): share/vlc_win32_rc.rc
675         $(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 $@
676 endif
677
678 ###############################################################################
679 # Building specific source packages
680 ###############################################################################
681
682 dist-woody: distdir
683         $(remove_distdir_woody)
684         mv $(distdir) $(PACKAGE)-woody-$(VERSION)
685         $(srcdir)/toolbox --make-woody $(PACKAGE)-woody-$(VERSION)
686         $(AMTAR) chof - $(PACKAGE)-woody-$(VERSION) \
687           | GZIP=$(GZIP_ENV) gzip -c >$(PACKAGE)-woody-$(VERSION).tar.gz
688         $(remove_distdir_woody)
689
690 remove_distdir_woody = \
691   { test ! -d $(PACKAGE)-woody-$(VERSION) \
692     || { find $(PACKAGE)-woody-$(VERSION) -type d ! -perm -200 \
693            -exec chmod u+w {} ';' \
694          && rm -fr $(PACKAGE)-woody-$(VERSION); }; }
695
696 ###############################################################################
697 # Building architecture-specific binary packages
698 ###############################################################################
699
700 # XXX: this rule is probably only useful to you if you have exactly
701 # the same setup as me. Contact sam@zoy.org if you need to use it.
702 #
703 package-win32-base:
704 # Check that tmp isn't in the way
705         @if test -e "$(top_builddir)/vlc-${VERSION}"; then \
706           echo "Error: please remove $(top_builddir)/vlc-${VERSION}, it is in the way"; \
707           false; \
708         else \
709           echo "OK."; mkdir -p "$(top_builddir)/vlc-${VERSION}"; \
710         fi
711
712 # Copy relevant files
713         cp "$(srcdir)/vlc.win32.nsi" "$(top_builddir)/vlc-${VERSION}/"
714         cp "$(top_builddir)/vlc$(EXEEXT)" "$(top_builddir)/vlc-${VERSION}/"
715         cp "$(top_srcdir)/vlc.exe.manifest" "$(top_builddir)/vlc-${VERSION}/"
716         $(STRIP) "$(top_builddir)/vlc-${VERSION}/vlc$(EXEEXT)"
717
718         for file in AUTHORS MAINTAINERS THANKS NEWS COPYING README ; \
719           do sed 's/@/_AT_/' < "$(srcdir)/$$file" > "$(top_builddir)/vlc-${VERSION}/$${file}.txt" ; \
720           unix2dos "$(top_builddir)/vlc-${VERSION}/$${file}.txt" ; done
721
722         mkdir -p "$(top_builddir)/vlc-${VERSION}/plugins"
723         for i in "" `$(VLC_CONFIG) --target plugin` ; do \
724           if test -n "$$i" ; then \
725             $(INSTALL) "$(top_builddir)/$$i$(LIBEXT)" \
726             "$(top_builddir)/vlc-${VERSION}/plugins/" ; \
727           fi ; done
728
729         for i in "" $(top_builddir)/vlc-${VERSION}/plugins/*$(LIBEXT) ; \
730           do if test -n "$$i" ; then $(STRIP) "$$i" ; fi ; done
731
732         mkdir $(top_builddir)/vlc-${VERSION}/locale
733         for i in $(ALL_LINGUAS); do \
734           mkdir -p "$(top_builddir)/vlc-${VERSION}/locale/$${i}/LC_MESSAGES" ; \
735           cp "$(srcdir)/po/$${i}.gmo" \
736             "$(top_builddir)/vlc-${VERSION}/locale/$${i}/LC_MESSAGES/vlc.mo" \
737             || true ; \
738         done
739
740         mkdir -p $(top_builddir)/vlc-${VERSION}/skins/fonts
741         for i in $(srcdir)/share/skins2/fonts/*.*; do \
742           cp $$i $(top_builddir)/vlc-${VERSION}/skins/fonts/ || true ; \
743         done
744         for i in $(srcdir)/share/skins2/*.*; do \
745           cp $$i $(top_builddir)/vlc-${VERSION}/skins/ || true ; \
746         done
747
748         mkdir -p "$(top_builddir)/vlc-${VERSION}/http/admin"
749         mkdir -p "$(top_builddir)/vlc-${VERSION}/http/vlm"
750         cp $(srcdir)/share/http/*.html $(top_builddir)/vlc-${VERSION}/http/ ;
751         unix2dos $(top_builddir)/vlc-${VERSION}/http/*.html ;
752         cp $(srcdir)/share/http/*.css $(top_builddir)/vlc-${VERSION}/http/ ;
753         unix2dos $(top_builddir)/vlc-${VERSION}/http/*.css ;
754         cp $(srcdir)/share/http/*.png $(top_builddir)/vlc-${VERSION}/http/
755         cp $(srcdir)/share/http/*.ico $(top_builddir)/vlc-${VERSION}/http/ ;
756         cp $(srcdir)/share/http/admin/*.html \
757            $(top_builddir)/vlc-${VERSION}/http/admin/ ;
758         unix2dos $(top_builddir)/vlc-${VERSION}/http/admin/*.html ;
759         cp $(srcdir)/share/http/admin/.access \
760            $(top_builddir)/vlc-${VERSION}/http/admin/ ;
761         unix2dos $(top_builddir)/vlc-${VERSION}/http/admin/.access ;
762         cp $(srcdir)/share/http/vlm/*.html \
763            $(top_builddir)/vlc-${VERSION}/http/vlm/ ;
764         unix2dos $(top_builddir)/vlc-${VERSION}/http/vlm/*.html ;
765
766         cp $(srcdir)/share/vlc48x48.ico $(top_builddir)/vlc-${VERSION}/ ;
767
768         mkdir -p "$(top_builddir)/vlc-${VERSION}/mozilla"
769 if BUILD_MOZILLA
770         cp $(top_builddir)/mozilla/*$(LIBEXT) $(top_builddir)/vlc-${VERSION}/mozilla/ ;
771         $(STRIP) $(top_builddir)/vlc-${VERSION}/mozilla/*$(LIBEXT);
772         cp $(top_builddir)/mozilla/vlcintf.xpt  $(top_builddir)/vlc-${VERSION}/mozilla/ ;
773 endif
774
775         mkdir -p "$(top_builddir)/vlc-${VERSION}/activex"
776 if BUILD_ACTIVEX
777         cp $(top_builddir)/activex/README.TXT  $(top_builddir)/vlc-${VERSION}/activex/ ;
778         cp $(top_builddir)/activex/test.html  $(top_builddir)/vlc-${VERSION}/activex/ ;
779         unix2dos $(top_builddir)/vlc-${VERSION}/activex/* ;
780
781         cp $(top_builddir)/activex/*$(LIBEXT) $(top_builddir)/vlc-${VERSION}/activex/ ;
782         $(STRIP) $(top_builddir)/vlc-${VERSION}/activex/*$(LIBEXT);
783 endif
784 # Rebase all those DLLs to speed up loading (need cygwin rebase)
785         if [ -x rebase ]; then \
786                 find $(top_builddir)/vlc-${VERSION} -type f -name '*.dll' -print | rebase -b 0x70000000 -T -; \
787         fi
788
789 package-win32-base-exe:
790 # Create package
791         wine ~/.wine/fake_windows/Program\ Files/NSIS/makensis.exe \
792              /DVERSION=${VERSION} $(top_builddir)/vlc-${VERSION}/vlc.win32.nsi
793
794 package-win32-base-exe-cygwin:
795 # Create package
796         C:/Program\ Files/NSIS/makensis.exe \
797              /DVERSION=${VERSION} $(top_builddir)/vlc-${VERSION}/vlc.win32.nsi
798
799 package-win32-base-exe-linux:
800 # Create package
801         makensis -DVERSION=${VERSION} $(top_builddir)/vlc-${VERSION}/vlc.win32.nsi
802
803 package-win32-base-zip:
804 # Create package 
805         zip -r vlc-${VERSION}-win32.zip vlc-${VERSION}
806
807 package-win32-exe: package-win32-base package-win32-base-exe
808 # Clean up
809         rm -Rf $(top_builddir)/vlc-${VERSION}
810
811 package-win32-exe-linux: package-win32-base package-win32-base-exe-linux
812 # Clean up
813         rm -Rf $(top_builddir)/vlc-${VERSION}
814
815 package-win32-zip: package-win32-base package-win32-base-zip
816 # Clean up
817         rm -Rf $(top_builddir)/vlc-${VERSION}
818
819 package-win32: package-win32-base package-win32-base-exe package-win32-base-zip
820 # Clean up
821         rm -Rf $(top_builddir)/vlc-${VERSION}
822
823 package-beos:
824 # Check that tmp isn't in the way
825         @if test -e $(srcdir)/tmp; then \
826           echo "Error: please remove $(srcdir)/tmp, it is in the way"; \
827           false ; \
828         else \
829           echo "OK." ; mkdir $(srcdir)/tmp ; \
830         fi
831
832 # Copy relevant files
833         mkdir -p $(srcdir)/tmp/vlc ;
834         cd $(srcdir) && cp -R vlc-bundle/* AUTHORS COPYING ChangeLog README \
835           THANKS NEWS tmp/vlc/ ;
836
837 # Create debug package
838         xres -o $(srcdir)/tmp/vlc/vlc $(srcdir)/share/vlc_beos.rsrc ;
839         find $(srcdir)/tmp/vlc -exec mimeset -f {} \; ;
840         mv $(srcdir)/tmp/vlc $(srcdir)/tmp/vlc-${VERSION} ;
841         (cd $(srcdir)/tmp ; zip -9 -r vlc-${VERSION}-BeOS-debug.zip vlc-${VERSION} )
842         mv $(srcdir)/tmp/vlc-${VERSION}-BeOS-debug.zip $(srcdir)/ ;
843         mv $(srcdir)/tmp/vlc-${VERSION} $(srcdir)/tmp/vlc ;
844
845 # Create normal package
846         $(STRIP) --strip-debug --strip-unneeded $(srcdir)/tmp/vlc/vlc ;
847         find $(srcdir)/tmp/vlc -name 'lib*.so' -exec $(STRIP) \
848           --strip-debug --strip-unneeded "{}" \; ;
849         xres -o $(srcdir)/tmp/vlc/vlc $(srcdir)/share/vlc_beos.rsrc ;
850         find $(srcdir)/tmp/vlc -exec mimeset -f {} \; ;
851         mv $(srcdir)/tmp/vlc $(srcdir)/tmp/vlc-${VERSION} ;
852         (cd $(srcdir)/tmp ; zip -9 -r vlc-${VERSION}-BeOS.zip vlc-${VERSION} )
853         mv $(srcdir)/tmp/vlc-${VERSION}-BeOS.zip $(srcdir)/ ;
854
855 # Clean up
856         rm -Rf $(srcdir)/tmp ;
857
858 package-macosx:
859 # Check that tmp isn't in the way
860         @if test -e "$(top_builddir)/tmp"; then \
861           echo "Error: please remove $(top_builddir)/tmp, it is in the way"; \
862           false; \
863         else \
864           echo "OK."; mkdir -p "$(top_builddir)/tmp"; \
865         fi
866
867 # Copy relevant files 
868         cp -R "$(top_builddir)/VLC-release.app" "$(top_builddir)/tmp/VLC.app"
869         cd "$(srcdir)" && cp AUTHORS COPYING ChangeLog README README.MacOSX.rtf THANKS NEWS $(top_builddir)/tmp/
870
871 # Create disk image 
872         $(srcdir)/extras/MacOSX/macosx-dmg "vlc-${VERSION}" $(top_builddir)/tmp
873
874 # Clean up
875         rm -Rf $(top_builddir)/tmp
876
877 package-translations:
878         @if test -e "$(srcdir)/vlc-translations-${VERSION}"; then \
879           echo "Error: please remove $(srcdir)/vlc-translations-${VERSION}, it is in the way"; \
880           false; \
881         else \
882           echo "OK."; mkdir -p "$(srcdir)/vlc-translations-${VERSION}"; \
883         fi
884 # Copy translations
885         for i in $(ALL_LINGUAS); do \
886           cp "$(srcdir)/po/$${i}.po" \
887             "$(srcdir)/vlc-translations-${VERSION}/$${i}.po" \
888             || true ; \
889         done
890         cp "$(srcdir)/doc/translations.txt" \
891           "$(srcdir)/vlc-translations-${VERSION}/README.txt"
892
893         echo "#!/bin/sh" >>"$(srcdir)/vlc-translations-$(VERSION)/convert.po.sh"
894         echo "" >>"$(srcdir)/vlc-translations-$(VERSION)/convert.po.sh"
895         echo 'if test $$# != 1; then' >>"$(srcdir)/vlc-translations-$(VERSION)/convert.po.sh"
896         echo "  echo \"Usage: convert-po.sh <.po file>\"" >>"$(srcdir)/vlc-translations-$(VERSION)/convert.po.sh"
897         echo "  exit 1" >>"$(srcdir)/vlc-translations-$(VERSION)/convert.po.sh"
898         echo "fi" >>"$(srcdir)/vlc-translations-$(VERSION)/convert.po.sh"
899         echo "" >>"$(srcdir)/vlc-translations-$(VERSION)/convert.po.sh"
900         echo 'msgfmt --statistics -o vlc.mo $$1' >>"$(srcdir)/vlc-translations-$(VERSION)/convert.po.sh"
901
902         $(AMTAR) chof - $(srcdir)/vlc-translations-$(VERSION) \
903           | GZIP=$(GZIP_ENV) gzip -c >$(srcdir)/vlc-translations-$(VERSION).tar.gz
904
905 ###############################################################################
906 # Stamp rules
907 ###############################################################################
908 clean: clean-stamp clean-recursive
909 clean-stamp:
910         rm -f stamp-builtin stamp-api
911
912 stamp-builtin: FORCE
913         @for dep in "" `$(VLC_CONFIG) --target builtin`; do \
914           if test "$${dep}" -nt "$(top_builddir)/vlc$(EXEEXT)"; then \
915             rm -f $@; \
916             break; \
917           fi; \
918         done
919         @if test ! -f $@; then printf "" > $@; fi
920
921 stamp-api: Makefile.in $(HEADERS_include) vlc-config vlc-api.pl src/misc/modules_builtin.h.in
922         cd $(srcdir) && cat $(HEADERS_include) | perl ./vlc-api.pl
923         touch stamp-api
924
925 ###############################################################################
926 # Force rule
927 ###############################################################################
928 FORCE: