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