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