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