* ./Makefile.am: fixed LDFLAGS when using --enable-gprof.
[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 = $(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 = $(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 = -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/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         ./toolbox --update-includes $(BUILTINS)
219
220 src/misc/modules_plugin.h: Makefile src/misc/modules_plugin.h.in $(HEADERS_include)
221         ./toolbox --update-includes $(BUILTINS)
222
223 src/misc/modules_builtin.h: Makefile src/misc/modules_builtin.h.in
224         ./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 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 show-libvlc-sources: FORCE
319         @echo X: $(SOURCES_libvlc_common) $(SOURCES_libvlc_win32) $(SOURCES_libvlc_dirent) $(SOURCES_libvlc_getopt)
320
321 show-libvlc-headers: FORCE
322         @echo X: $(HEADERS_include) $(HEADERS_include_built)
323
324 show-libvlc-pkg-headers: FORCE
325         @echo X: $(dist_pkginclude_HEADERS)
326
327 dist-hook:
328         mv vlc.ebuild vlc-${VERSION}.ebuild
329         cd $(distdir); ./toolbox --update-vc
330
331 ###############################################################################
332 # Building libvlc
333 ###############################################################################
334
335 bin_SCRIPTS = vlc-config
336
337 lib_LIBRARIES += lib/libvlc.a $(LIBRARIES_libvlc_pic)
338
339 lib_libvlc_a_SOURCES = $(SOURCES_libvlc)
340 dist_lib_libvlc_a_SOURCES = src/misc/modules_plugin.h
341 lib_libvlc_a_CFLAGS = $(CPPFLAGS_default) -D__VLC__ $(CFLAGS_default) @CFLAGS_vlc@
342 lib_libvlc_a_CXXFLAGS = $(CPPFLAGS_default) -D__VLC__ $(CXXFLAGS_default)
343 lib_libvlc_a_OBJCFLAGS = $(CPPFLAGS_default) -D__VLC__ $(OBJCFLAGS_default)
344
345 lib_libvlc_pic_a_SOURCES = $(SOURCES_libvlc)
346 lib_libvlc_pic_a_CFLAGS = $(CPPFLAGS_pic) -D__VLC__ $(CFLAGS_pic) @CFLAGS_vlc@
347 lib_libvlc_pic_a_CXXFLAGS = $(CPPFLAGS_pic) -D__VLC__ $(CXXFLAGS_pic)
348 lib_libvlc_pic_a_OBJCFLAGS = $(CPPFLAGS_pic) -D__VLC__ $(OBJCFLAGS_pic)
349
350 if HAVE_BEOS
351 OPT_SOURCES_libvlc_beos = $(SOURCES_libvlc_beos)
352 endif
353 if HAVE_DARWIN
354 OPT_SOURCES_libvlc_darwin = $(SOURCES_libvlc_darwin)
355 endif
356 if HAVE_WIN32
357 OPT_SOURCES_libvlc_win32 = $(SOURCES_libvlc_win32)
358 endif
359 if BUILD_DIRENT
360 OPT_SOURCES_libvlc_dirent = $(SOURCES_libvlc_dirent)
361 endif
362 if BUILD_GETOPT
363 OPT_SOURCES_libvlc_getopt = $(SOURCES_libvlc_getopt)
364 endif
365 if BUILD_MOZILLA
366 LIBRARIES_libvlc_pic = lib/libvlc_pic.a
367 endif
368
369 EXTRA_DIST += \
370         $(SOURCES_libvlc_beos) \
371         $(SOURCES_libvlc_darwin) \
372         $(SOURCES_libvlc_win32) \
373         $(SOURCES_libvlc_dirent) \
374         $(SOURCES_libvlc_getopt) \
375         $(NULL)
376
377 SOURCES_libvlc_beos = \
378         src/misc/beos_specific.cpp \
379         $(NULL)
380
381 SOURCES_libvlc_darwin = \
382         src/misc/darwin_specific.m \
383         $(NULL)
384
385 SOURCES_libvlc_win32 = \
386         src/misc/win32_specific.c \
387         $(NULL)
388
389 SOURCES_libvlc_dirent = \
390         src/extras/dirent.c \
391         src/extras/dirent.h \
392         $(NULL)
393
394 SOURCES_libvlc_getopt = \
395         src/extras/getopt.c \
396         src/extras/getopt.h \
397         src/extras/getopt1.c \
398         $(NULL)
399
400 SOURCES_libvlc_common = \
401         src/libvlc.c \
402         src/libvlc.h \
403         src/interface/interface.c \
404         src/interface/intf_eject.c \
405         src/playlist/playlist.c \
406         src/input/input.c \
407         src/input/input_ext-plugins.c \
408         src/input/input_ext-dec.c \
409         src/input/input_ext-intf.c \
410         src/input/input_dec.c \
411         src/input/input_programs.c \
412         src/input/input_clock.c \
413         src/input/input_info.c \
414         src/video_output/video_output.c \
415         src/video_output/vout_pictures.c \
416         src/video_output/vout_pictures.h \
417         src/video_output/video_text.c \
418         src/video_output/video_text.h \
419         src/video_output/vout_subpictures.c \
420         src/video_output/vout_synchro.c \
421         src/audio_output/common.c \
422         src/audio_output/dec.c \
423         src/audio_output/filters.c \
424         src/audio_output/input.c \
425         src/audio_output/mixer.c \
426         src/audio_output/output.c \
427         src/audio_output/intf.c \
428         src/stream_output/stream_output.c \
429         src/misc/mtime.c \
430         src/misc/modules.c \
431         src/misc/threads.c \
432         src/misc/cpu.c \
433         src/misc/configuration.c \
434         src/misc/iso_lang.c \
435         src/misc/iso-639_def.h \
436         src/misc/messages.c \
437         src/misc/objects.c \
438         src/misc/variables.c \
439         src/misc/error.c \
440         src/extras/libc.c \
441         $(NULL)
442
443 SOURCES_libvlc = \
444         $(SOURCES_libvlc_common) \
445         $(OPT_SOURCES_libvlc_beos) \
446         $(OPT_SOURCES_libvlc_darwin) \
447         $(OPT_SOURCES_libvlc_win32) \
448         $(OPT_SOURCES_libvlc_dirent) \
449         $(OPT_SOURCES_libvlc_getopt) \
450         $(NULL)
451
452 ###############################################################################
453 # Building vlc
454 ###############################################################################
455
456 bin_PROGRAMS += vlc
457
458 vlc_SOURCES = src/vlc.c
459
460 # @AUTOMAKE_SUCKS@ gets expanded to $(L_builtin) $(LDFLAGS_builtin)
461 # but we don't write it directly, otherwise automake will go amok and eat all
462 # the memory because of its 2^N crap algorithm. So we fool him. Nuahaha.
463 vlc_LDADD = lib/libvlc.a $(LDFLAGS_vlc) \
464             $(DATA_win32_rc) $(LIB_intl) @AUTOMAKE_SUCKS@
465 vlc_CFLAGS = $(CPPFLAGS_default) $(CFLAGS_default)
466
467 # We use DEPENDENCIES_vlc instead of vlc_DEPENDENCIES because of an
468 # old automake-1.5 bug (automake/279).
469 DEPENDENCIES_vlc = lib/libvlc.a $(L_builtin) $(DATA_win32_rc) $(LIB_intl)
470
471 vlc$(EXEEXT): $(vlc_OBJECTS) $(DEPENDENCIES_vlc)
472         @rm -f vlc$(EXEEXT)
473         $(LINK) $(vlc_LDFLAGS) $(vlc_OBJECTS) $(vlc_LDADD) $(LIBS)
474
475 if HAVE_BEOS
476         xres -o $@ ./share/vlc_beos.rsrc
477         mimeset -f $@
478         rm -Rf locale ; mkdir locale
479         for i in $(ALL_LINGUAS); do \
480                 mkdir -p locale/$${i}/LC_MESSAGES ; \
481                 cp po/$${i}.gmo locale/$${i}/LC_MESSAGES/vlc.mo || true ; \
482         done
483 endif
484
485 # Install the symlinks
486 install-exec-local:
487         for i in dummy $(ALIASES) ; do if test "x$$i" != "xdummy" ; then \
488                 rm -f $(DESTDIR)$(bindir)/$$i && \
489                 ln -s vlc $(DESTDIR)$(bindir)/$$i ; \
490         fi ; done
491
492 if HAVE_DARWIN
493 # Create the MacOS X app
494 vlc_app_DATA = VLC.app
495 vlc_appdir = $(bindir)
496 VLC.app: vlc $(PLUGIN_FILES)
497         rm -Rf VLC.app
498         cd extras/MacOSX ; pbxbuild -target vlc | grep -v '^\([ \t]\|$$\)'
499         cp -r extras/MacOSX/build/vlc.bundle ./VLC.app
500         $(INSTALL) -d VLC.app/Contents/MacOS
501         $(INSTALL) vlc VLC.app/Contents/MacOS/VLC
502         $(INSTALL) -d VLC.app/Contents/MacOS/modules
503         for i in dummy $(PLUGIN_FILES) ; do if test "x$$i" != "xdummy" ; then \
504                 $(INSTALL) $$i VLC.app/Contents/MacOS/modules/ ; \
505         fi ; done
506         $(INSTALL) -d VLC.app/Contents/MacOS/share
507         $(INSTALL) -m 644 share/*.psf share/*.rle VLC.app/Contents/MacOS/share
508         $(INSTALL) -d VLC.app/Contents/MacOS/locale
509         for i in $(ALL_LINGUAS); do \
510                 mkdir -p VLC.app/Contents/MacOS/locale/$${i}/LC_MESSAGES ; \
511                 cp po/$${i}.gmo VLC.app/Contents/MacOS/locale/$${i}/LC_MESSAGES/vlc.mo || true ; \
512                 mkdir -p VLC.app/Contents/Resources/$${i}.lproj ; \
513                 ln -sf ../English.lproj/InfoPlist.strings VLC.app/Contents/Resources/$${i}.lproj ; \
514                 ln -sf ../English.lproj/MainMenu.nib VLC.app/Contents/Resources/$${i}.lproj ; \
515                 ln -sf ../English.lproj/vlc.scriptTerminology VLC.app/Contents/Resources/$${i}.lproj ; \
516         done
517         echo -n "APPLVLC#" >| VLC.app/Contents/PkgInfo
518 endif
519
520 if HAVE_WIN32
521 DATA_win32_rc = $(noinst_share_vlc_win32_rc_DATA)
522 noinst_share_vlc_win32_rc_DATA = share/vlc_win32_rc.$(OBJEXT)
523 noinst_share_vlc_win32_rcdir = $(libdir)
524 share/vlc_win32_rc.$(OBJEXT): share/vlc_win32_rc.rc
525         $(WINDRES) --include-dir share -i $< -o $@
526 endif
527
528 ###############################################################################
529 # Building architecture-specific binary packages
530 ###############################################################################
531
532 # XXX: this rule is probably only useful to you if you have exactly
533 # the same setup as me. Contact sam@zoy.org if you need to use it.
534 #
535 # Check that tmp isn't in the way
536 package-win32:
537         @if test -e tmp; then \
538                 echo "Error: please remove ./tmp, it is in the way"; false; \
539         else \
540                 echo "OK."; mkdir tmp; \
541         fi
542 # Create installation script
543         cp install-win32 tmp/nsi
544 # Copy relevant files
545         cp vlc$(EXEEXT) tmp/ 
546         $(STRIP) tmp/vlc$(EXEEXT)
547         cp INSTALL.win32 tmp/INSTALL.txt ; unix2dos tmp/INSTALL.txt
548         for file in AUTHORS MAINTAINERS THANKS NEWS COPYING README ; \
549                         do cp $$file tmp/$${file}.txt ; \
550                         unix2dos tmp/$${file}.txt ; done
551
552         mkdir tmp/plugins
553         for i in dummy $(PLUGIN_FILES) ; do if test "x$$i" != "xdummy" ; then \
554                 $(INSTALL) $$i tmp/plugins/ ; \
555         fi ; done
556
557         for i in dummy tmp/plugins/*$(LIBEXT) ; \
558                 do if test $$i != tmp/plugins/libwin32_plugin$(LIBEXT) \
559                 -a $$i != dummy ; then $(STRIP) $$i ; fi ; done
560
561         mkdir tmp/share
562         cp share/*.rle tmp/share/ ;
563
564         mkdir tmp/locale
565         for i in $(ALL_LINGUAS); do \
566                 mkdir -p tmp/locale/$${i}/LC_MESSAGES ; \
567                 cp po/$${i}.gmo tmp/locale/$${i}/LC_MESSAGES/vlc.mo || true ; \
568         done
569
570         mkdir -p tmp/skins/default
571         for i in share/skins/default/*.*; do \
572                 cp $$i tmp/skins/default/ || true ; \
573         done
574         for i in doc/skins/*.txt; do \
575                 cp $$i tmp/skins/ || true ; \
576         done
577
578         cd doc/faq ; $(MAKE) html ; cd ../.. ;
579         cp doc/faq/index.html tmp/FAQ.htm ;
580
581 # Create package 
582         wine ~/.wine/fake_windows/Program\ Files/NSIS/makensis.exe -- /DVERSION=${VERSION} tmp/nsi
583 # Clean up
584         rm -Rf tmp
585
586 package-beos:
587 # Check that tmp isn't in the way
588         @if test -e tmp; then \
589                 echo "Error: please remove ./tmp, it is in the way"; false; \
590         else \
591                 echo "OK."; mkdir tmp; \
592         fi
593
594 # Copy relevant files
595         mkdir -p tmp/vlc
596         cp vlc AUTHORS COPYING ChangeLog README THANKS NEWS tmp/vlc/
597 # We cannot use ${PLUGIN_FILES}, it looks like it is too long for the BeOS shell...
598         if [ `find modules -name "lib*_plugin.so" | wc -l` -gt 0 ]; then \
599                 mkdir -p tmp/vlc/plugins; \
600                 find modules -name "lib*_plugin.so" | xargs -i{} cp {} tmp/vlc/plugins/; \
601         fi
602         for i in $(ALL_LINGUAS); do \
603                 mkdir -p tmp/vlc/locale/$${i}/LC_MESSAGES ; \
604                 cp po/$${i}.gmo tmp/vlc/locale/$${i}/LC_MESSAGES/vlc.mo || true ; \
605         done
606         mkdir -p tmp/vlc/share
607         cp share/*.rle tmp/vlc/share/
608
609 # Create package with debug symbols
610         mimeset -f tmp/vlc/* tmp/vlc/*/*
611         mv tmp/vlc tmp/vlc-${VERSION}
612         (cd tmp ; zip -9 -r vlc-${VERSION}-BeOS.zip vlc-${VERSION} )
613         mv tmp/vlc-${VERSION}-BeOS.zip .
614
615 # Create package without debug symbols
616         strip tmp/vlc-${VERSION}/vlc
617         if [ -d tmp/vlc-${VERSION}/plugins ]; then \
618                 strip tmp/vlc-${VERSION}/plugins/lib*_plugin.so; \
619         fi
620         xres -o tmp/vlc-${VERSION}/vlc share/vlc_beos.rsrc
621         mimeset -f tmp/vlc-${VERSION}/* tmp/vlc-${VERSION}/*/*
622         (cd tmp ; zip -9 -r vlc-${VERSION}-BeOS-stripped.zip vlc-${VERSION} )
623         mv tmp/vlc-${VERSION}-BeOS-stripped.zip .
624
625 # Clean up
626         rm -Rf tmp
627
628 package-macosx:
629 # Check that tmp isn't in the way
630         @if test -e tmp; then \
631                 echo "Error: please remove ./tmp, it is in the way"; false; \
632         else \
633                 echo "OK."; mkdir tmp; \
634         fi
635
636 # Copy relevant files 
637         cp -R VLC.app tmp/
638         cp AUTHORS COPYING ChangeLog README README.MacOSX.rtf THANKS NEWS tmp/
639
640 # Create disk image 
641         ./extras/MacOSX/macosx-dmg 18 "vlc-${VERSION}" tmp/* 
642
643 # Clean up
644         rm -Rf tmp
645
646 ###############################################################################
647 # Building the Mozilla plugin
648 ###############################################################################
649
650 noinst_LIBRARIES += $(noinst_LIBRARIES_mozilla)
651
652 MOSTLYCLEANFILES += $(LIBRARIES_mozilla)
653
654 EXTRA_DIST += $(SOURCES_mozilla) mozilla/vlcintf.idl
655
656 BUILT_SOURCES += $(BUILT_SOURCES_mozilla)
657
658 SOURCES_mozilla = \
659         mozilla/vlcshell.cpp \
660         mozilla/vlcplugin.cpp \
661         mozilla/vlcplugin.h \
662         mozilla/vlcpeer.cpp \
663         mozilla/vlcpeer.h \
664         mozilla/support/classinfo.h \
665         $(SOURCES_mozilla_win32) \
666         $(SOURCES_mozilla_macosx) \
667         $(SOURCES_mozilla_unix) \
668         $(NULL)
669
670 # Under Win32, Mozilla plugins need to be named NP******.DLL, but under Unix
671 # the common naming scheme is lib******plugin.so. Also, we need npwin.cpp
672 # under Win32 and npunix.c under Unix.
673 if HAVE_WIN32
674 LIBRARIES_mozilla = mozilla/npvlc$(LIBEXT)
675 SOURCES_mozilla_win32 = mozilla/support/npwin.cpp
676 CPPFLAGS_mozilla_EXTRA = -DXP_WIN -DXP_WIN32
677 else
678 if HAVE_DARWIN
679 # We don't define LIBRARIES_mozilla because we'll be using project builder
680 SOURCES_mozilla_macosx = mozilla/support/npmac.cpp
681 else
682 LIBRARIES_mozilla = mozilla/libvlcplugin$(LIBEXT)
683 SOURCES_mozilla_unix = mozilla/support/npunix.c
684 endif
685 endif
686
687 if BUILD_MOZILLA
688 if UNTRUE
689 noinst_LIBRARIES_mozilla = mozilla/libplugin.a
690 endif
691
692 mozilla_libplugin_a_SOURCES = $(SOURCES_mozilla)
693 mozilla_libplugin_a_CFLAGS = $(CPPFLAGS_pic) $(CFLAGS_pic) \
694                              $(CPPFLAGS_mozilla) $(CFLAGS_mozilla) \
695                              $(CPPFLAGS_mozilla_EXTRA)
696 mozilla_libplugin_a_CXXFLAGS = $(CPPFLAGS_pic) $(CXXFLAGS_pic) \
697                                $(CPPFLAGS_mozilla) $(CXXFLAGS_mozilla) \
698                                $(CPPFLAGS_mozilla_EXTRA)
699 mozilla_libplugin_a_DEPENDENCIES = lib/libvlc_pic.a $(L_builtin_pic) $(DATA_npvlc_rc)
700
701 BUILT_SOURCES_mozilla = mozilla/vlcintf.h
702 $(SOURCES_mozilla): mozilla/vlcintf.h
703
704 mozilla_plugin_DATA = $(LIBRARIES_mozilla)
705 mozilla_plugindir = $(libdir)/mozilla/plugins
706 $(LIBRARIES_mozilla): $(mozilla_libplugin_a_OBJECTS) \
707                       $(mozilla_libplugin_a_DEPENDENCIES) \
708                       $(L_builtin_pic)
709         $(CXXLINK) $(mozilla_libplugin_a_OBJECTS) $(DATA_npvlc_rc) \
710                 lib/libvlc_pic.a $(L_builtin_pic) -shared $(LDFLAGS) \
711                 $(LDFLAGS_vlc) $(LDFLAGS_mozilla) $(LDFLAGS_builtin_pic)
712
713 mozilla_vlcintf_xpt_DATA = mozilla/vlcintf.xpt
714 mozilla_vlcintf_xptdir = $(libdir)/mozilla/components
715 mozilla/vlcintf.xpt: Makefile mozilla/vlcintf.idl
716         $(XPIDL) -I/usr/share/idl/mozilla -m typelib \
717                 -o mozilla/vlcintf mozilla/vlcintf.idl
718
719 mozilla/vlcintf.h: Makefile mozilla/vlcintf.idl
720         $(XPIDL) -I/usr/share/idl/mozilla -m header \
721                 -o mozilla/vlcintf mozilla/vlcintf.idl
722
723 if HAVE_WIN32
724 DATA_npvlc_rc = $(noinst_mozilla_npvlc_rc_DATA)
725 noinst_mozilla_npvlc_rc_DATA = mozilla/npvlc_rc.$(OBJEXT)
726 noinst_mozilla_npvlc_rcdir = $(libdir)
727 mozilla/npvlc_rc.$(OBJEXT): mozilla/npvlc_rc.rc
728         $(WINDRES) --include-dir mozilla -i $< -o $@
729 endif
730 endif
731
732 ###############################################################################
733 # Modules
734 ###############################################################################
735 MOSTLYCLEANFILES += $(PLUGIN_FILES)
736 PLUGIN_FILES =
737
738 libvlcdir = $(libdir)/vlc
739
740 include Modules.am
741
742 ###############################################################################
743 # Force rule
744 ###############################################################################
745 FORCE: