]> git.sesse.net Git - vlc/blob - Makefile.am
b2a111b221c75faccb4ddc23b3f4dc45691e53df
[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/intf_eject.h \
184         include/iso_lang.h \
185         include/httpd.h \
186         include/main.h \
187         include/mmx.h \
188         include/modules.h \
189         include/modules_inner.h \
190         include/mtime.h \
191         include/network.h \
192         include/os_specific.h \
193         include/stream_control.h \
194         include/stream_output.h \
195         include/announce.h \
196         include/variables.h \
197         include/video_output.h \
198         include/vlc_common.h \
199         include/vlc_config.h \
200         include/vlc_cpu.h \
201         include/vlc_interface.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/vlc_video.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 if HAVE_BEOS
466         $(CXXLINK) $(vlc_LDFLAGS) $(vlc_OBJECTS) $(vlc_LDADD) $(LIBS)
467 else
468 if HAVE_DARWIN
469         $(CXXLINK) $(vlc_LDFLAGS) $(vlc_OBJECTS) $(vlc_LDADD) $(LIBS)
470 else
471         $(LINK) $(vlc_LDFLAGS) $(vlc_OBJECTS) $(vlc_LDADD) $(LIBS)
472 endif
473 endif
474
475 if HAVE_BEOS
476         xres -o $@ $(srcdir)/share/vlc_beos.rsrc
477         mimeset -f $@
478         rm -Rf $(srcdir)/locale ; mkdir $(srcdir)/locale
479         for i in $(ALL_LINGUAS); do \
480                 mkdir -p $(srcdir)/locale/$${i}/LC_MESSAGES ; \
481                 cp $(srcdir)/po/$${i}.gmo \
482                         $(srcdir)/locale/$${i}/LC_MESSAGES/vlc.mo || true ; \
483         done
484 endif
485
486 # Install the symlinks
487 install-exec-local:
488         for i in dummy $(ALIASES) ; do if test "x$$i" != "xdummy" ; then \
489                 rm -f $(DESTDIR)$(bindir)/$$i && \
490                 ln -s vlc $(DESTDIR)$(bindir)/$$i ; \
491         fi ; done
492
493 if HAVE_DARWIN
494 # Create the MacOS X app
495 vlc_app_DATA = VLC.app
496 vlc_appdir = $(bindir)
497 VLC.app: vlc $(PLUGIN_FILES)
498         rm -Rf VLC.app
499         cd $(srcdir)/extras/MacOSX && pbxbuild -target vlc | grep -v '^\([ \t]\|$$\)'
500         cp -r $(srcdir)/extras/MacOSX/build/vlc.bundle $(srcdir)/VLC.app
501         $(INSTALL) -d $(srcdir)/VLC.app/Contents/MacOS
502         $(INSTALL) vlc $(srcdir)/VLC.app/Contents/MacOS/VLC
503         $(INSTALL) -d $(srcdir)/VLC.app/Contents/MacOS/modules
504         for i in dummy $(PLUGIN_FILES) ; do if test "x$$i" != "xdummy" ; then \
505                 $(INSTALL) $(srcdir)/$$i \
506                         $(srcdir)/VLC.app/Contents/MacOS/modules/ ; \
507         fi ; done
508         $(INSTALL) -d $(srcdir)/VLC.app/Contents/MacOS/share
509         $(INSTALL) -m 644 $(srcdir)/share/*.psf $(srcdir)/share/*.rle \
510                 $(srcdir)/VLC.app/Contents/MacOS/share
511         $(INSTALL) -d $(srcdir)/VLC.app/Contents/MacOS/locale
512         for i in $(ALL_LINGUAS); do \
513                 mkdir -p $(srcdir)/VLC.app/Contents/MacOS/locale/$${i}/LC_MESSAGES ; \
514                 cp $(srcdir)/po/$${i}.gmo $(srcdir)/VLC.app/Contents/MacOS/locale/$${i}/LC_MESSAGES/vlc.mo || true ; \
515                 mkdir -p $(srcdir)/VLC.app/Contents/Resources/$${i}.lproj ; \
516                 ln -sf ../English.lproj/InfoPlist.strings $(srcdir)/VLC.app/Contents/Resources/$${i}.lproj ; \
517                 ln -sf ../English.lproj/MainMenu.nib $(srcdir)/VLC.app/Contents/Resources/$${i}.lproj ; \
518                 ln -sf ../English.lproj/vlc.scriptTerminology $(srcdir)/VLC.app/Contents/Resources/$${i}.lproj ; \
519         done
520         printf "APPLVLC#" >| $(srcdir)/VLC.app/Contents/PkgInfo
521 endif
522
523 if HAVE_WIN32
524 DATA_win32_rc = $(noinst_share_vlc_win32_rc_DATA)
525 noinst_share_vlc_win32_rc_DATA = share/vlc_win32_rc.$(OBJEXT)
526 noinst_share_vlc_win32_rcdir = $(libdir)
527 share/vlc_win32_rc.$(OBJEXT): share/vlc_win32_rc.rc
528         $(WINDRES) --include-dir $(srcdir)/share -i $< -o $@
529 endif
530
531 ###############################################################################
532 # Building architecture-specific binary packages
533 ###############################################################################
534
535 # XXX: this rule is probably only useful to you if you have exactly
536 # the same setup as me. Contact sam@zoy.org if you need to use it.
537 #
538 # Check that tmp isn't in the way
539 package-win32:
540         @if test -e $(srcdir)/tmp; then \
541                 echo "Error: please remove $(srcdir)/tmp, it is in the way"; \
542                 false; \
543         else \
544                 echo "OK."; mkdir $(srcdir)/tmp; \
545         fi
546 # Create installation script
547         cp $(srcdir)/install-win32 $(srcdir)/tmp/nsi
548 # Copy relevant files
549         cp $(srcdir)/vlc$(EXEEXT) $(srcdir)/tmp/ 
550         $(STRIP) $(srcdir)/tmp/vlc$(EXEEXT)
551         cp $(srcdir)/INSTALL.win32 $(srcdir)/tmp/INSTALL.txt
552         unix2dos $(srcdir)/tmp/INSTALL.txt
553         for file in AUTHORS MAINTAINERS THANKS NEWS COPYING README ; \
554                 do cp $(srcdir)/$$file $(srcdir)/tmp/$${file}.txt ; \
555                 unix2dos $(srcdir)/tmp/$${file}.txt ; done
556
557         mkdir $(srcdir)/tmp/plugins
558         for i in dummy $(PLUGIN_FILES) ; do if test "x$$i" != "xdummy" ; then \
559                 $(INSTALL) $(srcdir)/$$i $(srcdir)/tmp/plugins/ ; \
560         fi ; done
561
562         for i in dummy $(srcdir)/tmp/plugins/*$(LIBEXT) ; \
563                 do if test $$i != dummy ; then $(STRIP) $$i ; fi ; done
564
565         mkdir $(srcdir)/tmp/share
566         cp $(srcdir)/share/*.rle $(srcdir)/tmp/share/ ;
567
568         mkdir $(srcdir)/tmp/locale
569         for i in $(ALL_LINGUAS); do \
570                 mkdir -p $(srcdir)/tmp/locale/$${i}/LC_MESSAGES ; \
571                 cp $(srcdir)/po/$${i}.gmo \
572                    $(srcdir)/tmp/locale/$${i}/LC_MESSAGES/vlc.mo || true ; \
573         done
574
575         mkdir -p $(srcdir)/tmp/skins/default
576         for i in $(srcdir)/share/skins/default/*.*; do \
577                 cp $$i $(srcdir)/tmp/skins/default/ || true ; \
578         done
579         for i in $(srcdir)/doc/skins/*.txt; do \
580                 cp $$i $(srcdir)/tmp/skins/ || true ; \
581         done
582
583 # Create package 
584         wine ~/.wine/fake_windows/Program\ Files/NSIS/makensis.exe -- /DVERSION=${VERSION} $(srcdir)/tmp/nsi
585 # Clean up
586         rm -Rf $(srcdir)/tmp
587
588 package-beos:
589 # Check that tmp isn't in the way
590         @if test -e $(srcdir)/tmp; then \
591                 echo "Error: please remove $(srcdir)/tmp, it is in the way"; \
592                 false; \
593         else \
594                 echo "OK."; mkdir $(srcdir)/tmp; \
595         fi
596
597 # Copy relevant files
598         mkdir -p $(srcdir)/tmp/vlc
599         cd $(srcdir) && \
600                 cp vlc AUTHORS COPYING ChangeLog README THANKS NEWS tmp/vlc/
601 # We cannot use ${PLUGIN_FILES}, it looks like it is too long for the BeOS shell...
602         if [ `find $(srcdir)/modules -name "lib*_plugin.so" | wc -l` -gt 0 ]; then \
603                 mkdir -p $(srcdir)/tmp/vlc/plugins; \
604                 find $(srcdir)/modules -name "lib*_plugin.so" | xargs -i{} cp {} $(srcdir)/tmp/vlc/plugins/; \
605         fi
606         for i in $(ALL_LINGUAS); do \
607                 mkdir -p $(srcdir)/tmp/vlc/locale/$${i}/LC_MESSAGES ; \
608                 cp $(srcdir)/po/$${i}.gmo $(srcdir)/tmp/vlc/locale/$${i}/LC_MESSAGES/vlc.mo || true ; \
609         done
610         mkdir -p $(srcdir)/tmp/vlc/share
611         cp $(srcdir)/share/*.rle $(srcdir)/tmp/vlc/share/
612
613 # Create package with debug symbols
614         mimeset -f $(srcdir)/tmp/vlc/* $(srcdir)/tmp/vlc/*/*
615         mv $(srcdir)/tmp/vlc $(srcdir)/tmp/vlc-${VERSION}
616         (cd $(srcdir)/tmp ; zip -9 -r vlc-${VERSION}-BeOS-debug.zip vlc-${VERSION} )
617         mv $(srcdir)/tmp/vlc-${VERSION}-BeOS-debug.zip $(srcdir)/
618
619 # Create package without debug symbols
620         strip $(srcdir)/tmp/vlc-${VERSION}/vlc
621         if [ -d $(srcdir)/tmp/vlc-${VERSION}/plugins ]; then \
622                 strip $(srcdir)/tmp/vlc-${VERSION}/plugins/lib*_plugin.so; \
623         fi
624         xres -o $(srcdir)/tmp/vlc-${VERSION}/vlc $(srcdir)/share/vlc_beos.rsrc
625         mimeset -f $(srcdir)/tmp/vlc-${VERSION}/* $(srcdir)/tmp/vlc-${VERSION}/*/*
626         (cd $(srcdir)/tmp ; zip -9 -r vlc-${VERSION}-BeOS.zip vlc-${VERSION} )
627         mv $(srcdir)/tmp/vlc-${VERSION}-BeOS.zip $(srcdir)/
628
629 # Clean up
630         rm -Rf $(srcdir)/tmp
631
632 package-macosx:
633 # Check that tmp isn't in the way
634         @if test -e $(srcdir)/tmp; then \
635                 echo "Error: please remove $(srcdir)/tmp, it is in the way"; \
636                 false; \
637         else \
638                 echo "OK."; mkdir $(srcdir)/tmp; \
639         fi
640
641 # Copy relevant files 
642         cp -R $(srcdir)/VLC.app $(srcdir)/tmp/
643         cd $(srcdir) && cp AUTHORS COPYING ChangeLog README README.MacOSX.rtf THANKS NEWS tmp/
644
645 # Create disk image 
646         $(srcdir)/extras/MacOSX/macosx-dmg 18 "vlc-${VERSION}" $(srcdir)/tmp/* 
647
648 # Clean up
649         rm -Rf $(srcdir)/tmp
650
651 ###############################################################################
652 # Building the Mozilla plugin
653 ###############################################################################
654
655 noinst_LIBRARIES += $(noinst_LIBRARIES_mozilla)
656
657 MOSTLYCLEANFILES += $(LIBRARIES_mozilla)
658
659 EXTRA_DIST += $(SOURCES_mozilla) mozilla/vlcintf.idl
660
661 BUILT_SOURCES += $(BUILT_SOURCES_mozilla)
662
663 SOURCES_mozilla = \
664         mozilla/vlcshell.cpp \
665         mozilla/vlcplugin.cpp \
666         mozilla/vlcplugin.h \
667         mozilla/vlcpeer.cpp \
668         mozilla/vlcpeer.h \
669         mozilla/support/classinfo.h \
670         $(SOURCES_mozilla_win32) \
671         $(SOURCES_mozilla_macosx) \
672         $(SOURCES_mozilla_unix) \
673         $(NULL)
674
675 # Under Win32, Mozilla plugins need to be named NP******.DLL, but under Unix
676 # the common naming scheme is lib******plugin.so. Also, we need npwin.cpp
677 # under Win32 and npunix.c under Unix.
678 if HAVE_WIN32
679 LIBRARIES_mozilla = mozilla/npvlc$(LIBEXT)
680 SOURCES_mozilla_win32 = mozilla/support/npwin.cpp
681 CPPFLAGS_mozilla_EXTRA = -DXP_WIN -DXP_WIN32
682 else
683 if HAVE_DARWIN
684 # We don't define LIBRARIES_mozilla because we'll be using project builder
685 SOURCES_mozilla_macosx = mozilla/support/npmac.cpp
686 else
687 LIBRARIES_mozilla = mozilla/libvlcplugin$(LIBEXT)
688 SOURCES_mozilla_unix = mozilla/support/npunix.c
689 endif
690 endif
691
692 if BUILD_MOZILLA
693 if UNTRUE
694 noinst_LIBRARIES_mozilla = mozilla/libplugin.a
695 endif
696
697 mozilla_libplugin_a_SOURCES = $(SOURCES_mozilla)
698 mozilla_libplugin_a_CFLAGS = $(CPPFLAGS_pic) $(CFLAGS_pic) \
699                              $(CPPFLAGS_mozilla) $(CFLAGS_mozilla) \
700                              $(CPPFLAGS_mozilla_EXTRA)
701 mozilla_libplugin_a_CXXFLAGS = $(CPPFLAGS_pic) $(CXXFLAGS_pic) \
702                                $(CPPFLAGS_mozilla) $(CXXFLAGS_mozilla) \
703                                $(CPPFLAGS_mozilla_EXTRA)
704 mozilla_libplugin_a_DEPENDENCIES = lib/libvlc_pic.a $(L_builtin_pic) $(DATA_npvlc_rc)
705
706 BUILT_SOURCES_mozilla = mozilla/vlcintf.h
707 $(SOURCES_mozilla): mozilla/vlcintf.h
708
709 mozilla_plugin_DATA = $(LIBRARIES_mozilla)
710 mozilla_plugindir = $(libdir)/mozilla/plugins
711 $(LIBRARIES_mozilla): $(mozilla_libplugin_a_OBJECTS) \
712                       $(mozilla_libplugin_a_DEPENDENCIES) \
713                       $(L_builtin_pic)
714         $(CXXLINK) $(mozilla_libplugin_a_OBJECTS) $(DATA_npvlc_rc) \
715                 lib/libvlc_pic.a $(L_builtin_pic) -shared $(LDFLAGS) \
716                 $(LDFLAGS_vlc) $(LDFLAGS_mozilla) $(LDFLAGS_builtin_pic)
717
718 mozilla_vlcintf_xpt_DATA = mozilla/vlcintf.xpt
719 mozilla_vlcintf_xptdir = $(libdir)/mozilla/components
720 mozilla/vlcintf.xpt: Makefile mozilla/vlcintf.idl
721         $(XPIDL) -I/usr/share/idl/mozilla -m typelib \
722                 -o mozilla/vlcintf mozilla/vlcintf.idl
723
724 mozilla/vlcintf.h: Makefile mozilla/vlcintf.idl
725         $(XPIDL) -I/usr/share/idl/mozilla -m header \
726                 -o mozilla/vlcintf mozilla/vlcintf.idl
727
728 if HAVE_WIN32
729 DATA_npvlc_rc = $(noinst_mozilla_npvlc_rc_DATA)
730 noinst_mozilla_npvlc_rc_DATA = mozilla/npvlc_rc.$(OBJEXT)
731 noinst_mozilla_npvlc_rcdir = $(libdir)
732 mozilla/npvlc_rc.$(OBJEXT): mozilla/npvlc_rc.rc
733         $(WINDRES) --include-dir $(srcdir)/mozilla -i $< -o $@
734 endif
735 endif
736
737 ###############################################################################
738 # Modules
739 ###############################################################################
740 MOSTLYCLEANFILES += $(PLUGIN_FILES)
741 PLUGIN_FILES =
742
743 libvlcdir = $(libdir)/vlc
744
745 include Modules.am
746
747 ###############################################################################
748 # Force rule
749 ###############################################################################
750 FORCE: