]> git.sesse.net Git - vlc/blob - mozilla/Makefile.am
* include/vlc_common.h: ssize_t is now typedefed in new mingw headers.
[vlc] / mozilla / Makefile.am
1 ###############################################################################
2 # Building the Mozilla plugin
3 ###############################################################################
4
5 noinst_LIBRARIES = $(noinst_LIBRARIES_mozilla)
6                                              
7 MOSTLYCLEANFILES = $(LIBRARIES_mozilla)
8 EXTRA_DIST = $(SOURCES_mozilla) vlcintf.idl
9 BUILT_SOURCES = $(BUILT_SOURCES_mozilla)
10
11 SOURCES_mozilla = \
12         vlcshell.cpp \
13         vlcplugin.cpp \
14         vlcplugin.h \
15         vlcpeer.cpp \
16         vlcpeer.h \
17         support/classinfo.h \
18         $(SOURCES_win32) \
19         $(SOURCES_macosx) \
20         $(SOURCES_unix) \
21         $(NULL)
22
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.
26 if HAVE_WIN32
27 LIBRARIES_mozilla = npvlc$(LIBEXT)
28 SOURCES_win32 = support/npwin.cpp
29 CPPFLAGS_mozilla_EXTRA = -DXP_WIN -DXP_WIN32
30 else
31 if HAVE_DARWIN
32 # We don't define LIBRARIES_mozilla because we'll be using project builder, or not...
33 BUNDLE_mozilla = VLC\ Plugin.plugin
34
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
38
39 else
40 LIBRARIES_mozilla = libvlcplugin$(LIBEXT)
41 SOURCES_unix = support/npunix.c
42 endif
43 endif
44
45 if BUILD_MOZILLA
46 if UNTRUE
47 noinst_LIBRARIES_mozilla = libplugin.a
48 endif
49
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)
56
57 BUILT_SOURCES_mozilla = vlcintf.h
58 $(SOURCES_mozilla): vlcintf.h
59
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`
67
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
74
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
79
80 if HAVE_WIN32
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 $@
86 endif
87 if HAVE_DARWIN
88 VLC\ Plugin.plugin:
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/
103 endif
104 endif
105
106 ###############################################################################
107 # Stamp rules
108 ###############################################################################
109 clean: clean-stamp clean-bundle
110 clean-stamp:
111         rm -f stamp-pic
112
113 stamp-pic: FORCE
114         @for dep in "" `$(VLC_CONFIG) --target builtin pic`; do \
115           if test "$${dep}" -nt "$(LIBRARIES_mozilla)"; then \
116             rm -f $@; \
117             break; \
118           fi; \
119         done
120         @if test ! -f $@; then printf "" > $@; fi
121
122 clean-bundle:
123         rm -rf $(srcdir)/VLC\ Plugin.plugin
124
125 ###############################################################################
126 # Force rule
127 ###############################################################################
128 FORCE: