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