]> git.sesse.net Git - vlc/blob - Makefile.am
* Added a Miscellaneous Panel in wxwindows stream output.
[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 = intl modules . share po m4
11 DIST_SUBDIRS = $(SUBDIRS) src debian doc ipkg lib autotools
12
13 EXTRA_DIST = \
14         HACKING \
15         INSTALL.win32 \
16         MAINTAINERS \
17         README.MacOSX.rtf \
18         bootstrap \
19         install-win32 \
20         src/extras/COPYING \
21         toolbox \
22         vlc-config.in.in \
23         vlc.ebuild \
24         vlc.spec \
25         vlc.spec.redhat \
26         $(NULL)
27
28 BUILT_SOURCES =
29 SUFFIXES = 
30
31 # Tell aclocal to use -I m4. Wonder if it really works.
32 ACLOCAL_AMFLAGS = -I m4
33
34 # XXX: these flags could be set in configure.ac, but we set them here
35 # because old versions of automake don't support them in configure.ac.
36 AUTOMAKE_OPTIONS = dist-bzip2 subdir-objects
37
38 ###############################################################################
39 # Headers
40 ###############################################################################
41
42 BUILT_SOURCES += \
43         include/vlc_symbols.h \
44         src/misc/modules_builtin.h \
45         src/misc/modules_plugin.h \
46         $(NULL)
47
48 pkgincludedir = $(includedir)/vlc
49
50 dist_pkginclude_HEADERS = \
51         include/vlc/vlc.h \
52         include/vlc/aout.h \
53         include/vlc/vout.h \
54         include/vlc/sout.h \
55         include/vlc/decoder.h \
56         include/vlc/input.h \
57         include/vlc/intf.h \
58         $(NULL)
59
60 noinst_HEADERS = $(HEADERS_include) $(HEADERS_include_built)
61
62 HEADERS_include = \
63         include/aout_internal.h \
64         include/audio_output.h \
65         include/beos_specific.h \
66         include/configuration.h \
67         include/darwin_specific.h \
68         include/codecs.h \
69         include/encoder.h \
70         include/input_ext-dec.h \
71         include/input_ext-intf.h \
72         include/input_ext-plugins.h \
73         include/intf_eject.h \
74         include/iso_lang.h \
75         include/httpd.h \
76         include/main.h \
77         include/mmx.h \
78         include/modules.h \
79         include/modules_inner.h \
80         include/mtime.h \
81         include/network.h \
82         include/os_specific.h \
83         include/stream_control.h \
84         include/stream_output.h \
85         include/announce.h \
86         include/variables.h \
87         include/video_output.h \
88         include/vlc_common.h \
89         include/vlc_config.h \
90         include/vlc_cpu.h \
91         include/vlc_error.h \
92         include/vlc_interface.h \
93         include/vlc_messages.h \
94         include/vlc_objects.h \
95         include/vlc_playlist.h \
96         include/vlc_threads.h \
97         include/vlc_threads_funcs.h \
98         include/vlc_video.h \
99         include/vout_synchro.h \
100         include/win32_specific.h \
101         include/osd.h \
102         $(NULL)
103
104 HEADERS_include_built = \
105         include/vlc_symbols.h \
106         $(NULL)
107
108 include/vlc_symbols.h: Makefile $(HEADERS_include)
109         $(srcdir)/toolbox --update-includes
110
111 src/misc/modules_plugin.h: Makefile src/misc/modules_plugin.h.in $(HEADERS_include)
112         $(srcdir)/toolbox --update-includes
113
114 src/misc/modules_builtin.h: Makefile src/misc/modules_builtin.h.in
115         $(srcdir)/toolbox --update-includes
116
117 # These dependencies are mandatory
118 $(SOURCES): include/vlc_symbols.h
119 $(SOURCES_libvlc): src/misc/modules_plugin.h src/misc/modules_builtin.h $(LIB_intl)
120
121 ###############################################################################
122 # Optional libintl - FIXME, bad dependencies
123 ###############################################################################
124
125 intl/libintl.a: FORCE
126         cd $(top_builddir)/intl && $(MAKE) $(AM_MAKEFLAGS)
127
128 if BUILD_INTL
129 LIB_intl = intl/libintl.a
130 endif
131
132 ###############################################################################
133 # MacOS X project
134 ###############################################################################
135
136 EXTRA_DIST += \
137         extras/MacOSX/Resources/English.lproj/MainMenu.nib/classes.nib \
138         extras/MacOSX/Resources/English.lproj/MainMenu.nib/info.nib \
139         extras/MacOSX/Resources/English.lproj/MainMenu.nib/objects.nib \
140         extras/MacOSX/Resources/English.lproj/InfoPlist.strings \
141         extras/MacOSX/Resources/English.lproj/vlc.scriptTerminology \
142         extras/MacOSX/Resources/a52.icns \
143         extras/MacOSX/Resources/aac.icns \
144         extras/MacOSX/Resources/asf.icns \
145         extras/MacOSX/Resources/asx.icns \
146         extras/MacOSX/Resources/avi.icns \
147         extras/MacOSX/Resources/bin.icns \
148         extras/MacOSX/Resources/cue.icns \
149         extras/MacOSX/Resources/dat.icns \
150         extras/MacOSX/Resources/divx.icns \
151         extras/MacOSX/Resources/dv.icns \
152         extras/MacOSX/Resources/generic.icns \
153         extras/MacOSX/Resources/m3u.icns \
154         extras/MacOSX/Resources/mov.icns \
155         extras/MacOSX/Resources/mp3.icns \
156         extras/MacOSX/Resources/mp4.icns \
157         extras/MacOSX/Resources/mpeg.icns \
158         extras/MacOSX/Resources/mpeg1.icns \
159         extras/MacOSX/Resources/mpeg2.icns \
160         extras/MacOSX/Resources/mpeg4.icns \
161         extras/MacOSX/Resources/mpg.icns \
162         extras/MacOSX/Resources/ogg.icns \
163         extras/MacOSX/Resources/ogm.icns \
164         extras/MacOSX/Resources/pls.icns \
165         extras/MacOSX/Resources/srt.icns \
166         extras/MacOSX/Resources/sub.icns \
167         extras/MacOSX/Resources/vlc.icns \
168         extras/MacOSX/Resources/vob.icns \
169         extras/MacOSX/Resources/wma.icns \
170         extras/MacOSX/Resources/wmv.icns \
171         extras/MacOSX/Resources/back.png \
172         extras/MacOSX/Resources/begin.png \
173         extras/MacOSX/Resources/end.png \
174         extras/MacOSX/Resources/forw.png \
175         extras/MacOSX/Resources/list.png \
176         extras/MacOSX/Resources/pause.png \
177         extras/MacOSX/Resources/play.png \
178         extras/MacOSX/Resources/prefs.png \
179         extras/MacOSX/Resources/slow.png \
180         extras/MacOSX/Resources/stop.png \
181         extras/MacOSX/Resources/vlc_hg.png \
182         extras/MacOSX/Resources/about_bg.png \
183         extras/MacOSX/Resources/vlc.scriptSuite \
184         extras/MacOSX/Resources/README \
185         extras/MacOSX/vlc.pbproj/project.pbxproj \
186         extras/MacOSX/macosx-dmg \
187         $(NULL)
188
189 ###############################################################################
190 # MS Visual Studio and eMbedded Visual Studio projects
191 ###############################################################################
192
193 EXTRA_DIST += \
194         msvc/vlc.dsw \
195         msvc/libvlc.dsp.in \
196         msvc/plugins.dsp.in \
197         msvc/vlc.dsp.in \
198         msvc/config.h.in \
199         msvc/modules_builtin_msvc.h \
200         evc/vlc.vcw \
201         evc/libvlc.vcp.in \
202         evc/vlc.vcp.in \
203         evc/plugins.vcp.in \
204         evc/vlc.c \
205         evc/config.h.in \
206         evc/modules_builtin_evc.h \
207         $(NULL)
208
209 dist-hook:
210         mv $(distdir)/vlc.ebuild $(distdir)/vlc-${VERSION}.ebuild
211         cd $(distdir) && $(srcdir)/toolbox --update-vc
212
213 ###############################################################################
214 # Building libvlc
215 ###############################################################################
216
217 bin_SCRIPTS = vlc-config
218
219 lib_LIBRARIES = lib/libvlc.a $(LIBRARIES_libvlc_pic)
220
221 lib_libvlc_a_SOURCES = $(SOURCES_libvlc)
222 dist_lib_libvlc_a_SOURCES = src/misc/modules_plugin.h
223 lib_libvlc_a_CFLAGS = `$(VLC_CONFIG) --cflags vlc`
224 lib_libvlc_a_CXXFLAGS = `$(VLC_CONFIG) --cxxflags vlc`
225 lib_libvlc_a_OBJCFLAGS = `$(VLC_CONFIG) --objcflags vlc`
226
227 lib_libvlc_pic_a_SOURCES = $(SOURCES_libvlc)
228 lib_libvlc_pic_a_CFLAGS = `$(VLC_CONFIG) --cflags vlc pic`
229 lib_libvlc_pic_a_CXXFLAGS = `$(VLC_CONFIG) --cxxflags vlc pic`
230 lib_libvlc_pic_a_OBJCFLAGS = `$(VLC_CONFIG) --objcflags vlc pic`
231
232 if HAVE_BEOS
233 OPT_SOURCES_libvlc_beos = $(SOURCES_libvlc_beos)
234 endif
235 if HAVE_DARWIN
236 OPT_SOURCES_libvlc_darwin = $(SOURCES_libvlc_darwin)
237 endif
238 if HAVE_WIN32
239 OPT_SOURCES_libvlc_win32 = $(SOURCES_libvlc_win32)
240 endif
241 if BUILD_DIRENT
242 OPT_SOURCES_libvlc_dirent = $(SOURCES_libvlc_dirent)
243 endif
244 if BUILD_GETOPT
245 OPT_SOURCES_libvlc_getopt = $(SOURCES_libvlc_getopt)
246 endif
247 if BUILD_MOZILLA
248 LIBRARIES_libvlc_pic = lib/libvlc_pic.a
249 endif
250
251 EXTRA_DIST += \
252         $(SOURCES_libvlc_beos) \
253         $(SOURCES_libvlc_darwin) \
254         $(SOURCES_libvlc_win32) \
255         $(SOURCES_libvlc_dirent) \
256         $(SOURCES_libvlc_getopt) \
257         $(NULL)
258
259 SOURCES_libvlc_beos = \
260         src/misc/beos_specific.cpp \
261         $(NULL)
262
263 SOURCES_libvlc_darwin = \
264         src/misc/darwin_specific.m \
265         $(NULL)
266
267 SOURCES_libvlc_win32 = \
268         src/misc/win32_specific.c \
269         $(NULL)
270
271 SOURCES_libvlc_dirent = \
272         src/extras/dirent.c \
273         src/extras/dirent.h \
274         $(NULL)
275
276 SOURCES_libvlc_getopt = \
277         src/extras/getopt.c \
278         src/extras/getopt.h \
279         src/extras/getopt1.c \
280         $(NULL)
281
282 SOURCES_libvlc_common = \
283         src/libvlc.c \
284         src/libvlc.h \
285         src/interface/interface.c \
286         src/interface/intf_eject.c \
287         src/playlist/playlist.c \
288         src/input/input.c \
289         src/input/input_ext-plugins.c \
290         src/input/input_ext-dec.c \
291         src/input/input_ext-intf.c \
292         src/input/input_dec.c \
293         src/input/input_programs.c \
294         src/input/input_clock.c \
295         src/input/input_info.c \
296         src/video_output/video_output.c \
297         src/video_output/vout_pictures.c \
298         src/video_output/vout_pictures.h \
299         src/video_output/video_text.c \
300         src/video_output/video_text.h \
301         src/video_output/vout_subpictures.c \
302         src/video_output/vout_synchro.c \
303         src/audio_output/common.c \
304         src/audio_output/dec.c \
305         src/audio_output/filters.c \
306         src/audio_output/input.c \
307         src/audio_output/mixer.c \
308         src/audio_output/output.c \
309         src/audio_output/intf.c \
310         src/stream_output/stream_output.c \
311         src/stream_output/announce.c \
312         src/misc/mtime.c \
313         src/misc/modules.c \
314         src/misc/threads.c \
315         src/misc/cpu.c \
316         src/misc/configuration.c \
317         src/misc/iso_lang.c \
318         src/misc/iso-639_def.h \
319         src/misc/messages.c \
320         src/misc/objects.c \
321         src/misc/variables.c \
322         src/misc/error.c \
323         src/extras/libc.c \
324         $(NULL)
325
326 SOURCES_libvlc = \
327         $(SOURCES_libvlc_common) \
328         $(OPT_SOURCES_libvlc_beos) \
329         $(OPT_SOURCES_libvlc_darwin) \
330         $(OPT_SOURCES_libvlc_win32) \
331         $(OPT_SOURCES_libvlc_dirent) \
332         $(OPT_SOURCES_libvlc_getopt) \
333         $(NULL)
334
335 ###############################################################################
336 # Building vlc
337 ###############################################################################
338
339 bin_PROGRAMS = vlc
340
341 vlc_SOURCES = src/vlc.c
342
343 vlc_LDFLAGS = `$(VLC_CONFIG) --libs vlc builtin`
344 vlc_LDADD = lib/libvlc.a $(DATA_win32_rc) $(LIB_intl)
345 vlc_CFLAGS = `$(VLC_CONFIG) --cflags vlc`
346
347 # We use DEPENDENCIES_vlc instead of vlc_DEPENDENCIES because of an
348 # old automake-1.5 bug (automake/279).
349 DEPENDENCIES_vlc = lib/libvlc.a $(DATA_win32_rc) $(LIB_intl)
350
351 vlc$(EXEEXT): $(vlc_OBJECTS) $(DEPENDENCIES_vlc) stamp-builtin
352         @rm -f $(top_builddir)/vlc$(EXEEXT)
353         @case `$(VLC_CONFIG) --linkage vlc builtin` in \
354           c++) echo $(CXXLINK) $(vlc_OBJECTS) $(vlc_LDADD) $(vlc_LDFLAGS) $(LIBS) ; $(CXXLINK) $(vlc_OBJECTS) $(vlc_LDADD) $(vlc_LDFLAGS) $(LIBS) ;; \
355           objc) echo $(OBJCLINK) $(vlc_OBJECTS) $(vlc_LDADD) $(vlc_LDFLAGS) $(LIBS) ; $(OBJCLINK) $(vlc_OBJECTS) $(vlc_LDADD) $(vlc_LDFLAGS) $(LIBS) ;; \
356           c|*) echo $(LINK) $(vlc_OBJECTS) $(vlc_LDADD) $(vlc_LDFLAGS) $(LIBS) ; $(LINK) $(vlc_OBJECTS) $(vlc_LDADD) $(vlc_LDFLAGS) $(LIBS) ;; \
357         esac
358
359 if HAVE_BEOS
360         xres -o $@ $(srcdir)/share/vlc_beos.rsrc
361         mimeset -f $@
362         rm -Rf $(srcdir)/locale ; mkdir -p "$(srcdir)/locale"
363         for i in $(ALL_LINGUAS); do \
364           mkdir -p "$(srcdir)/locale/$${i}/LC_MESSAGES" ; \
365           cp "$(srcdir)/po/$${i}.gmo" \
366             "$(srcdir)/locale/$${i}/LC_MESSAGES/vlc.mo" || true ; \
367         done
368 endif
369
370 # Install the modules and the symlinks
371 install-exec-local:
372         for i in "" `$(VLC_CONFIG) --target plugin` ; do if test -n "$$i" ; then \
373           echo $(INSTALL) -m 755 "$$i$(LIBEXT)" "$(DESTDIR)$(libdir)/vlc/`echo $$i | cut -f2 -d/`" ; \
374           $(INSTALL) -m 755 "$$i$(LIBEXT)" "$(DESTDIR)$(libdir)/vlc/`echo $$i | cut -f2 -d/`" ; \
375         fi ; done
376         for i in "" `$(VLC_CONFIG) --target builtin` `$(VLC_CONFIG) --target builtin pic` ; do if test -n "$$i" ; then \
377           echo $(INSTALL) -m 644 "$$i" "$(DESTDIR)$(libdir)/vlc" ; \
378           $(INSTALL) -m 644 "$$i" "$(DESTDIR)$(libdir)/vlc" ; \
379         fi ; done
380         for i in "" $(ALIASES) ; do if test -n "$$i" ; then \
381           rm -f "$(DESTDIR)$(bindir)/$$i" && \
382           ln -s vlc "$(DESTDIR)$(bindir)/$$i" ; \
383         fi ; done
384
385 if HAVE_DARWIN
386 # Create the MacOS X app
387 vlc_app_DATA = VLC.app
388 vlc_appdir = $(bindir)
389 VLC.app: vlc
390         rm -Rf VLC.app
391         cd $(srcdir)/extras/MacOSX && pbxbuild -target vlc | grep -v '^\([ \t]\|$$\)'
392         cp -r $(srcdir)/extras/MacOSX/build/vlc.bundle $(srcdir)/VLC.app
393         $(INSTALL) -d $(srcdir)/VLC.app/Contents/MacOS
394         $(INSTALL) vlc $(srcdir)/VLC.app/Contents/MacOS/VLC
395         $(INSTALL) -d $(srcdir)/VLC.app/Contents/MacOS/modules
396         for i in "" `$(VLC_CONFIG) --target plugin` ; do \
397           if test -n "$$i" ; then $(INSTALL) "$(srcdir)/$$i$(LIBEXT)" \
398             "$(srcdir)/VLC.app/Contents/MacOS/modules" ; \
399           fi ; done
400         $(INSTALL) -d $(srcdir)/VLC.app/Contents/MacOS/share
401         $(INSTALL) -m 644 $(srcdir)/share/*.psf $(srcdir)/share/*.rle \
402           $(srcdir)/VLC.app/Contents/MacOS/share
403         $(INSTALL) -d $(srcdir)/VLC.app/Contents/MacOS/locale
404         for i in $(ALL_LINGUAS); do \
405           mkdir -p $(srcdir)/VLC.app/Contents/MacOS/locale/$${i}/LC_MESSAGES ; \
406           cp $(srcdir)/po/$${i}.gmo $(srcdir)/VLC.app/Contents/MacOS/locale/$${i}/LC_MESSAGES/vlc.mo || true ; \
407           mkdir -p $(srcdir)/VLC.app/Contents/Resources/$${i}.lproj ; \
408           ln -sf ../English.lproj/InfoPlist.strings $(srcdir)/VLC.app/Contents/Resources/$${i}.lproj ; \
409           ln -sf ../English.lproj/MainMenu.nib $(srcdir)/VLC.app/Contents/Resources/$${i}.lproj ; \
410           ln -sf ../English.lproj/vlc.scriptTerminology $(srcdir)/VLC.app/Contents/Resources/$${i}.lproj ; \
411         done
412         printf "APPLVLC#" >| $(srcdir)/VLC.app/Contents/PkgInfo
413 endif
414
415 if HAVE_WIN32
416 DATA_win32_rc = $(noinst_share_vlc_win32_rc_DATA)
417 noinst_share_vlc_win32_rc_DATA = share/vlc_win32_rc.$(OBJEXT)
418 noinst_share_vlc_win32_rcdir = $(libdir)
419 share/vlc_win32_rc.$(OBJEXT): share/vlc_win32_rc.rc
420         $(WINDRES) --include-dir $(srcdir)/share -i $< -o $@
421 endif
422
423 ###############################################################################
424 # Building architecture-specific binary packages
425 ###############################################################################
426
427 # XXX: this rule is probably only useful to you if you have exactly
428 # the same setup as me. Contact sam@zoy.org if you need to use it.
429 #
430 # Check that tmp isn't in the way
431 package-win32:
432         @if test -e "$(srcdir)/tmp"; then \
433           echo "Error: please remove $(srcdir)/tmp, it is in the way"; \
434           false; \
435         else \
436           echo "OK."; mkdir -p "$(srcdir)/tmp"; \
437         fi
438 # Create installation script
439         cp "$(srcdir)/install-win32" "$(srcdir)/tmp/nsi"
440 # Copy relevant files
441         cp "$(top_builddir)/vlc$(EXEEXT)" "$(srcdir)/tmp/"
442         $(STRIP) "$(srcdir)/tmp/vlc$(EXEEXT)"
443         cp "$(srcdir)/INSTALL.win32" "$(srcdir)/tmp/INSTALL.txt"
444         unix2dos "$(srcdir)/tmp/INSTALL.txt"
445         for file in AUTHORS MAINTAINERS THANKS NEWS COPYING README ; \
446           do cp "$(srcdir)/$$file" "$(srcdir)/tmp/$${file}.txt" ; \
447           unix2dos "$(srcdir)/tmp/$${file}.txt" ; done
448
449         mkdir -p "$(srcdir)/tmp/plugins"
450         for i in "" `$(VLC_CONFIG) --target plugin` ; do \
451           if test -n "$$i" ; then \
452             $(INSTALL) "$(srcdir)/$$i$(LIBEXT)" "$(srcdir)/tmp/plugins/" ; \
453           fi ; done
454
455         for i in "" $(srcdir)/tmp/plugins/*$(LIBEXT) ; \
456           do if test -n "$$i" ; then $(STRIP) "$$i" ; fi ; done
457
458         mkdir -p "$(srcdir)/tmp/share"
459         cp $(srcdir)/share/*.rle $(srcdir)/tmp/share/ ;
460
461         mkdir $(srcdir)/tmp/locale
462         for i in $(ALL_LINGUAS); do \
463           mkdir -p "$(srcdir)/tmp/locale/$${i}/LC_MESSAGES" ; \
464           cp "$(srcdir)/po/$${i}.gmo" \
465             "$(srcdir)/tmp/locale/$${i}/LC_MESSAGES/vlc.mo" || true ; \
466         done
467
468         mkdir -p $(srcdir)/tmp/skins/default
469         for i in $(srcdir)/share/skins/default/*.*; do \
470           cp $$i $(srcdir)/tmp/skins/default/ || true ; \
471         done
472         for i in $(srcdir)/doc/skins/*.txt; do \
473           cp $$i $(srcdir)/tmp/skins/ || true ; \
474         done
475
476 # Create package 
477         wine ~/.wine/fake_windows/Program\ Files/NSIS/makensis.exe -- /DVERSION=${VERSION} $(srcdir)/tmp/nsi
478 # Clean up
479         rm -Rf $(srcdir)/tmp
480
481 package-beos:
482 # Check that tmp isn't in the way
483         @if test -e $(srcdir)/tmp; then \
484           echo "Error: please remove $(srcdir)/tmp, it is in the way"; \
485           false; \
486         else \
487           echo "OK."; mkdir $(srcdir)/tmp; \
488         fi
489
490 # Copy relevant files
491         mkdir -p $(srcdir)/tmp/vlc
492         cd $(srcdir) && \
493           cp vlc AUTHORS COPYING ChangeLog README THANKS NEWS tmp/vlc/
494 # We cannot use ${PLUGIN_FILES}, it looks like it is too long for the BeOS shell...
495         if [ `find $(srcdir)/modules -name "lib*_plugin.so" | wc -l` -gt 0 ]; then \
496           mkdir -p $(srcdir)/tmp/vlc/plugins; \
497           find $(srcdir)/modules -name "lib*_plugin.so" | xargs -i{} cp {} $(srcdir)/tmp/vlc/plugins/; \
498         fi
499         for i in $(ALL_LINGUAS); do \
500           mkdir -p $(srcdir)/tmp/vlc/locale/$${i}/LC_MESSAGES ; \
501           cp $(srcdir)/po/$${i}.gmo $(srcdir)/tmp/vlc/locale/$${i}/LC_MESSAGES/vlc.mo || true ; \
502         done
503         mkdir -p $(srcdir)/tmp/vlc/share
504         cp $(srcdir)/share/*.rle $(srcdir)/tmp/vlc/share/
505
506 # Create package with debug symbols
507         mimeset -f $(srcdir)/tmp/vlc/* $(srcdir)/tmp/vlc/*/*
508         mv $(srcdir)/tmp/vlc $(srcdir)/tmp/vlc-${VERSION}
509         (cd $(srcdir)/tmp ; zip -9 -r vlc-${VERSION}-BeOS-debug.zip vlc-${VERSION} )
510         mv $(srcdir)/tmp/vlc-${VERSION}-BeOS-debug.zip $(srcdir)/
511
512 # Create package without debug symbols
513         strip $(srcdir)/tmp/vlc-${VERSION}/vlc
514         if [ -d $(srcdir)/tmp/vlc-${VERSION}/plugins ]; then \
515           strip $(srcdir)/tmp/vlc-${VERSION}/plugins/lib*_plugin.so; \
516         fi
517         xres -o $(srcdir)/tmp/vlc-${VERSION}/vlc $(srcdir)/share/vlc_beos.rsrc
518         mimeset -f $(srcdir)/tmp/vlc-${VERSION}/* $(srcdir)/tmp/vlc-${VERSION}/*/*
519         (cd $(srcdir)/tmp ; zip -9 -r vlc-${VERSION}-BeOS.zip vlc-${VERSION} )
520         mv $(srcdir)/tmp/vlc-${VERSION}-BeOS.zip $(srcdir)/
521
522 # Clean up
523         rm -Rf $(srcdir)/tmp
524
525 package-macosx:
526 # Check that tmp isn't in the way
527         @if test -e "$(srcdir)/tmp"; then \
528           echo "Error: please remove $(srcdir)/tmp, it is in the way"; \
529           false; \
530         else \
531           echo "OK."; mkdir -p "$(srcdir)/tmp"; \
532         fi
533
534 # Copy relevant files 
535         cp -R "$(srcdir)/VLC.app" "$(srcdir)/tmp/"
536         cd "$(srcdir)" && cp AUTHORS COPYING ChangeLog README README.MacOSX.rtf THANKS NEWS tmp/
537
538 # Create disk image 
539         $(srcdir)/extras/MacOSX/macosx-dmg 18 "vlc-${VERSION}" $(srcdir)/tmp/* 
540
541 # Clean up
542         rm -Rf $(srcdir)/tmp
543
544 ###############################################################################
545 # Building the Mozilla plugin
546 ###############################################################################
547
548 noinst_LIBRARIES = $(noinst_LIBRARIES_mozilla)
549
550 MOSTLYCLEANFILES = $(LIBRARIES_mozilla)
551
552 EXTRA_DIST += $(SOURCES_mozilla) mozilla/vlcintf.idl
553
554 BUILT_SOURCES += $(BUILT_SOURCES_mozilla)
555
556 SOURCES_mozilla = \
557         mozilla/vlcshell.cpp \
558         mozilla/vlcplugin.cpp \
559         mozilla/vlcplugin.h \
560         mozilla/vlcpeer.cpp \
561         mozilla/vlcpeer.h \
562         mozilla/support/classinfo.h \
563         $(SOURCES_mozilla_win32) \
564         $(SOURCES_mozilla_macosx) \
565         $(SOURCES_mozilla_unix) \
566         $(NULL)
567
568 # Under Win32, Mozilla plugins need to be named NP******.DLL, but under Unix
569 # the common naming scheme is lib******plugin.so. Also, we need npwin.cpp
570 # under Win32 and npunix.c under Unix.
571 if HAVE_WIN32
572 LIBRARIES_mozilla = mozilla/npvlc$(LIBEXT)
573 SOURCES_mozilla_win32 = mozilla/support/npwin.cpp
574 CPPFLAGS_mozilla_EXTRA = -DXP_WIN -DXP_WIN32
575 else
576 if HAVE_DARWIN
577 # We don't define LIBRARIES_mozilla because we'll be using project builder
578 SOURCES_mozilla_macosx = mozilla/support/npmac.cpp
579 else
580 LIBRARIES_mozilla = mozilla/libvlcplugin$(LIBEXT)
581 SOURCES_mozilla_unix = mozilla/support/npunix.c
582 endif
583 endif
584
585 if BUILD_MOZILLA
586 if UNTRUE
587 noinst_LIBRARIES_mozilla = mozilla/libplugin.a
588 endif
589
590 mozilla_libplugin_a_SOURCES = $(SOURCES_mozilla)
591 mozilla_libplugin_a_CFLAGS = `$(VLC_CONFIG) --cflags mozilla pic` \
592                              $(CPPFLAGS_mozilla_EXTRA) -Imozilla
593 mozilla_libplugin_a_CXXFLAGS = `$(VLC_CONFIG) --cxxflags mozilla pic` \
594                                $(CPPFLAGS_mozilla_EXTRA) -Imozilla
595 mozilla_libplugin_a_DEPENDENCIES = lib/libvlc_pic.a $(DATA_npvlc_rc)
596
597 BUILT_SOURCES_mozilla = mozilla/vlcintf.h
598 $(SOURCES_mozilla): mozilla/vlcintf.h
599
600 mozilla_plugin_DATA = $(LIBRARIES_mozilla)
601 mozilla_plugindir = $(libdir)/mozilla/plugins
602 $(LIBRARIES_mozilla): $(mozilla_libplugin_a_OBJECTS) \
603                       $(mozilla_libplugin_a_DEPENDENCIES) stamp-pic
604         $(CXXLINK) $(mozilla_libplugin_a_OBJECTS) $(DATA_npvlc_rc) \
605           lib/libvlc_pic.a -shared \
606           `$(VLC_CONFIG) --libs vlc mozilla builtin pic`
607
608 mozilla_vlcintf_xpt_DATA = mozilla/vlcintf.xpt
609 mozilla_vlcintf_xptdir = $(libdir)/mozilla/components
610 mozilla/vlcintf.xpt: mozilla/vlcintf.idl
611         $(XPIDL) -I/usr/share/idl/mozilla -m typelib \
612           -o mozilla/vlcintf $(srcdir)/mozilla/vlcintf.idl
613
614 mozilla/vlcintf.h: mozilla/vlcintf.idl
615         $(XPIDL) -I/usr/share/idl/mozilla -m header \
616           -o mozilla/vlcintf $(srcdir)/mozilla/vlcintf.idl
617
618 if HAVE_WIN32
619 DATA_npvlc_rc = $(noinst_mozilla_npvlc_rc_DATA)
620 noinst_mozilla_npvlc_rc_DATA = mozilla/npvlc_rc.$(OBJEXT)
621 noinst_mozilla_npvlc_rcdir = $(libdir)
622 mozilla/npvlc_rc.$(OBJEXT): mozilla/npvlc_rc.rc
623         $(WINDRES) --include-dir $(srcdir)/mozilla -i $< -o $@
624 endif
625 endif
626
627 ###############################################################################
628 # Stamp rules
629 ###############################################################################
630 clean: clean-stamps
631 clean-stamp:
632         rm -f stamp-builtin stamp-pic
633
634 stamp-builtin: FORCE
635         @for dep in "" `$(VLC_CONFIG) --target builtin`; do \
636           if test "$${dep}" -nt "$(top_builddir)/vlc$(EXEEXT)"; then \
637             rm -f $@; \
638             break; \
639           fi; \
640         done
641         @if test ! -f $@; then printf "" > $@; fi
642
643 stamp-pic: FORCE
644         @for dep in "" `$(VLC_CONFIG) --target builtin pic`; do \
645           if test "$${dep}" -nt "$(LIBRARIES_mozilla)"; then \
646             rm -f $@; \
647             break; \
648           fi; \
649         done
650         @if test ! -f $@; then printf "" > $@; fi
651
652 ###############################################################################
653 # Force rule
654 ###############################################################################
655 FORCE: