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