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