]> git.sesse.net Git - vlc/blob - Makefile.am
* modules/access/*: grrr... apparently I also need to reset the file descriptor set...
[vlc] / Makefile.am
1 ###############################################################################
2 # Automake targets and declarations
3 ###############################################################################
4
5 # SUBDIRS stores the directories where a "make" is required when building
6 # something. DIST_SUBDIRS stores the directories where nothing is built but
7 # which have makefiles with distribution information.
8 SUBDIRS = po intl m4 share
9 DIST_SUBDIRS = $(SUBDIRS) modules src debian doc ipkg lib autotools
10
11 EXTRA_DIST = HACKING MAINTAINERS src/extras/COPYING \
12              INSTALL.win32 README.MacOSX.rtf vlc.spec install-win32 \
13              Modules.am \
14              configure.ac.in mkinstalldirs bootstrap
15 MOSTLYCLEANFILES =
16 BUILT_SOURCES =
17 SUFFIXES = 
18 NULL =
19
20 # List of programs, libraries and headers that need to be built and/or
21 # distributed. Initialized to empty because we'll use += later.
22 bin_PROGRAMS =
23
24 lib_LIBRARIES = 
25 libvlc_LIBRARIES =
26 noinst_LIBRARIES =
27
28 noinst_HEADERS =
29
30 # Tell aclocal to use -I m4. Wonder if it really works.
31 ACLOCAL_AMFLAGS = -I m4
32
33 # XXX: these flags could be set in configure.ac.in, but we set them here
34 # because old versions of automake don't support them in configure.ac.
35 AUTOMAKE_OPTIONS = dist-bzip2 subdir-objects
36
37 ###############################################################################
38 # Compilation flags for debug mode, profiling, and others
39 ###############################################################################
40
41 # Standard flags used everywhere to build things in the distribution. Some
42 # of them are empty but might be extended later in the Makefile. *_default
43 # is the default flag list for all files in the distribution, for instance
44 # the vlc code. *_pic is for PIC code, such as the Mozilla plugin. *_plugin
45 # is for plugin code, *_builtin is for builtin code, and *_builtin_pic is
46 # for PIC builtin code, for instance builtin modules in the mozilla plugin.
47
48 CPPFLAGS_default = -I$(top_srcdir)/include
49 CFLAGS_default = 
50 CXXFLAGS_default = 
51 OBJCFLAGS_default = 
52 LDFLAGS_default =
53
54 CPPFLAGS_pic = $(CPPFLAGS_default)
55 CFLAGS_pic = $(CFLAGS_default) @CFLAGS_pics@
56 CXXFLAGS_pic = $(CXXFLAGS_default) @CFLAGS_pics@
57 OBJCFLAGS_pic = $(OBJCFLAGS_default) @CFLAGS_pics@
58 LDFLAGS_pic = $(LDFLAGS_default)
59
60 CPPFLAGS_plugin = $(CPPFLAGS_default) -D__VLC__ -D__PLUGIN__
61 CFLAGS_plugin = $(CFLAGS_default) @CFLAGS_plugins@
62 CXXFLAGS_plugin = $(CXXFLAGS_default) @CFLAGS_plugins@
63 OBJCFLAGS_plugin = $(OBJCFLAGS_default) @CFLAGS_plugins@
64 LDFLAGS_plugin = @LDFLAGS_plugins@
65
66 CPPFLAGS_builtin = $(CPPFLAGS_default) -D__VLC__ -D__BUILTIN__
67 CFLAGS_builtin = $(CFLAGS_default) @CFLAGS_builtins@
68 CXXFLAGS_builtin = $(CXXFLAGS_default) @CFLAGS_builtins@
69 OBJCFLAGS_builtin = $(OBJCFLAGS_default) @CFLAGS_builtins@
70 LDFLAGS_builtin =
71 L_builtin =
72
73 CPPFLAGS_builtin_pic = $(CPPFLAGS_builtin) $(CPPFLAGS_pic)
74 CFLAGS_builtin_pic = $(CFLAGS_builtin) $(CFLAGS_pic)
75 CXXFLAGS_builtin_pic = $(CXXFLAGS_builtin) $(CXXFLAGS_pic)
76 OBJCFLAGS_builtin_pic = $(OBJCFLAGS_builtin) $(OBJCFLAGS_pic)
77 LDFLAGS_builtin_pic = $(LDFLAGS_builtin) $(LDFLAGS_pic)
78 L_builtin_pic = $(L_builtin) $(L_pic)
79
80 # On Linux and Solaris, activate 64-bit off_t (by default under BSD)
81 CPPFLAGS_default += -D_FILE_OFFSET_BITS=64 -D__USE_UNIX98 -D_LARGEFILE64_SOURCE
82 CPPFLAGS_default += -D_REENTRANT -D_THREAD_SAFE
83 CPPFLAGS_default += -D_GNU_SOURCE
84
85 # Gettext support
86 CPPFLAGS_default += -DLOCALEDIR=\"$(datadir)/locale\"
87
88 # Data and plugin location
89 CPPFLAGS_default += -DDATA_PATH=\"@prefix@/share/vlc\"
90 CPPFLAGS_default += -DPLUGIN_PATH=\"@prefix@/lib/vlc\"
91
92 # Conditional flags that get added to *FLAGS_default
93 if RELEASE
94 CPPFLAGS_release = -DHAVE_RELEASE
95 endif
96 if DEBUG
97 CPPFLAGS_debug = -DDEBUG
98 CFLAGS_debug = -g
99 endif
100 if GPROF
101 CPPFLAGS_gprof = -DGPROF
102 CFLAGS_gprof = -finstrument-functions
103 endif
104 if CPROF
105 CPPFLAGS_cprof = -DCPROF
106 CFLAGS_cprof = -pg
107 endif
108 if OPTIM
109 CFLAGS_optim = @CFLAGS_OPTIM@ @CFLAGS_TUNING@
110 if DEBUG
111 else
112 if GPROF
113 else
114 if CPROF
115 else
116 CFLAGS_nodebug = @CFLAGS_OPTIM_NODEBUG@
117 endif
118 endif
119 endif
120 else
121 # !OPTIM
122 CFLAGS_optim = @CFLAGS_NOOPTIM@
123 endif
124
125 CPPFLAGS_default += $(CPPFLAGS_release) \
126                 $(CPPFLAGS_debug) $(CPPFLAGS_gprof) $(CPPFLAGS_cprof)
127 CFLAGS_default += $(CFLAGS_optim) $(CFLAGS_nodebug) \
128                 $(CFLAGS_debug) $(CFLAGS_gprof) $(CFLAGS_cprof)
129 CXXFLAGS_default += $(CFLAGS_optim) $(CFLAGS_nodebug) \
130                 $(CFLAGS_debug) $(CFLAGS_gprof) $(CFLAGS_cprof)
131 OBJCFLAGS_default += $(CFLAGS_optim) $(CFLAGS_nodebug) \
132                 $(CFLAGS_debug) $(CFLAGS_gprof) $(CFLAGS_cprof)
133
134 ###############################################################################
135 # Headers
136 ###############################################################################
137
138 BUILT_SOURCES += \
139         include/vlc_symbols.h \
140         src/misc/modules_builtin.h \
141         src/misc/modules_plugin.h \
142         $(NULL)
143
144 pkgincludedir = $(includedir)/vlc
145
146 dist_pkginclude_HEADERS = \
147         include/vlc/vlc.h \
148         include/vlc/aout.h \
149         include/vlc/vout.h \
150         include/vlc/sout.h \
151         include/vlc/decoder.h \
152         include/vlc/input.h \
153         include/vlc/intf.h \
154         $(NULL)
155
156 noinst_HEADERS += $(HEADERS_include) $(HEADERS_include_built)
157
158 HEADERS_include = \
159         include/aout_internal.h \
160         include/audio_output.h \
161         include/beos_specific.h \
162         include/configuration.h \
163         include/darwin_specific.h \
164         include/codecs.h \
165         include/error.h \
166         include/encoder.h \
167         include/input_ext-dec.h \
168         include/input_ext-intf.h \
169         include/input_ext-plugins.h \
170         include/interface.h \
171         include/intf_eject.h \
172         include/iso_lang.h \
173         include/httpd.h \
174         include/main.h \
175         include/mmx.h \
176         include/modules.h \
177         include/modules_inner.h \
178         include/mtime.h \
179         include/netutils.h \
180         include/network.h \
181         include/os_specific.h \
182         include/stream_control.h \
183         include/stream_output.h \
184         include/variables.h \
185         include/video.h \
186         include/video_output.h \
187         include/vlc_common.h \
188         include/vlc_config.h \
189         include/vlc_cpu.h \
190         include/vlc_messages.h \
191         include/vlc_objects.h \
192         include/vlc_playlist.h \
193         include/vlc_threads.h \
194         include/vlc_threads_funcs.h \
195         include/win32_specific.h \
196         include/osd.h \
197         $(NULL)
198
199 HEADERS_include_built = \
200         include/vlc_symbols.h \
201         $(NULL)
202
203 include/vlc_symbols.h: Makefile $(HEADERS_include)
204         ./toolbox --update-includes $(BUILTINS)
205
206 src/misc/modules_plugin.h: Makefile src/misc/modules_plugin.h.in $(HEADERS_include)
207         ./toolbox --update-includes $(BUILTINS)
208
209 src/misc/modules_builtin.h: Makefile src/misc/modules_builtin.h.in
210         ./toolbox --update-includes $(BUILTINS)
211
212 # These dependencies are mandatory
213 $(SOURCES): include/vlc_symbols.h
214 $(SOURCES_libvlc): src/misc/modules_plugin.h src/misc/modules_builtin.h $(LIB_intl)
215
216 ###############################################################################
217 # Optional libintl - FIXME, bad dependencies
218 ###############################################################################
219
220 intl/libintl.a: FORCE
221         cd intl && $(MAKE)
222
223 if BUILD_INTL
224 LIB_intl = intl/libintl.a
225 endif
226
227 ###############################################################################
228 # MacOS X project
229 ###############################################################################
230
231 EXTRA_DIST += \
232         extras/MacOSX/Resources/English.lproj/MainMenu.nib/classes.nib \
233         extras/MacOSX/Resources/English.lproj/MainMenu.nib/info.nib \
234         extras/MacOSX/Resources/English.lproj/MainMenu.nib/objects.nib \
235         extras/MacOSX/Resources/English.lproj/InfoPlist.strings \
236         extras/MacOSX/Resources/divx.icns \
237         extras/MacOSX/Resources/generic.icns \
238         extras/MacOSX/Resources/mpeg.icns \
239         extras/MacOSX/Resources/mpeg1.icns \
240         extras/MacOSX/Resources/mpeg2.icns \
241         extras/MacOSX/Resources/mpeg4.icns \
242         extras/MacOSX/Resources/vlc.icns \
243         extras/MacOSX/Resources/back.png \
244         extras/MacOSX/Resources/begin.png \
245         extras/MacOSX/Resources/end.png \
246         extras/MacOSX/Resources/forw.png \
247         extras/MacOSX/Resources/list.png \
248         extras/MacOSX/Resources/pause.png \
249         extras/MacOSX/Resources/play.png \
250         extras/MacOSX/Resources/prefs.png \
251         extras/MacOSX/Resources/slow.png \
252         extras/MacOSX/Resources/stop.png \
253         extras/MacOSX/Resources/vlc_hg.png \
254         extras/MacOSX/Resources/vlc.scriptSuite \
255         extras/MacOSX/Resources/English.lproj/vlc.scriptTerminology \
256         extras/MacOSX/vlc.pbproj/project.pbxproj \
257         extras/MacOSX/macosx-dmg \
258         $(NULL)
259
260 ###############################################################################
261 # MS Visual Studio and eMbedded Visual Studio projects
262 ###############################################################################
263
264 EXTRA_DIST += \
265         msvc/vlc.dsw \
266         msvc/libvlc.dsp.in \
267         msvc/plugins.dsp.in \
268         msvc/vlc.dsp.in \
269         msvc/config.h.in \
270         msvc/modules_builtin_msvc.h \
271         evc/vlc.vcw \
272         evc/libvlc.vcp.in \
273         evc/vlc.vcp.in \
274         evc/plugins.vcp.in \
275         evc/vlc.c \
276         evc/config.h.in \
277         evc/modules_builtin_evc.h \
278         $(NULL)
279
280 show-libvlc-sources: FORCE
281         @echo X: $(SOURCES_libvlc_common) $(SOURCES_libvlc_win32) $(SOURCES_libvlc_dirent) $(SOURCES_libvlc_getopt)
282
283 show-libvlc-headers: FORCE
284         @echo X: $(HEADERS_include) $(HEADERS_include_built)
285
286 show-libvlc-pkg-headers: FORCE
287         @echo X: $(dist_pkginclude_HEADERS)
288
289 ###############################################################################
290 # Building libvlc
291 ###############################################################################
292
293 bin_SCRIPTS = vlc-config
294
295 lib_LIBRARIES += lib/libvlc.a $(LIBRARIES_libvlc_pic)
296
297 lib_libvlc_a_SOURCES = $(SOURCES_libvlc)
298 lib_libvlc_a_CFLAGS = $(CPPFLAGS_default) -D__VLC__ $(CFLAGS_default) @CFLAGS_vlc@
299 lib_libvlc_a_CXXFLAGS = $(CPPFLAGS_default) -D__VLC__ $(CXXFLAGS_default)
300 lib_libvlc_a_OBJCFLAGS = $(CPPFLAGS_default) -D__VLC__ $(OBJCFLAGS_default)
301
302 lib_libvlc_pic_a_SOURCES = $(SOURCES_libvlc)
303 lib_libvlc_pic_a_CFLAGS = $(CPPFLAGS_pic) -D__VLC__ $(CFLAGS_pic) @CFLAGS_vlc@
304 lib_libvlc_pic_a_CXXFLAGS = $(CPPFLAGS_pic) -D__VLC__ $(CXXFLAGS_pic)
305 lib_libvlc_pic_a_OBJCFLAGS = $(CPPFLAGS_pic) -D__VLC__ $(OBJCFLAGS_pic)
306
307 if HAVE_BEOS
308 OPT_SOURCES_libvlc_beos = $(SOURCES_libvlc_beos)
309 endif
310 if HAVE_DARWIN
311 OPT_SOURCES_libvlc_darwin = $(SOURCES_libvlc_darwin)
312 endif
313 if HAVE_WIN32
314 OPT_SOURCES_libvlc_win32 = $(SOURCES_libvlc_win32)
315 endif
316 if BUILD_DIRENT
317 OPT_SOURCES_libvlc_dirent = $(SOURCES_libvlc_dirent)
318 endif
319 if BUILD_GETOPT
320 OPT_SOURCES_libvlc_getopt = $(SOURCES_libvlc_getopt)
321 endif
322 if BUILD_MOZILLA
323 LIBRARIES_libvlc_pic = lib/libvlc_pic.a
324 endif
325
326 EXTRA_DIST += \
327         $(SOURCES_libvlc_beos) \
328         $(SOURCES_libvlc_darwin) \
329         $(SOURCES_libvlc_win32) \
330         $(SOURCES_libvlc_dirent) \
331         $(SOURCES_libvlc_getopt) \
332         $(NULL)
333
334 SOURCES_libvlc_beos = \
335         src/misc/beos_specific.cpp \
336         $(NULL)
337
338 SOURCES_libvlc_darwin = \
339         src/misc/darwin_specific.m \
340         $(NULL)
341
342 SOURCES_libvlc_win32 = \
343         src/misc/win32_specific.c \
344         $(NULL)
345
346 SOURCES_libvlc_dirent = \
347         src/extras/dirent.c \
348         src/extras/dirent.h \
349         $(NULL)
350
351 SOURCES_libvlc_getopt = \
352         src/extras/getopt.c \
353         src/extras/getopt.h \
354         src/extras/getopt1.c \
355         $(NULL)
356
357 SOURCES_libvlc_common = \
358         src/libvlc.c \
359         src/libvlc.h \
360         src/interface/interface.c \
361         src/interface/intf_eject.c \
362         src/playlist/playlist.c \
363         src/input/input.c \
364         src/input/input_ext-plugins.c \
365         src/input/input_ext-dec.c \
366         src/input/input_ext-intf.c \
367         src/input/input_dec.c \
368         src/input/input_programs.c \
369         src/input/input_clock.c \
370         src/input/input_info.c \
371         src/video_output/video_output.c \
372         src/video_output/vout_pictures.c \
373         src/video_output/vout_pictures.h \
374         src/video_output/video_text.c \
375         src/video_output/video_text.h \
376         src/video_output/vout_subpictures.c \
377         src/audio_output/common.c \
378         src/audio_output/dec.c \
379         src/audio_output/filters.c \
380         src/audio_output/input.c \
381         src/audio_output/mixer.c \
382         src/audio_output/output.c \
383         src/audio_output/intf.c \
384         src/stream_output/stream_output.c \
385         src/misc/mtime.c \
386         src/misc/modules.c \
387         src/misc/threads.c \
388         src/misc/cpu.c \
389         src/misc/configuration.c \
390         src/misc/netutils.c \
391         src/misc/iso_lang.c \
392         src/misc/iso-639_def.h \
393         src/misc/messages.c \
394         src/misc/objects.c \
395         src/misc/variables.c \
396         src/misc/error.c \
397         src/extras/libc.c \
398         $(NULL)
399
400 SOURCES_libvlc = \
401         $(SOURCES_libvlc_common) \
402         $(OPT_SOURCES_libvlc_beos) \
403         $(OPT_SOURCES_libvlc_darwin) \
404         $(OPT_SOURCES_libvlc_win32) \
405         $(OPT_SOURCES_libvlc_dirent) \
406         $(OPT_SOURCES_libvlc_getopt) \
407         $(NULL)
408
409 ###############################################################################
410 # Building vlc
411 ###############################################################################
412
413 bin_PROGRAMS += vlc
414
415 vlc_SOURCES = src/vlc.c
416
417 # @AUTOMAKE_SUCKS@ gets expanded to $(L_builtin) $(LDFLAGS_builtin)
418 # but we don't write it directly, otherwise automake will go amok and eat all
419 # the memory because of its 2^N crap algorithm. So we fool him. Nuahaha.
420 vlc_LDADD = lib/libvlc.a $(LDFLAGS_vlc) \
421             $(DATA_win32_rc) $(LIB_intl) @AUTOMAKE_SUCKS@
422 vlc_CFLAGS = $(CPPFLAGS_default) $(CFLAGS_default)
423
424 # We use DEPENDENCIES_vlc instead of vlc_DEPENDENCIES because of an
425 # old automake-1.5 bug (automake/279).
426 DEPENDENCIES_vlc = lib/libvlc.a $(L_builtin) $(DATA_win32_rc) $(LIB_intl)
427
428 vlc$(EXEEXT): $(vlc_OBJECTS) $(DEPENDENCIES_vlc)
429         @rm -f vlc$(EXEEXT)
430         $(LINK) $(vlc_LDFLAGS) $(vlc_OBJECTS) $(vlc_LDADD) $(LIBS)
431 if HAVE_BEOS
432         xres -o $@ ./share/vlc_beos.rsrc
433         mimeset -f $@
434 endif
435
436 # Install the symlinks
437 install-exec-local:
438         for i in dummy $(ALIASES) ; do if test "x$$i" != "xdummy" ; then \
439                 rm -f $(DESTDIR)$(bindir)/$$i && \
440                 ln -s vlc $(DESTDIR)$(bindir)/$$i ; \
441         fi ; done
442
443 if HAVE_DARWIN
444 # Create the MacOS X app
445 vlc_app_DATA = VLC.app
446 vlc_appdir = $(bindir)
447 VLC.app: vlc $(PLUGIN_FILES)
448         rm -Rf VLC.app
449         cd extras/MacOSX ; pbxbuild | grep -v '^[ \t]' | grep -v "^$$"
450         cp -r extras/MacOSX/build/vlc.bundle ./VLC.app
451         $(INSTALL) -d VLC.app/Contents/MacOS
452         $(INSTALL) vlc VLC.app/Contents/MacOS/VLC
453         $(INSTALL) -d VLC.app/Contents/MacOS/modules
454         for i in dummy $(PLUGIN_FILES) ; do if test "x$$i" != "xdummy" ; then \
455                 $(INSTALL) $$i VLC.app/Contents/MacOS/modules/ ; \
456         fi ; done
457         $(INSTALL) -d VLC.app/Contents/MacOS/share
458         $(INSTALL) -m 644 share/*.psf share/*.rle VLC.app/Contents/MacOS/share
459         $(INSTALL) -d VLC.app/Contents/MacOS/locale
460         for i in $(ALL_LINGUAS); do \
461                 mkdir -p VLC.app/Contents/MacOS/locale/$${i%}/LC_MESSAGES ; \
462                 cp po/$${i}.gmo VLC.app/Contents/MacOS/locale/$${i}/LC_MESSAGES/vlc.mo || true ; \
463         done
464         echo -n "APPLVLC#" >| VLC.app/Contents/PkgInfo
465 endif
466
467 if HAVE_WIN32
468 DATA_win32_rc = $(noinst_share_vlc_win32_rc_DATA)
469 noinst_share_vlc_win32_rc_DATA = share/vlc_win32_rc.$(OBJEXT)
470 noinst_share_vlc_win32_rcdir = $(libdir)
471 share/vlc_win32_rc.$(OBJEXT): share/vlc_win32_rc.rc
472         $(WINDRES) --include-dir share -i $< -o $@
473 endif
474
475 ###############################################################################
476 # Building architecture-specific binary packages
477 ###############################################################################
478
479 # XXX: this rule is probably only useful to you if you have exactly
480 # the same setup as me. Contact sam@zoy.org if you need to use it.
481 #
482 # Check that tmp isn't in the way
483 package-win32:
484         @if test -e tmp; then \
485                 echo "Error: please remove ./tmp, it is in the way"; false; \
486         else \
487                 echo "OK."; mkdir tmp; \
488         fi
489 # Create installation script
490         cp install-win32 tmp/nsi
491 # Copy relevant files
492         cp vlc.exe tmp/ 
493         $(STRIP) tmp/vlc.exe
494         cp INSTALL.win32 tmp/INSTALL.txt ; unix2dos tmp/INSTALL.txt
495         for file in AUTHORS MAINTAINERS THANKS NEWS COPYING README ; \
496                         do cp $$file tmp/$${file}.txt ; \
497                         unix2dos tmp/$${file}.txt ; done
498
499         mkdir tmp/plugins
500         for i in dummy $(PLUGIN_FILES) ; do if test "x$$i" != "xdummy" ; then \
501                 $(INSTALL) $$i tmp/plugins/ ; \
502         fi ; done
503
504         for i in dummy tmp/plugins/*$(LIBEXT) ; \
505                 do if test $$i != tmp/plugins/libwin32_plugin$(LIBEXT) \
506                 -a $$i != dummy ; then $(STRIP) $$i ; fi ; done
507         mkdir tmp/share
508         cp share/*.rle tmp/share/ ;
509
510         mkdir tmp/locale
511         for i in $(ALL_LINGUAS); do \
512                 mkdir -p tmp/locale/$${i}/LC_MESSAGES ; \
513                 cp po/$${i}.gmo tmp/locale/$${i}/LC_MESSAGES/vlc.mo || true ; \
514         done
515
516         cd doc/faq ; $(MAKE) html ; cd ../.. ;
517         cp doc/faq/index.html tmp/FAQ.htm ;
518
519 # Create package 
520         wine ~/.wine/fake_windows/Program\ Files/NSIS/makensis.exe -- /DVERSION=${VERSION} tmp/nsi
521 # Clean up
522         rm -Rf tmp
523
524 package-beos:
525 # Check that tmp isn't in the way
526         @if test -e tmp; then \
527                 echo "Error: please remove ./tmp, it is in the way"; false; \
528         else \
529                 echo "OK."; mkdir tmp; \
530         fi
531         
532 # Create dir
533         mkdir -p tmp/vlc/share
534 # Copy relevant files
535         cp vlc tmp/vlc/
536         $(STRIP) tmp/vlc/vlc
537         xres -o tmp/vlc/vlc ./share/vlc_beos.rsrc
538         cp AUTHORS COPYING ChangeLog README THANKS NEWS tmp/vlc/
539         for file in default8x16.psf default8x9.psf ; \
540                 do cp share/$$file tmp/vlc/share/ ; done
541         mkdir tmp/vlc/plugins
542         for i in dummy $(PLUGIN_FILES) ; do if test "x$$i" != "xdummy" ; then \
543                 $(INSTALL) $$i tmp/vlc/plugins/ ; \
544         fi ; done
545         for i in dummy tmp/vlc/plugins/*$(LIBEXT) ; do if test $$i != dummy ; then $(STRIP) $$i ; fi ; done
546 # Create package 
547         mv tmp/vlc tmp/vlc-${VERSION}
548         (cd tmp ; find vlc-${VERSION} | \
549         zip -9 -@ vlc-${VERSION}-BeOS-x86.zip )
550         mv tmp/vlc-${VERSION}-BeOS-x86.zip .
551 # Clean up
552         rm -Rf tmp
553
554 package-macosx:
555 # Check that tmp isn't in the way
556         @if test -e tmp; then \
557                 echo "Error: please remove ./tmp, it is in the way"; false; \
558         else \
559                 echo "OK."; mkdir tmp; \
560         fi
561
562 # Copy relevant files 
563         cp -R VLC.app tmp/
564         cp AUTHORS COPYING ChangeLog README README.MacOSX.rtf THANKS NEWS tmp/
565
566 # Create disk image 
567         ./extras/MacOSX/macosx-dmg 18 "vlc-${VERSION}" tmp/* 
568
569 # Clean up
570         rm -Rf tmp
571
572 ###############################################################################
573 # Building the Mozilla plugin
574 ###############################################################################
575
576 noinst_LIBRARIES += $(noinst_LIBRARIES_mozilla)
577
578 MOSTLYCLEANFILES += $(LIBRARIES_mozilla)
579
580 EXTRA_DIST += $(SOURCES_mozilla) mozilla/vlcintf.idl
581
582 BUILT_SOURCES += $(BUILT_SOURCES_mozilla)
583
584 SOURCES_mozilla = \
585         mozilla/vlcshell.cpp \
586         mozilla/vlcplugin.cpp \
587         mozilla/vlcplugin.h \
588         mozilla/vlcpeer.cpp \
589         mozilla/vlcpeer.h \
590         mozilla/classinfo.h \
591         $(SOURCES_mozilla_win32) \
592         $(SOURCES_mozilla_unix) \
593         $(NULL)
594
595 # Under Win32, Mozilla plugins need to be named NP******.DLL, but under Unix
596 # the common naming scheme is lib******plugin.so. Also, we need npwin.cpp
597 # under Win32 and npunix.c under Unix.
598 if HAVE_WIN32
599 LIBRARIES_mozilla = mozilla/npvlc$(LIBEXT)
600 SOURCES_mozilla_win32 = mozilla/npwin.cpp
601 CPPFLAGS_mozilla_EXTRA = -DXP_WIN -DXP_WIN32
602 else
603 LIBRARIES_mozilla = mozilla/libvlcplugin$(LIBEXT)
604 SOURCES_mozilla_unix = mozilla/npunix.c
605 endif
606
607 if BUILD_MOZILLA
608 if UNTRUE
609 noinst_LIBRARIES_mozilla = mozilla/libplugin.a
610 endif
611
612 mozilla_libplugin_a_SOURCES = $(SOURCES_mozilla)
613 mozilla_libplugin_a_CFLAGS = $(CPPFLAGS_pic) $(CFLAGS_pic) \
614                              $(CPPFLAGS_mozilla) $(CFLAGS_mozilla) \
615                              $(CPPFLAGS_mozilla_EXTRA)
616 mozilla_libplugin_a_CXXFLAGS = $(CPPFLAGS_pic) $(CXXFLAGS_pic) \
617                                $(CPPFLAGS_mozilla) $(CXXFLAGS_mozilla) \
618                                $(CPPFLAGS_mozilla_EXTRA)
619 mozilla_libplugin_a_DEPENDENCIES = lib/libvlc_pic.a $(L_builtin_pic) $(DATA_npvlc_rc)
620
621 BUILT_SOURCES_mozilla = mozilla/vlcintf.h
622 $(SOURCES_mozilla): mozilla/vlcintf.h
623
624 mozilla_plugin_DATA = $(LIBRARIES_mozilla)
625 mozilla_plugindir = $(libdir)/mozilla/plugins
626 $(LIBRARIES_mozilla): $(mozilla_libplugin_a_OBJECTS) \
627                       $(mozilla_libplugin_a_DEPENDENCIES) \
628                       $(L_builtin_pic)
629         $(CXXLINK) $(mozilla_libplugin_a_OBJECTS) $(DATA_npvlc_rc) \
630                 lib/libvlc_pic.a $(L_builtin_pic) -shared $(LDFLAGS) \
631                 $(LDFLAGS_vlc) $(LDFLAGS_mozilla) $(LDFLAGS_builtin_pic)
632
633 mozilla_vlcintf_xpt_DATA = mozilla/vlcintf.xpt
634 mozilla_vlcintf_xptdir = $(libdir)/mozilla/components
635 mozilla/vlcintf.xpt: Makefile mozilla/vlcintf.idl
636         $(XPIDL) -I/usr/share/idl/mozilla -m typelib \
637                 -o mozilla/vlcintf mozilla/vlcintf.idl
638
639 mozilla/vlcintf.h: Makefile mozilla/vlcintf.idl
640         $(XPIDL) -I/usr/share/idl/mozilla -m header \
641                 -o mozilla/vlcintf mozilla/vlcintf.idl
642
643 if HAVE_WIN32
644 DATA_npvlc_rc = $(noinst_mozilla_npvlc_rc_DATA)
645 noinst_mozilla_npvlc_rc_DATA = mozilla/npvlc_rc.$(OBJEXT)
646 noinst_mozilla_npvlc_rcdir = $(libdir)
647 mozilla/npvlc_rc.$(OBJEXT): mozilla/npvlc_rc.rc
648         $(WINDRES) --include-dir mozilla -i $< -o $@
649 endif
650 endif
651
652 ###############################################################################
653 # Modules
654 ###############################################################################
655 MOSTLYCLEANFILES += $(PLUGIN_FILES)
656 PLUGIN_FILES =
657
658 libvlcdir = $(libdir)/vlc
659
660 include Modules.am
661
662 ###############################################################################
663 # Force rule
664 ###############################################################################
665 FORCE: