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