]> git.sesse.net Git - vlc/blob - Makefile.am
* Makefile.am:
[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 SUBDIRS = intl modules . share po m4
11 DIST_SUBDIRS = $(SUBDIRS) src debian doc ipkg lib autotools
12
13 EXTRA_DIST = \
14         HACKING \
15         INSTALL.win32 \
16         MAINTAINERS \
17         Modules.am \
18         README.MacOSX.rtf \
19         bootstrap \
20         install-win32 \
21         src/extras/COPYING \
22         toolbox \
23         vlc-config.in.in \
24         vlc.ebuild \
25         vlc.spec \
26         vlc.spec.redhat \
27         $(NULL)
28
29 BUILT_SOURCES =
30 SUFFIXES = 
31
32 # Tell aclocal to use -I m4. Wonder if it really works.
33 ACLOCAL_AMFLAGS = -I m4
34
35 # XXX: these flags could be set in configure.ac, but we set them here
36 # because old versions of automake don't support them in configure.ac.
37 AUTOMAKE_OPTIONS = dist-bzip2 subdir-objects
38
39 ###############################################################################
40 # Headers
41 ###############################################################################
42
43 BUILT_SOURCES += \
44         include/vlc_symbols.h \
45         src/misc/modules_builtin.h \
46         src/misc/modules_plugin.h \
47         $(NULL)
48
49 pkgincludedir = $(includedir)/vlc
50
51 dist_pkginclude_HEADERS = \
52         include/vlc/vlc.h \
53         include/vlc/aout.h \
54         include/vlc/vout.h \
55         include/vlc/sout.h \
56         include/vlc/decoder.h \
57         include/vlc/input.h \
58         include/vlc/intf.h \
59         $(NULL)
60
61 noinst_HEADERS = $(HEADERS_include) $(HEADERS_include_built)
62
63 HEADERS_include = \
64         include/aout_internal.h \
65         include/audio_output.h \
66         include/beos_specific.h \
67         include/configuration.h \
68         include/darwin_specific.h \
69         include/codecs.h \
70         include/error.h \
71         include/encoder.h \
72         include/input_ext-dec.h \
73         include/input_ext-intf.h \
74         include/input_ext-plugins.h \
75         include/intf_eject.h \
76         include/iso_lang.h \
77         include/httpd.h \
78         include/main.h \
79         include/mmx.h \
80         include/modules.h \
81         include/modules_inner.h \
82         include/mtime.h \
83         include/network.h \
84         include/os_specific.h \
85         include/stream_control.h \
86         include/stream_output.h \
87         include/announce.h \
88         include/variables.h \
89         include/video_output.h \
90         include/vlc_common.h \
91         include/vlc_config.h \
92         include/vlc_cpu.h \
93         include/vlc_interface.h \
94         include/vlc_messages.h \
95         include/vlc_objects.h \
96         include/vlc_playlist.h \
97         include/vlc_threads.h \
98         include/vlc_threads_funcs.h \
99         include/vlc_video.h \
100         include/vout_synchro.h \
101         include/win32_specific.h \
102         include/osd.h \
103         $(NULL)
104
105 HEADERS_include_built = \
106         include/vlc_symbols.h \
107         $(NULL)
108
109 include/vlc_symbols.h: Makefile $(HEADERS_include)
110         $(srcdir)/toolbox --update-includes
111
112 src/misc/modules_plugin.h: Makefile src/misc/modules_plugin.h.in $(HEADERS_include)
113         $(srcdir)/toolbox --update-includes
114
115 src/misc/modules_builtin.h: Makefile src/misc/modules_builtin.h.in
116         $(srcdir)/toolbox --update-includes
117
118 # These dependencies are mandatory
119 $(SOURCES): include/vlc_symbols.h
120 $(SOURCES_libvlc): src/misc/modules_plugin.h src/misc/modules_builtin.h $(LIB_intl)
121
122 ###############################################################################
123 # Optional libintl - FIXME, bad dependencies
124 ###############################################################################
125
126 intl/libintl.a: FORCE
127         cd $(top_builddir)/intl && $(MAKE) $(AM_MAKEFLAGS)
128
129 if BUILD_INTL
130 LIB_intl = intl/libintl.a
131 endif
132
133 ###############################################################################
134 # MacOS X project
135 ###############################################################################
136
137 EXTRA_DIST += \
138         extras/MacOSX/Resources/English.lproj/MainMenu.nib/classes.nib \
139         extras/MacOSX/Resources/English.lproj/MainMenu.nib/info.nib \
140         extras/MacOSX/Resources/English.lproj/MainMenu.nib/objects.nib \
141         extras/MacOSX/Resources/English.lproj/InfoPlist.strings \
142         extras/MacOSX/Resources/English.lproj/vlc.scriptTerminology \
143         extras/MacOSX/Resources/a52.icns \
144         extras/MacOSX/Resources/aac.icns \
145         extras/MacOSX/Resources/asf.icns \
146         extras/MacOSX/Resources/asx.icns \
147         extras/MacOSX/Resources/avi.icns \
148         extras/MacOSX/Resources/bin.icns \
149         extras/MacOSX/Resources/cue.icns \
150         extras/MacOSX/Resources/dat.icns \
151         extras/MacOSX/Resources/divx.icns \
152         extras/MacOSX/Resources/dv.icns \
153         extras/MacOSX/Resources/generic.icns \
154         extras/MacOSX/Resources/m3u.icns \
155         extras/MacOSX/Resources/mov.icns \
156         extras/MacOSX/Resources/mp3.icns \
157         extras/MacOSX/Resources/mp4.icns \
158         extras/MacOSX/Resources/mpeg.icns \
159         extras/MacOSX/Resources/mpeg1.icns \
160         extras/MacOSX/Resources/mpeg2.icns \
161         extras/MacOSX/Resources/mpeg4.icns \
162         extras/MacOSX/Resources/mpg.icns \
163         extras/MacOSX/Resources/ogg.icns \
164         extras/MacOSX/Resources/ogm.icns \
165         extras/MacOSX/Resources/pls.icns \
166         extras/MacOSX/Resources/srt.icns \
167         extras/MacOSX/Resources/sub.icns \
168         extras/MacOSX/Resources/vlc.icns \
169         extras/MacOSX/Resources/vob.icns \
170         extras/MacOSX/Resources/wma.icns \
171         extras/MacOSX/Resources/wmv.icns \
172         extras/MacOSX/Resources/back.png \
173         extras/MacOSX/Resources/begin.png \
174         extras/MacOSX/Resources/end.png \
175         extras/MacOSX/Resources/forw.png \
176         extras/MacOSX/Resources/list.png \
177         extras/MacOSX/Resources/pause.png \
178         extras/MacOSX/Resources/play.png \
179         extras/MacOSX/Resources/prefs.png \
180         extras/MacOSX/Resources/slow.png \
181         extras/MacOSX/Resources/stop.png \
182         extras/MacOSX/Resources/vlc_hg.png \
183         extras/MacOSX/Resources/about_bg.png \
184         extras/MacOSX/Resources/vlc.scriptSuite \
185         extras/MacOSX/Resources/README \
186         extras/MacOSX/vlc.pbproj/project.pbxproj \
187         extras/MacOSX/macosx-dmg \
188         $(NULL)
189
190 ###############################################################################
191 # MS Visual Studio and eMbedded Visual Studio projects
192 ###############################################################################
193
194 EXTRA_DIST += \
195         msvc/vlc.dsw \
196         msvc/libvlc.dsp.in \
197         msvc/plugins.dsp.in \
198         msvc/vlc.dsp.in \
199         msvc/config.h.in \
200         msvc/modules_builtin_msvc.h \
201         evc/vlc.vcw \
202         evc/libvlc.vcp.in \
203         evc/vlc.vcp.in \
204         evc/plugins.vcp.in \
205         evc/vlc.c \
206         evc/config.h.in \
207         evc/modules_builtin_evc.h \
208         $(NULL)
209
210 dist-hook:
211         mv $(distdir)/vlc.ebuild $(distdir)/vlc-${VERSION}.ebuild
212         cd $(distdir) && $(srcdir)/toolbox --update-vc
213
214 ###############################################################################
215 # Building libvlc
216 ###############################################################################
217
218 bin_SCRIPTS = vlc-config
219
220 lib_LIBRARIES = lib/libvlc.a $(LIBRARIES_libvlc_pic)
221
222 lib_libvlc_a_SOURCES = $(SOURCES_libvlc)
223 dist_lib_libvlc_a_SOURCES = src/misc/modules_plugin.h
224 lib_libvlc_a_CFLAGS = `$(VLC_CONFIG) --cflags vlc`
225 lib_libvlc_a_CXXFLAGS = `$(VLC_CONFIG) --cxxflags vlc`
226 lib_libvlc_a_OBJCFLAGS = `$(VLC_CONFIG) --objcflags vlc`
227
228 lib_libvlc_pic_a_SOURCES = $(SOURCES_libvlc)
229 lib_libvlc_pic_a_CFLAGS = `$(VLC_CONFIG) --cflags vlc pic`
230 lib_libvlc_pic_a_CXXFLAGS = `$(VLC_CONFIG) --cxxflags vlc pic`
231 lib_libvlc_pic_a_OBJCFLAGS = `$(VLC_CONFIG) --objcflags vlc pic`
232
233 if HAVE_BEOS
234 OPT_SOURCES_libvlc_beos = $(SOURCES_libvlc_beos)
235 endif
236 if HAVE_DARWIN
237 OPT_SOURCES_libvlc_darwin = $(SOURCES_libvlc_darwin)
238 endif
239 if HAVE_WIN32
240 OPT_SOURCES_libvlc_win32 = $(SOURCES_libvlc_win32)
241 endif
242 if BUILD_DIRENT
243 OPT_SOURCES_libvlc_dirent = $(SOURCES_libvlc_dirent)
244 endif
245 if BUILD_GETOPT
246 OPT_SOURCES_libvlc_getopt = $(SOURCES_libvlc_getopt)
247 endif
248 if BUILD_MOZILLA
249 LIBRARIES_libvlc_pic = lib/libvlc_pic.a
250 endif
251
252 EXTRA_DIST += \
253         $(SOURCES_libvlc_beos) \
254         $(SOURCES_libvlc_darwin) \
255         $(SOURCES_libvlc_win32) \
256         $(SOURCES_libvlc_dirent) \
257         $(SOURCES_libvlc_getopt) \
258         $(NULL)
259
260 SOURCES_libvlc_beos = \
261         src/misc/beos_specific.cpp \
262         $(NULL)
263
264 SOURCES_libvlc_darwin = \
265         src/misc/darwin_specific.m \
266         $(NULL)
267
268 SOURCES_libvlc_win32 = \
269         src/misc/win32_specific.c \
270         $(NULL)
271
272 SOURCES_libvlc_dirent = \
273         src/extras/dirent.c \
274         src/extras/dirent.h \
275         $(NULL)
276
277 SOURCES_libvlc_getopt = \
278         src/extras/getopt.c \
279         src/extras/getopt.h \
280         src/extras/getopt1.c \
281         $(NULL)
282
283 SOURCES_libvlc_common = \
284         src/libvlc.c \
285         src/libvlc.h \
286         src/interface/interface.c \
287         src/interface/intf_eject.c \
288         src/playlist/playlist.c \
289         src/input/input.c \
290         src/input/input_ext-plugins.c \
291         src/input/input_ext-dec.c \
292         src/input/input_ext-intf.c \
293         src/input/input_dec.c \
294         src/input/input_programs.c \
295         src/input/input_clock.c \
296         src/input/input_info.c \
297         src/video_output/video_output.c \
298         src/video_output/vout_pictures.c \
299         src/video_output/vout_pictures.h \
300         src/video_output/video_text.c \
301         src/video_output/video_text.h \
302         src/video_output/vout_subpictures.c \
303         src/video_output/vout_synchro.c \
304         src/audio_output/common.c \
305         src/audio_output/dec.c \
306         src/audio_output/filters.c \
307         src/audio_output/input.c \
308         src/audio_output/mixer.c \
309         src/audio_output/output.c \
310         src/audio_output/intf.c \
311         src/stream_output/stream_output.c \
312         src/stream_output/announce.c \
313         src/misc/mtime.c \
314         src/misc/modules.c \
315         src/misc/threads.c \
316         src/misc/cpu.c \
317         src/misc/configuration.c \
318         src/misc/iso_lang.c \
319         src/misc/iso-639_def.h \
320         src/misc/messages.c \
321         src/misc/objects.c \
322         src/misc/variables.c \
323         src/misc/error.c \
324         src/extras/libc.c \
325         $(NULL)
326
327 SOURCES_libvlc = \
328         $(SOURCES_libvlc_common) \
329         $(OPT_SOURCES_libvlc_beos) \
330         $(OPT_SOURCES_libvlc_darwin) \
331         $(OPT_SOURCES_libvlc_win32) \
332         $(OPT_SOURCES_libvlc_dirent) \
333         $(OPT_SOURCES_libvlc_getopt) \
334         $(NULL)
335
336 ###############################################################################
337 # Building vlc
338 ###############################################################################
339
340 bin_PROGRAMS = vlc
341
342 vlc_SOURCES = src/vlc.c
343
344 vlc_LDFLAGS = `$(VLC_CONFIG) --libs vlc builtin`
345 vlc_LDADD = lib/libvlc.a $(DATA_win32_rc) $(LIB_intl)
346 vlc_CFLAGS = `$(VLC_CONFIG) --cflags vlc`
347
348 # We use DEPENDENCIES_vlc instead of vlc_DEPENDENCIES because of an
349 # old automake-1.5 bug (automake/279).
350 DEPENDENCIES_vlc = lib/libvlc.a $(DATA_win32_rc) $(LIB_intl)
351
352 vlc$(EXEEXT): $(vlc_OBJECTS) $(DEPENDENCIES_vlc)
353         @rm -f $(srcdir)/vlc$(EXEEXT)
354         case `$(VLC_CONFIG) --linkage vlc builtin` in \
355           c++) $(CXXLINK) $(vlc_OBJECTS) $(vlc_LDADD) $(vlc_LDFLAGS) $(LIBS) ;; \
356           objc) $(OBJCLINK) $(vlc_OBJECTS) $(vlc_LDADD) $(vlc_LDFLAGS) $(LIBS) ;; \
357           c|*) $(LINK) $(vlc_OBJECTS) $(vlc_LDADD) $(vlc_LDFLAGS) $(LIBS) ;; \
358         esac
359
360 if HAVE_BEOS
361         xres -o $@ $(srcdir)/share/vlc_beos.rsrc
362         mimeset -f $@
363         rm -Rf $(srcdir)/locale ; mkdir -p "$(srcdir)/locale"
364         for i in $(ALL_LINGUAS); do \
365           mkdir -p "$(srcdir)/locale/$${i}/LC_MESSAGES" ; \
366           cp "$(srcdir)/po/$${i}.gmo" \
367             "$(srcdir)/locale/$${i}/LC_MESSAGES/vlc.mo" || true ; \
368         done
369 endif
370
371 # Install the modules and the symlinks
372 install-exec-local:
373         for i in "" `$(VLC_CONFIG) --target plugin` ; do if test -n "$$i" ; then \
374           $(INSTALL) -m 755 "$$i$(LIBEXT)" "$(DESTDIR)$(libdir)/vlc/`echo $$i | cut -f2 -d/`" ; \
375         fi ; done
376         for i in "" `$(VLC_CONFIG) --target builtin` `$(VLC_CONFIG) --target builtin pic` ; do if test -n "$$i" ; then \
377           $(INSTALL) -m 644 "$$i" "$(DESTDIR)$(libdir)/vlc" ; \
378         fi ; done
379         for i in "" $(ALIASES) ; do if test -n "$$i" ; then \
380           rm -f "$(DESTDIR)$(bindir)/$$i" && \
381           ln -s vlc "$(DESTDIR)$(bindir)/$$i" ; \
382         fi ; done
383
384 if HAVE_DARWIN
385 # Create the MacOS X app
386 vlc_app_DATA = VLC.app
387 vlc_appdir = $(bindir)
388 VLC.app: vlc
389         rm -Rf VLC.app
390         cd $(srcdir)/extras/MacOSX && pbxbuild -target vlc | grep -v '^\([ \t]\|$$\)'
391         cp -r $(srcdir)/extras/MacOSX/build/vlc.bundle $(srcdir)/VLC.app
392         $(INSTALL) -d $(srcdir)/VLC.app/Contents/MacOS
393         $(INSTALL) vlc $(srcdir)/VLC.app/Contents/MacOS/VLC
394         $(INSTALL) -d $(srcdir)/VLC.app/Contents/MacOS/modules
395         for i in "" `$(VLC_CONFIG) --target plugin` ; do \
396           if test -n "$$i" ; then $(INSTALL) "$(srcdir)/$$i$(LIBEXT)" \
397             "$(srcdir)/VLC.app/Contents/MacOS/modules" ; \
398           fi ; done
399         $(INSTALL) -d $(srcdir)/VLC.app/Contents/MacOS/share
400         $(INSTALL) -m 644 $(srcdir)/share/*.psf $(srcdir)/share/*.rle \
401           $(srcdir)/VLC.app/Contents/MacOS/share
402         $(INSTALL) -d $(srcdir)/VLC.app/Contents/MacOS/locale
403         for i in $(ALL_LINGUAS); do \
404           mkdir -p $(srcdir)/VLC.app/Contents/MacOS/locale/$${i}/LC_MESSAGES ; \
405           cp $(srcdir)/po/$${i}.gmo $(srcdir)/VLC.app/Contents/MacOS/locale/$${i}/LC_MESSAGES/vlc.mo || true ; \
406           mkdir -p $(srcdir)/VLC.app/Contents/Resources/$${i}.lproj ; \
407           ln -sf ../English.lproj/InfoPlist.strings $(srcdir)/VLC.app/Contents/Resources/$${i}.lproj ; \
408           ln -sf ../English.lproj/MainMenu.nib $(srcdir)/VLC.app/Contents/Resources/$${i}.lproj ; \
409           ln -sf ../English.lproj/vlc.scriptTerminology $(srcdir)/VLC.app/Contents/Resources/$${i}.lproj ; \
410         done
411         printf "APPLVLC#" >| $(srcdir)/VLC.app/Contents/PkgInfo
412 endif
413
414 if HAVE_WIN32
415 DATA_win32_rc = $(noinst_share_vlc_win32_rc_DATA)
416 noinst_share_vlc_win32_rc_DATA = share/vlc_win32_rc.$(OBJEXT)
417 noinst_share_vlc_win32_rcdir = $(libdir)
418 share/vlc_win32_rc.$(OBJEXT): share/vlc_win32_rc.rc
419         $(WINDRES) --include-dir $(srcdir)/share -i $< -o $@
420 endif
421
422 ###############################################################################
423 # Building architecture-specific binary packages
424 ###############################################################################
425
426 # XXX: this rule is probably only useful to you if you have exactly
427 # the same setup as me. Contact sam@zoy.org if you need to use it.
428 #
429 # Check that tmp isn't in the way
430 package-win32:
431         @if test -e "$(srcdir)/tmp"; then \
432           echo "Error: please remove $(srcdir)/tmp, it is in the way"; \
433           false; \
434         else \
435           echo "OK."; mkdir -p "$(srcdir)/tmp"; \
436         fi
437 # Create installation script
438         cp "$(srcdir)/install-win32" "$(srcdir)/tmp/nsi"
439 # Copy relevant files
440         cp "$(srcdir)/vlc$(EXEEXT)" "$(srcdir)/tmp/"
441         $(STRIP) "$(srcdir)/tmp/vlc$(EXEEXT)"
442         cp "$(srcdir)/INSTALL.win32" "$(srcdir)/tmp/INSTALL.txt"
443         unix2dos "$(srcdir)/tmp/INSTALL.txt"
444         for file in AUTHORS MAINTAINERS THANKS NEWS COPYING README ; \
445           do cp "$(srcdir)/$$file" "$(srcdir)/tmp/$${file}.txt" ; \
446           unix2dos "$(srcdir)/tmp/$${file}.txt" ; done
447
448         mkdir -p "$(srcdir)/tmp/plugins"
449         for i in "" `$(VLC_CONFIG) --target plugin` ; do \
450           if test -n "$$i" ; then \
451             $(INSTALL) "$(srcdir)/$$i$(LIBEXT)" "$(srcdir)/tmp/plugins/" ; \
452           fi ; done
453
454         for i in "" $(srcdir)/tmp/plugins/*$(LIBEXT) ; \
455           do if test -n "$$i" ; then $(STRIP) "$$i" ; fi ; done
456
457         mkdir -p "$(srcdir)/tmp/share"
458         cp $(srcdir)/share/*.rle $(srcdir)/tmp/share/ ;
459
460         mkdir $(srcdir)/tmp/locale
461         for i in $(ALL_LINGUAS); do \
462           mkdir -p "$(srcdir)/tmp/locale/$${i}/LC_MESSAGES" ; \
463           cp "$(srcdir)/po/$${i}.gmo" \
464             "$(srcdir)/tmp/locale/$${i}/LC_MESSAGES/vlc.mo" || true ; \
465         done
466
467         mkdir -p $(srcdir)/tmp/skins/default
468         for i in $(srcdir)/share/skins/default/*.*; do \
469           cp $$i $(srcdir)/tmp/skins/default/ || true ; \
470         done
471         for i in $(srcdir)/doc/skins/*.txt; do \
472           cp $$i $(srcdir)/tmp/skins/ || true ; \
473         done
474
475 # Create package 
476         wine ~/.wine/fake_windows/Program\ Files/NSIS/makensis.exe -- /DVERSION=${VERSION} $(srcdir)/tmp/nsi
477 # Clean up
478         rm -Rf $(srcdir)/tmp
479
480 package-beos:
481 # Check that tmp isn't in the way
482         @if test -e $(srcdir)/tmp; then \
483           echo "Error: please remove $(srcdir)/tmp, it is in the way"; \
484           false; \
485         else \
486           echo "OK."; mkdir $(srcdir)/tmp; \
487         fi
488
489 # Copy relevant files
490         mkdir -p $(srcdir)/tmp/vlc
491         cd $(srcdir) && \
492           cp vlc AUTHORS COPYING ChangeLog README THANKS NEWS tmp/vlc/
493 # We cannot use ${PLUGIN_FILES}, it looks like it is too long for the BeOS shell...
494         if [ `find $(srcdir)/modules -name "lib*_plugin.so" | wc -l` -gt 0 ]; then \
495           mkdir -p $(srcdir)/tmp/vlc/plugins; \
496           find $(srcdir)/modules -name "lib*_plugin.so" | xargs -i{} cp {} $(srcdir)/tmp/vlc/plugins/; \
497         fi
498         for i in $(ALL_LINGUAS); do \
499           mkdir -p $(srcdir)/tmp/vlc/locale/$${i}/LC_MESSAGES ; \
500           cp $(srcdir)/po/$${i}.gmo $(srcdir)/tmp/vlc/locale/$${i}/LC_MESSAGES/vlc.mo || true ; \
501         done
502         mkdir -p $(srcdir)/tmp/vlc/share
503         cp $(srcdir)/share/*.rle $(srcdir)/tmp/vlc/share/
504
505 # Create package with debug symbols
506         mimeset -f $(srcdir)/tmp/vlc/* $(srcdir)/tmp/vlc/*/*
507         mv $(srcdir)/tmp/vlc $(srcdir)/tmp/vlc-${VERSION}
508         (cd $(srcdir)/tmp ; zip -9 -r vlc-${VERSION}-BeOS-debug.zip vlc-${VERSION} )
509         mv $(srcdir)/tmp/vlc-${VERSION}-BeOS-debug.zip $(srcdir)/
510
511 # Create package without debug symbols
512         strip $(srcdir)/tmp/vlc-${VERSION}/vlc
513         if [ -d $(srcdir)/tmp/vlc-${VERSION}/plugins ]; then \
514           strip $(srcdir)/tmp/vlc-${VERSION}/plugins/lib*_plugin.so; \
515         fi
516         xres -o $(srcdir)/tmp/vlc-${VERSION}/vlc $(srcdir)/share/vlc_beos.rsrc
517         mimeset -f $(srcdir)/tmp/vlc-${VERSION}/* $(srcdir)/tmp/vlc-${VERSION}/*/*
518         (cd $(srcdir)/tmp ; zip -9 -r vlc-${VERSION}-BeOS.zip vlc-${VERSION} )
519         mv $(srcdir)/tmp/vlc-${VERSION}-BeOS.zip $(srcdir)/
520
521 # Clean up
522         rm -Rf $(srcdir)/tmp
523
524 package-macosx:
525 # Check that tmp isn't in the way
526         @if test -e "$(srcdir)/tmp"; then \
527           echo "Error: please remove $(srcdir)/tmp, it is in the way"; \
528           false; \
529         else \
530           echo "OK."; mkdir -p "$(srcdir)/tmp"; \
531         fi
532
533 # Copy relevant files 
534         cp -R "$(srcdir)/VLC.app" "$(srcdir)/tmp/"
535         cd "$(srcdir)" && cp AUTHORS COPYING ChangeLog README README.MacOSX.rtf THANKS NEWS tmp/
536
537 # Create disk image 
538         $(srcdir)/extras/MacOSX/macosx-dmg 18 "vlc-${VERSION}" $(srcdir)/tmp/* 
539
540 # Clean up
541         rm -Rf $(srcdir)/tmp
542
543 ###############################################################################
544 # Building the Mozilla plugin
545 ###############################################################################
546
547 noinst_LIBRARIES = $(noinst_LIBRARIES_mozilla)
548
549 MOSTLYCLEANFILES = $(LIBRARIES_mozilla)
550
551 EXTRA_DIST += $(SOURCES_mozilla) mozilla/vlcintf.idl
552
553 BUILT_SOURCES += $(BUILT_SOURCES_mozilla)
554
555 SOURCES_mozilla = \
556         mozilla/vlcshell.cpp \
557         mozilla/vlcplugin.cpp \
558         mozilla/vlcplugin.h \
559         mozilla/vlcpeer.cpp \
560         mozilla/vlcpeer.h \
561         mozilla/support/classinfo.h \
562         $(SOURCES_mozilla_win32) \
563         $(SOURCES_mozilla_macosx) \
564         $(SOURCES_mozilla_unix) \
565         $(NULL)
566
567 # Under Win32, Mozilla plugins need to be named NP******.DLL, but under Unix
568 # the common naming scheme is lib******plugin.so. Also, we need npwin.cpp
569 # under Win32 and npunix.c under Unix.
570 if HAVE_WIN32
571 LIBRARIES_mozilla = mozilla/npvlc$(LIBEXT)
572 SOURCES_mozilla_win32 = mozilla/support/npwin.cpp
573 CPPFLAGS_mozilla_EXTRA = -DXP_WIN -DXP_WIN32
574 else
575 if HAVE_DARWIN
576 # We don't define LIBRARIES_mozilla because we'll be using project builder
577 SOURCES_mozilla_macosx = mozilla/support/npmac.cpp
578 else
579 LIBRARIES_mozilla = mozilla/libvlcplugin$(LIBEXT)
580 SOURCES_mozilla_unix = mozilla/support/npunix.c
581 endif
582 endif
583
584 if BUILD_MOZILLA
585 if UNTRUE
586 noinst_LIBRARIES_mozilla = mozilla/libplugin.a
587 endif
588
589 mozilla_libplugin_a_SOURCES = $(SOURCES_mozilla)
590 mozilla_libplugin_a_CFLAGS = `$(VLC_CONFIG) --cflags mozilla pic` \
591                              $(CPPFLAGS_mozilla_EXTRA) -Imozilla
592 mozilla_libplugin_a_CXXFLAGS = `$(VLC_CONFIG) --cxxflags mozilla pic` \
593                                $(CPPFLAGS_mozilla_EXTRA) -Imozilla
594 mozilla_libplugin_a_DEPENDENCIES = lib/libvlc_pic.a $(DATA_npvlc_rc) builtins_pic
595
596 BUILT_SOURCES_mozilla = mozilla/vlcintf.h
597 $(SOURCES_mozilla): mozilla/vlcintf.h
598
599 mozilla_plugin_DATA = $(LIBRARIES_mozilla)
600 mozilla_plugindir = $(libdir)/mozilla/plugins
601 $(LIBRARIES_mozilla): $(mozilla_libplugin_a_OBJECTS) \
602                       $(mozilla_libplugin_a_DEPENDENCIES)
603         $(CXXLINK) $(mozilla_libplugin_a_OBJECTS) $(DATA_npvlc_rc) \
604           lib/libvlc_pic.a -shared \
605           `$(VLC_CONFIG) --libs vlc mozilla builtin pic`
606
607 mozilla_vlcintf_xpt_DATA = mozilla/vlcintf.xpt
608 mozilla_vlcintf_xptdir = $(libdir)/mozilla/components
609 mozilla/vlcintf.xpt: Makefile mozilla/vlcintf.idl
610         $(XPIDL) -I/usr/share/idl/mozilla -m typelib \
611           -o mozilla/vlcintf $(srcdir)/mozilla/vlcintf.idl
612
613 mozilla/vlcintf.h: Makefile mozilla/vlcintf.idl
614         $(XPIDL) -I/usr/share/idl/mozilla -m header \
615           -o mozilla/vlcintf $(srcdir)/mozilla/vlcintf.idl
616
617 if HAVE_WIN32
618 DATA_npvlc_rc = $(noinst_mozilla_npvlc_rc_DATA)
619 noinst_mozilla_npvlc_rc_DATA = mozilla/npvlc_rc.$(OBJEXT)
620 noinst_mozilla_npvlc_rcdir = $(libdir)
621 mozilla/npvlc_rc.$(OBJEXT): mozilla/npvlc_rc.rc
622         $(WINDRES) --include-dir $(srcdir)/mozilla -i $< -o $@
623 endif
624 endif
625
626 ###############################################################################
627 # Modules
628 ###############################################################################
629 include Modules.am
630
631 ###############################################################################
632 # Force rule
633 ###############################################################################
634 FORCE: