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