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