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