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