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