1 ###############################################################################
2 # Building the Mozilla plugin
3 ###############################################################################
5 noinst_LIBRARIES = $(noinst_LIBRARIES_mozilla)
7 MOSTLYCLEANFILES = $(LIBRARIES_mozilla)
8 EXTRA_DIST = $(SOURCES_mozilla) vlcintf.idl
9 BUILT_SOURCES = $(BUILT_SOURCES_mozilla)
23 # Under Win32, Mozilla plugins need to be named NP******.DLL, but under Unix
24 # the common naming scheme is lib******plugin.so. Also, we need npwin.cpp
25 # under Win32 and npunix.c under Unix.
27 LIBRARIES_mozilla = npvlc$(LIBEXT)
28 SOURCES_win32 = support/npwin.cpp
29 CPPFLAGS_mozilla_EXTRA = -DXP_WIN -DXP_WIN32
32 # We don't define LIBRARIES_mozilla because we'll be using project builder, or not...
33 BUNDLE_mozilla = VLC\ Plugin.plugin
35 vlc_moz_FLAGS = `$(VLC_CONFIG) --libs vlc builtin pic mozilla`
36 moz_CFLAGS = `$(MOZILLA_CONFIG) --cflags plugin java nspr/obsolete nspr oji xpcom xpconnect`
37 moz_plugin_FLAGS = -I$(srcdir)/../include -c -F/System/Library/Frameworks/CoreFoundation.framework $(moz_CFLAGS) -I/Developer/Headers/FlatCarbon -arch ppc -fno-common -fpascal-strings -O0 -Wmost -Wno-four-char-constants -Wno-unknown-pragmas -DXP_MACOSX=1 -DNO_X11=1 -DUSE_SYSTEM_CONSOLE=1 -pipe -fmessage-length=0 -g -include mozilla-config.h
40 LIBRARIES_mozilla = libvlcplugin$(LIBEXT)
41 SOURCES_unix = support/npunix.c
47 noinst_LIBRARIES_mozilla = libplugin.a
50 libplugin_a_SOURCES = $(SOURCES_mozilla)
51 libplugin_a_CFLAGS = `$(VLC_CONFIG) --cflags mozilla pic` \
52 $(CPPFLAGS_mozilla_EXTRA) -Imozilla
53 libplugin_a_CXXFLAGS = `$(VLC_CONFIG) --cxxflags mozilla pic` \
54 $(CPPFLAGS_mozilla_EXTRA) -Imozilla
55 libplugin_a_DEPENDENCIES = $(DATA_npvlc_rc)
57 BUILT_SOURCES_mozilla = vlcintf.h
58 $(SOURCES_mozilla): vlcintf.h
60 plugin_DATA = $(LIBRARIES_mozilla) $(BUNDLE_mozilla)
61 plugindir = $(libdir)/mozilla/plugins
62 $(LIBRARIES_mozilla): $(libplugin_a_OBJECTS) \
63 $(libplugin_a_DEPENDENCIES) stamp-pic
64 $(CXXLINK) $(libplugin_a_OBJECTS) $(DATA_npvlc_rc) \
65 $(top_builddir)/lib/libvlc_pic.a -shared \
66 `$(VLC_CONFIG) --libs vlc mozilla builtin pic`
68 vlcintf_xpt_DATA = vlcintf.xpt
69 vlcintf_xptdir = $(libdir)/mozilla/components
70 vlcintf.xpt: vlcintf.idl
71 $(XPIDL) $(XPIDL_INCL) -I/usr/share/idl/mozilla \
72 -I/usr/lib/mozilla/include/idl \
73 -m typelib -o vlcintf $(srcdir)/vlcintf.idl
75 vlcintf.h: vlcintf.idl
76 $(XPIDL) $(XPIDL_INCL) -I/usr/share/idl/mozilla \
77 -I/usr/lib/mozilla/include/idl \
78 -m header -o vlcintf $(srcdir)/vlcintf.idl
81 DATA_npvlc_rc = $(noinst_npvlc_rc_DATA)
82 noinst_npvlc_rc_DATA = npvlc_rc.$(OBJEXT)
83 noinst_npvlc_rcdir = $(libdir)
84 npvlc_rc.$(OBJEXT): npvlc_rc.rc
85 $(WINDRES) -DVERSION=$(VERSION) -DVERSION_NUMBER=`echo $(VERSION).0.0.0 | sed 's/\([0-9]*\)[^.]*\.*\([0-9]*\)[^.]*\.*\([0-9]*\)[^.]*\.*\([0-9]*\).*/\1,\2,\3,\4/'` --include-dir $(srcdir) -i $< -o $@
89 rm -rf $(srcdir)/VLC\ Plugin.plugin
90 mkdir -p $(srcdir)/VLC\ Plugin.plugin/Contents/MacOS
91 mkdir -p $(srcdir)/VLC\ Plugin.plugin/Contents/Resources
92 /usr/bin/g++3 $(moz_plugin_FLAGS) $(srcdir)/vlcplugin.cpp -o $(srcdir)/libplugin_a-vlcplugin.o
93 /usr/bin/g++3 $(moz_plugin_FLAGS) $(srcdir)/vlcshell.cpp -o $(srcdir)/libplugin_a-vlcshell.o
94 /usr/bin/g++3 $(moz_plugin_FLAGS) $(srcdir)/vlcpeer.cpp -o $(srcdir)/libplugin_a-vlcpeer.o
95 /usr/bin/g++3 $(moz_plugin_FLAGS) $(srcdir)/support/npmac.cpp -o $(srcdir)/libplugin_a-npmac.o
96 /usr/bin/g++3 $(srcdir)/libplugin_a-vlcplugin.o $(srcdir)/libplugin_a-vlcshell.o $(srcdir)/libplugin_a-vlcpeer.o $(srcdir)/libplugin_a-npmac.o -o $(srcdir)/VLC\ Plugin.plugin/Contents/MacOS/VLC\ Plugin -L/usr/lib -F/System/Library/Frameworks/CoreFoundation.framework -framework CoreFoundation -arch ppc -bundle -read_only_relocs suppress $(top_srcdir)/lib/libvlc_pic.a -dylib $(vlc_moz_FLAGS)
97 cp $(top_srcdir)/extras/MacOSX/plugin/Info.plist $(srcdir)/VLC\ Plugin.plugin/Contents/Info.plist
98 cp $(top_srcdir)/extras/MacOSX/plugin/pbdevelopment.plist $(srcdir)/VLC\ Plugin.plugin/Contents/pbdevelopment.plist
99 cp -r $(top_srcdir)/extras/MacOSX/plugin/English.lproj $(srcdir)/VLC\ Plugin.plugin/Contents/Resources/
100 Rez /Developer/Headers/FlatCarbon/Types.r $(srcdir)/vlc.r -o $(srcdir)/VLC\ Plugin.plugin/Contents/Resources/Vlc\ Plugin.rsrc
101 mkdir $(srcdir)/VLC\ Plugin.plugin/Contents/MacOS/modules
102 cp -r $(top_srcdir)/VLC.app/Contents/MacOS/modules/* $(srcdir)/VLC\ Plugin.plugin/Contents/MacOS/modules/
106 ###############################################################################
108 ###############################################################################
109 clean: clean-stamp clean-bundle
114 @for dep in "" `$(VLC_CONFIG) --target builtin pic`; do \
115 if test "$${dep}" -nt "$(LIBRARIES_mozilla)"; then \
120 @if test ! -f $@; then printf "" > $@; fi
123 rm -rf $(srcdir)/VLC\ Plugin.plugin
125 ###############################################################################
127 ###############################################################################