]> git.sesse.net Git - vlc/blob - Makefile.am
* ./debian/vlc.docs, ./Makefile.am: added THANKS to the distributed files.
[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
10
11 EXTRA_DIST = FAQ HACKING MAINTAINERS THANKS src/extras/COPYING \
12              INSTALL.win32 README.MacOSX.rtf vlc.spec install-win32 \
13              Modules.am macosx-dmg \
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/main.h \
174         include/mmx.h \
175         include/modules.h \
176         include/modules_inner.h \
177         include/mtime.h \
178         include/netutils.h \
179         include/network.h \
180         include/os_specific.h \
181         include/stream_control.h \
182         include/stream_output.h \
183         include/variables.h \
184         include/video.h \
185         include/video_output.h \
186         include/vlc_common.h \
187         include/vlc_config.h \
188         include/vlc_cpu.h \
189         include/vlc_messages.h \
190         include/vlc_objects.h \
191         include/vlc_playlist.h \
192         include/vlc_threads.h \
193         include/vlc_threads_funcs.h \
194         include/win32_specific.h \
195         $(NULL)
196
197 HEADERS_include_built = \
198         include/vlc_symbols.h \
199         $(NULL)
200
201 include/vlc_symbols.h: Makefile $(HEADERS_include)
202         rm -f $@.in
203         echo '/* DO NOT EDIT THIS FILE! See Makefile.am */' >> $@.in
204         echo 'struct module_symbols_t {' >> $@.in
205         cat $(HEADERS_include) | grep '^ *VLC_EXPORT.*;' | sed -e 's/VLC_EXPORT( *\([^,]*\), *\([^,]*\), *\(.*\));.*/    \1 (* \2_inner) \3;/' >> $@.in
206         echo '};' >> $@.in
207         echo '#ifdef __PLUGIN__' >> $@.in
208         cat $(HEADERS_include) | grep '^ *VLC_EXPORT.*;' | sed -e 's/VLC_EXPORT( *\([^,]*\), *\([^,]*\), *\(.*\));.*/#   define \2 p_symbols->\2_inner/' >> $@.in
209         echo '#endif /* __PLUGIN__ */' >> $@.in
210         mv -f $@.in $@
211
212 src/misc/modules_plugin.h: Makefile src/misc/modules_plugin.h.in $(HEADERS_include)
213         rm -f $@.tmp && cp $@.in $@.tmp
214         sed -e 's#.*\$[I][d]:.*# * Automatically generated from '$@'.in by bootstrap#' < $@.in > $@.tmp
215         echo '#define STORE_SYMBOLS( p_symbols ) \' >> $@.tmp
216         cat $(HEADERS_include) | grep '^ *VLC_EXPORT.*;' | sed -e 's/VLC_EXPORT( *\([^,]*\), *\([^,]*\), *\(.*\));.*/    (p_symbols)->\2_inner = \2; \\/' >> $@.tmp
217         echo '' >> $@.tmp
218         mv -f $@.tmp $@
219
220 src/misc/modules_builtin.h: Makefile src/misc/modules_builtin.h.in
221         rm -f $@.tmp && cp $@.in $@.tmp
222 if HAVE_BUILTINS
223         for i in $(BUILTINS) ; do echo "int vlc_entry__"`echo $$i | sed -e 'y@/@_@' -e 's@\..*@@'`"( module_t* );" >>$@.tmp; done
224         echo "" >> $@.tmp
225 endif
226         echo "#define ALLOCATE_ALL_BUILTINS() \\" >> $@.tmp
227         echo "    do \\" >> $@.tmp
228         echo "    { \\" >> $@.tmp
229 if HAVE_BUILTINS
230         for i in $(BUILTINS) ; do echo "        ALLOCATE_BUILTIN("`echo $$i | sed -e 'y@/@_@' -e 's@\..*@@'`"); \\" >> $@.tmp ; done
231 endif
232         echo "    } while( 0 );" >> $@.tmp
233         echo "" >> $@.tmp
234         mv -f $@.tmp $@
235
236 # These dependencies are mandatory
237 $(SOURCES): include/vlc_symbols.h
238 $(SOURCES_libvlc): src/misc/modules_plugin.h src/misc/modules_builtin.h $(LIB_intl)
239
240 ###############################################################################
241 # Optional libintl - FIXME, bad dependencies
242 ###############################################################################
243
244 intl/libintl.a: FORCE
245         cd intl && $(MAKE)
246
247 if BUILD_INTL
248 LIB_intl = intl/libintl.a
249 endif
250
251 ###############################################################################
252 # MacOS X project
253 ###############################################################################
254
255 EXTRA_DIST += \
256         extras/MacOSX/Resources/English.lproj/MainMenu.nib/classes.nib \
257         extras/MacOSX/Resources/English.lproj/MainMenu.nib/info.nib \
258         extras/MacOSX/Resources/English.lproj/MainMenu.nib/objects.nib \
259         extras/MacOSX/Resources/English.lproj/InfoPlist.strings \
260         extras/MacOSX/Resources/divx.icns \
261         extras/MacOSX/Resources/generic.icns \
262         extras/MacOSX/Resources/mpeg.icns \
263         extras/MacOSX/Resources/mpeg1.icns \
264         extras/MacOSX/Resources/mpeg2.icns \
265         extras/MacOSX/Resources/mpeg4.icns \
266         extras/MacOSX/Resources/vlc.icns \
267         extras/MacOSX/Resources/back.png \
268         extras/MacOSX/Resources/begin.png \
269         extras/MacOSX/Resources/end.png \
270         extras/MacOSX/Resources/forw.png \
271         extras/MacOSX/Resources/list.png \
272         extras/MacOSX/Resources/pause.png \
273         extras/MacOSX/Resources/play.png \
274         extras/MacOSX/Resources/prefs.png \
275         extras/MacOSX/Resources/stop.png \
276         extras/MacOSX/Resources/vlc_hg.png \
277         extras/MacOSX/vlc.pbproj/project.pbxproj \
278         $(NULL)
279
280 ###############################################################################
281 # MS Visual Studio and eMbedded Visual Studio projects
282 ###############################################################################
283
284 EXTRA_DIST += \
285         msvc/vlc.dsw \
286         msvc/libvlc.dsp.in \
287         msvc/plugins.dsp.in \
288         msvc/vlc.dsp.in \
289         msvc/config.h.in \
290         msvc/modules_builtin_msvc.h \
291         evc/vlc.vcw \
292         evc/libvlc.vcp.in \
293         evc/vlc.vcp.in \
294         evc/plugins.vcp.in \
295         evc/vlc.c \
296         evc/config.h.in \
297         evc/modules_builtin_evc.h \
298         $(NULL)
299
300 show-libvlc-sources: FORCE
301         @echo X: $(SOURCES_libvlc_common) $(SOURCES_libvlc_win32) $(SOURCES_libvlc_dirent) $(SOURCES_libvlc_getopt)
302
303 show-libvlc-headers: FORCE
304         @echo X: $(HEADERS_include) $(HEADERS_include_built)
305
306 show-libvlc-pkg-headers: FORCE
307         @echo X: $(dist_pkginclude_HEADERS)
308
309 ###############################################################################
310 # Building libvlc
311 ###############################################################################
312
313 bin_SCRIPTS = vlc-config
314
315 lib_LIBRARIES += lib/libvlc.a $(LIBRARIES_libvlc_pic)
316
317 lib_libvlc_a_SOURCES = $(SOURCES_libvlc)
318 lib_libvlc_a_CFLAGS = $(CPPFLAGS_default) -D__VLC__ $(CFLAGS_default) @CFLAGS_vlc@
319 lib_libvlc_a_CXXFLAGS = $(CPPFLAGS_default) -D__VLC__ $(CXXFLAGS_default)
320 lib_libvlc_a_OBJCFLAGS = $(CPPFLAGS_default) -D__VLC__ $(OBJCFLAGS_default)
321
322 lib_libvlc_pic_a_SOURCES = $(SOURCES_libvlc)
323 lib_libvlc_pic_a_CFLAGS = $(CPPFLAGS_pic) -D__VLC__ $(CFLAGS_pic) @CFLAGS_vlc@
324 lib_libvlc_pic_a_CXXFLAGS = $(CPPFLAGS_pic) -D__VLC__ $(CXXFLAGS_pic)
325 lib_libvlc_pic_a_OBJCFLAGS = $(CPPFLAGS_pic) -D__VLC__ $(OBJCFLAGS_pic)
326
327 if HAVE_BEOS
328 OPT_SOURCES_libvlc_beos = $(SOURCES_libvlc_beos)
329 endif
330 if HAVE_DARWIN
331 OPT_SOURCES_libvlc_darwin = $(SOURCES_libvlc_darwin)
332 endif
333 if HAVE_WIN32
334 OPT_SOURCES_libvlc_win32 = $(SOURCES_libvlc_win32)
335 endif
336 if BUILD_DIRENT
337 OPT_SOURCES_libvlc_dirent = $(SOURCES_libvlc_dirent)
338 endif
339 if BUILD_GETOPT
340 OPT_SOURCES_libvlc_getopt = $(SOURCES_libvlc_getopt)
341 endif
342 if BUILD_MOZILLA
343 LIBRARIES_libvlc_pic = lib/libvlc_pic.a
344 endif
345
346 EXTRA_DIST += \
347         $(SOURCES_libvlc_beos) \
348         $(SOURCES_libvlc_darwin) \
349         $(SOURCES_libvlc_win32) \
350         $(SOURCES_libvlc_dirent) \
351         $(SOURCES_libvlc_getopt) \
352         $(NULL)
353
354 SOURCES_libvlc_beos = \
355         src/misc/beos_specific.cpp \
356         $(NULL)
357
358 SOURCES_libvlc_darwin = \
359         src/misc/darwin_specific.m \
360         $(NULL)
361
362 SOURCES_libvlc_win32 = \
363         src/misc/win32_specific.c \
364         $(NULL)
365
366 SOURCES_libvlc_dirent = \
367         src/extras/dirent.c \
368         src/extras/dirent.h \
369         $(NULL)
370
371 SOURCES_libvlc_getopt = \
372         src/extras/getopt.c \
373         src/extras/getopt.h \
374         src/extras/getopt1.c \
375         $(NULL)
376
377 SOURCES_libvlc_common = \
378         src/libvlc.c \
379         src/libvlc.h \
380         src/interface/interface.c \
381         src/interface/intf_eject.c \
382         src/playlist/playlist.c \
383         src/input/input.c \
384         src/input/input_ext-plugins.c \
385         src/input/input_ext-dec.c \
386         src/input/input_ext-intf.c \
387         src/input/input_dec.c \
388         src/input/input_programs.c \
389         src/input/input_clock.c \
390         src/input/input_info.c \
391         src/video_output/video_output.c \
392         src/video_output/vout_pictures.c \
393         src/video_output/vout_pictures.h \
394         src/video_output/video_text.c \
395         src/video_output/video_text.h \
396         src/video_output/vout_subpictures.c \
397         src/audio_output/common.c \
398         src/audio_output/dec.c \
399         src/audio_output/filters.c \
400         src/audio_output/input.c \
401         src/audio_output/mixer.c \
402         src/audio_output/output.c \
403         src/audio_output/intf.c \
404         src/stream_output/stream_output.c \
405         src/misc/mtime.c \
406         src/misc/modules.c \
407         src/misc/threads.c \
408         src/misc/cpu.c \
409         src/misc/configuration.c \
410         src/misc/netutils.c \
411         src/misc/iso_lang.c \
412         src/misc/iso-639_def.h \
413         src/misc/messages.c \
414         src/misc/objects.c \
415         src/misc/variables.c \
416         src/misc/error.c \
417         src/extras/libc.c \
418         $(NULL)
419
420 SOURCES_libvlc = \
421         $(SOURCES_libvlc_common) \
422         $(OPT_SOURCES_libvlc_beos) \
423         $(OPT_SOURCES_libvlc_darwin) \
424         $(OPT_SOURCES_libvlc_win32) \
425         $(OPT_SOURCES_libvlc_dirent) \
426         $(OPT_SOURCES_libvlc_getopt) \
427         $(NULL)
428
429 ###############################################################################
430 # Building vlc
431 ###############################################################################
432
433 bin_PROGRAMS += vlc
434
435 vlc_SOURCES = src/vlc.c
436
437 # @AUTOMAKE_SUCKS@ gets expanded to $(L_builtin) $(LDFLAGS_builtin)
438 # but we don't write it directly, otherwise automake will go amok and eat all
439 # the memory because of its 2^N crap algorithm. So we fool him. Nuahaha.
440 vlc_LDADD = lib/libvlc.a $(LDFLAGS_vlc) \
441             $(DATA_win32_rc) $(LIB_intl) @AUTOMAKE_SUCKS@
442 vlc_CFLAGS = $(CPPFLAGS_default) $(CFLAGS_default)
443
444 # We use DEPENDENCIES_vlc instead of vlc_DEPENDENCIES because of an
445 # old automake-1.5 bug (automake/279).
446 DEPENDENCIES_vlc = lib/libvlc.a $(L_builtin) $(DATA_win32_rc) $(LIB_intl)
447
448 vlc$(EXEEXT): $(vlc_OBJECTS) $(DEPENDENCIES_vlc)
449         @rm -f vlc$(EXEEXT)
450         $(LINK) $(vlc_LDFLAGS) $(vlc_OBJECTS) $(vlc_LDADD) $(LIBS)
451 if HAVE_BEOS
452         xres -o $@ ./share/vlc_beos.rsrc
453         mimeset -f $@
454 endif
455
456 # Install the symlinks
457 install-exec-local:
458         for i in dummy $(ALIASES) ; do if test "x$$i" != "xdummy" ; then \
459                 rm -f $(DESTDIR)$(bindir)/$$i && \
460                 ln -s vlc $(DESTDIR)$(bindir)/$$i ; \
461         fi ; done
462
463 if HAVE_DARWIN
464 # Create the MacOS X app
465 vlc_app_DATA = vlc.app
466 vlc_appdir = $(bindir)
467 vlc.app: vlc $(PLUGIN_FILES)
468         rm -Rf vlc.app
469         cd extras/MacOSX ; pbxbuild | grep -v '^[ \t]' | grep -v "^$$"
470         cp -r extras/MacOSX/build/vlc.bundle ./vlc.app
471         $(INSTALL) -d vlc.app/Contents/MacOS
472         $(INSTALL) vlc vlc.app/Contents/MacOS/
473         $(INSTALL) -d vlc.app/Contents/MacOS/modules
474         for i in dummy $(PLUGIN_FILES) ; do if test "x$$i" != "xdummy" ; then \
475                 $(INSTALL) $$i vlc.app/Contents/MacOS/modules/ ; \
476         fi ; done
477         $(INSTALL) -d vlc.app/Contents/MacOS/share
478         $(INSTALL) -m 644 share/*.psf share/*.rle vlc.app/Contents/MacOS/share
479         $(INSTALL) -d vlc.app/Contents/MacOS/locale
480         for i in $(CATALOGS); do \
481                 mkdir -p vlc.app/Contents/MacOS/locale/$${i%.gmo}/LC_MESSAGES ; \
482                 cp po/$$i vlc.app/Contents/MacOS/locale/$${i%.gmo}/LC_MESSAGES/vlc.mo || true ; \
483         done
484         echo -n "APPLVLC#" >| vlc.app/Contents/PkgInfo
485 endif
486
487 if HAVE_WIN32
488 DATA_win32_rc = $(noinst_share_vlc_win32_rc_DATA)
489 noinst_share_vlc_win32_rc_DATA = share/vlc_win32_rc.$(OBJEXT)
490 noinst_share_vlc_win32_rcdir = $(libdir)
491 share/vlc_win32_rc.$(OBJEXT): share/vlc_win32_rc.rc
492         $(WINDRES) --include-dir share -i $< -o $@
493 endif
494
495 ###############################################################################
496 # Building architecture-specific binary packages
497 ###############################################################################
498
499 # XXX: this rule is probably only useful to you if you have exactly
500 # the same setup as me. Contact sam@zoy.org if you need to use it.
501 #
502 # Check that tmp isn't in the way
503 package-win32:
504         @if test -e tmp; then \
505                 echo "Error: please remove ./tmp, it is in the way"; false; \
506         else \
507                 echo "OK."; mkdir tmp; \
508         fi
509 # Create installation script
510         cp install-win32 tmp/nsi
511 # Copy relevant files
512         cp vlc.exe tmp/ 
513         $(STRIP) tmp/vlc.exe
514         cp INSTALL.win32 tmp/INSTALL.txt ; unix2dos tmp/INSTALL.txt
515         for file in AUTHORS COPYING ChangeLog README FAQ ; \
516                         do cp $$file tmp/$${file}.txt ; \
517                         unix2dos tmp/$${file}.txt ; done
518         mkdir tmp/plugins
519         for i in dummy $(PLUGIN_FILES) ; do if test "x$$i" != "xdummy" ; then \
520                 $(INSTALL) $$i tmp/plugins/ ; \
521         fi ; done
522 # don't include these two
523 #rm -f tmp/plugins/gtk.so tmp/plugins/sdl.so
524         for i in dummy tmp/plugins/*$(LIBEXT) ; do if test $$i != tmp/plugins/intfwin.so -a $$i != dummy ; then $(STRIP) $$i ; fi ; done
525         mkdir tmp/share
526         for file in default8x16.psf default8x9.psf ; \
527                 do cp share/$$file tmp/share/ ; done
528 # Create package 
529         wine ~/.wine/fake_windows/Program\ Files/NSIS/makensis.exe -- /DVERSION=${VERSION} tmp/nsi
530 # Clean up
531         rm -Rf tmp
532
533 package-beos:
534 # Check that tmp isn't in the way
535         @if test -e tmp; then \
536                 echo "Error: please remove ./tmp, it is in the way"; false; \
537         else \
538                 echo "OK."; mkdir tmp; \
539         fi
540         
541 # Create dir
542         mkdir -p tmp/vlc/share
543 # Copy relevant files
544         cp vlc tmp/vlc/
545         $(STRIP) tmp/vlc/vlc
546         xres -o tmp/vlc/vlc ./share/vlc_beos.rsrc
547         cp AUTHORS COPYING ChangeLog README FAQ tmp/vlc/
548         for file in default8x16.psf default8x9.psf ; \
549                 do cp share/$$file tmp/vlc/share/ ; done
550         mkdir tmp/vlc/plugins
551         for i in dummy $(PLUGIN_FILES) ; do if test "x$$i" != "xdummy" ; then \
552                 $(INSTALL) $$i tmp/vlc/plugins/ ; \
553         fi ; done
554         for i in dummy tmp/vlc/plugins/*$(LIBEXT) ; do if test $$i != dummy ; then $(STRIP) $$i ; fi ; done
555 # Create package 
556         mv tmp/vlc tmp/vlc-${VERSION}
557         (cd tmp ; find vlc-${VERSION} | \
558         zip -9 -@ vlc-${VERSION}-BeOS-x86.zip )
559         mv tmp/vlc-${VERSION}-BeOS-x86.zip .
560 # Clean up
561         rm -Rf tmp
562
563 package-macosx:
564 # Check that tmp isn't in the way
565         @if test -e tmp; then \
566                 echo "Error: please remove ./tmp, it is in the way"; false; \
567         else \
568                 echo "OK."; mkdir tmp; \
569         fi
570
571 # Copy relevant files 
572         cp -R vlc.app tmp/
573         cp AUTHORS COPYING ChangeLog README README.MacOSX.rtf FAQ tmp/
574
575 # Create disk image 
576         ./macosx-dmg 18 "vlc-${VERSION}" tmp/* 
577
578 # Clean up
579         rm -Rf tmp
580
581 ###############################################################################
582 # Building the Mozilla plugin
583 ###############################################################################
584
585 noinst_LIBRARIES += $(noinst_LIBRARIES_mozilla)
586
587 MOSTLYCLEANFILES += $(LIBRARIES_mozilla)
588
589 EXTRA_DIST += $(SOURCES_mozilla) mozilla/vlcintf.idl
590
591 BUILT_SOURCES += $(BUILT_SOURCES_mozilla)
592
593 SOURCES_mozilla = \
594         mozilla/vlcshell.cpp \
595         mozilla/vlcplugin.cpp \
596         mozilla/vlcplugin.h \
597         mozilla/vlcpeer.cpp \
598         mozilla/vlcpeer.h \
599         mozilla/classinfo.h \
600         $(SOURCES_mozilla_win32) \
601         $(SOURCES_mozilla_unix) \
602         $(NULL)
603
604 # Under Win32, Mozilla plugins need to be named NP******.DLL, but under Unix
605 # the common naming scheme is lib******plugin.so. Also, we need npwin.cpp
606 # under Win32 and npunix.c under Unix.
607 if HAVE_WIN32
608 LIBRARIES_mozilla = mozilla/npvlc$(LIBEXT)
609 SOURCES_mozilla_win32 = mozilla/npwin.cpp
610 CPPFLAGS_mozilla_EXTRA = -DXP_WIN -DXP_WIN32
611 else
612 LIBRARIES_mozilla = mozilla/libvlcplugin$(LIBEXT)
613 SOURCES_mozilla_unix = mozilla/npunix.c
614 endif
615
616 if BUILD_MOZILLA
617 if UNTRUE
618 noinst_LIBRARIES_mozilla = mozilla/libplugin.a
619 endif
620
621 mozilla_libplugin_a_SOURCES = $(SOURCES_mozilla)
622 mozilla_libplugin_a_CFLAGS = $(CPPFLAGS_pic) $(CFLAGS_pic) \
623                              $(CPPFLAGS_mozilla) $(CFLAGS_mozilla) \
624                              $(CPPFLAGS_mozilla_EXTRA)
625 mozilla_libplugin_a_CXXFLAGS = $(CPPFLAGS_pic) $(CXXFLAGS_pic) \
626                                $(CPPFLAGS_mozilla) $(CXXFLAGS_mozilla) \
627                                $(CPPFLAGS_mozilla_EXTRA)
628 mozilla_libplugin_a_DEPENDENCIES = lib/libvlc_pic.a $(L_builtin_pic) $(DATA_npvlc_rc)
629
630 BUILT_SOURCES_mozilla = mozilla/vlcintf.h
631 $(SOURCES_mozilla): mozilla/vlcintf.h
632
633 mozilla_plugin_DATA = $(LIBRARIES_mozilla)
634 mozilla_plugindir = $(libdir)/mozilla/plugins
635 $(LIBRARIES_mozilla): $(mozilla_libplugin_a_OBJECTS) \
636                       $(mozilla_libplugin_a_DEPENDENCIES) \
637                       $(L_builtin_pic)
638         $(CXXLINK) $(mozilla_libplugin_a_OBJECTS) $(DATA_npvlc_rc) \
639                 lib/libvlc_pic.a $(L_builtin_pic) -shared $(LDFLAGS) \
640                 $(LDFLAGS_vlc) $(LDFLAGS_mozilla) $(LDFLAGS_builtin_pic)
641
642 mozilla_vlcintf_xpt_DATA = mozilla/vlcintf.xpt
643 mozilla_vlcintf_xptdir = $(libdir)/mozilla/components
644 mozilla/vlcintf.xpt: Makefile mozilla/vlcintf.idl
645         $(XPIDL) -I/usr/share/idl/mozilla -m typelib \
646                 -o mozilla/vlcintf mozilla/vlcintf.idl
647
648 mozilla/vlcintf.h: Makefile mozilla/vlcintf.idl
649         $(XPIDL) -I/usr/share/idl/mozilla -m header \
650                 -o mozilla/vlcintf mozilla/vlcintf.idl
651
652 if HAVE_WIN32
653 DATA_npvlc_rc = $(noinst_mozilla_npvlc_rc_DATA)
654 noinst_mozilla_npvlc_rc_DATA = mozilla/npvlc_rc.$(OBJEXT)
655 noinst_mozilla_npvlc_rcdir = $(libdir)
656 mozilla/npvlc_rc.$(OBJEXT): mozilla/npvlc_rc.rc
657         $(WINDRES) --include-dir mozilla -i $< -o $@
658 endif
659 endif
660
661 ###############################################################################
662 # Modules
663 ###############################################################################
664 MOSTLYCLEANFILES += $(PLUGIN_FILES)
665 PLUGIN_FILES =
666
667 libvlcdir = $(libdir)/vlc
668
669 include Modules.am
670
671 ###############################################################################
672 # Force rule
673 ###############################################################################
674 FORCE: