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