]> git.sesse.net Git - vlc/blob - mozilla/Makefile.am
Get rid of the UNTRUE conditionnal
[vlc] / mozilla / Makefile.am
1 ###############################################################################
2 # Building the Mozilla plugin
3 ###############################################################################
4
5 EXTRA_LIBRARIES = libplugin.a
6                                              
7 MOSTLYCLEANFILES = $(LIBRARIES_mozilla)
8 EXTRA_DIST = $(SOURCES_mozilla) $(DIST_rsrc) 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 DIST_rsrc = \
24         npvlc_rc.rc \
25         $(NULL)
26
27 # Under Win32, Mozilla plugins need to be named NP******.DLL, but under Unix
28 # the common naming scheme is lib******plugin.so. Also, we need npwin.cpp
29 # under Win32 and npunix.c under Unix.
30 if HAVE_WIN32
31 LIBRARIES_mozilla = npvlc$(LIBEXT)
32 SOURCES_win32 = support/npwin.cpp
33 CPPFLAGS_mozilla_EXTRA = -DXP_WIN -DXP_WIN32
34 LIBRARIES_libvlc = $(top_builddir)/lib/libvlc.a
35 else
36 if HAVE_DARWIN
37 # We don't define LIBRARIES_mozilla because we'll be using project builder, or not...
38 BUNDLE_mozilla = VLC\ Plugin.plugin
39 vlc_moz_FLAGS = `$(VLC_CONFIG) --libs vlc builtin pic mozilla`
40 moz_CFLAGS = `$(MOZILLA_CONFIG) --cflags plugin java nspr/obsolete nspr oji xpcom xpconnect`
41 moz_plugin_FLAGS = -I. -I$(top_builddir) -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
42 pic = pic
43 LIBRARIES_libvlc = $(top_builddir)/lib/libvlc_pic.a
44
45 else
46 LIBRARIES_mozilla = libvlcplugin$(LIBEXT)
47 SOURCES_unix = support/npunix.c
48 pic = pic
49 LIBRARIES_libvlc = $(top_builddir)/lib/libvlc_pic.a
50 endif
51 endif
52
53 if BUILD_MOZILLA
54 libplugin_a_SOURCES = $(SOURCES_mozilla)
55 libplugin_a_CFLAGS = `$(VLC_CONFIG) --cflags mozilla $(pic)` \
56                      $(CPPFLAGS_mozilla_EXTRA) -Imozilla
57 libplugin_a_CXXFLAGS = `$(VLC_CONFIG) --cxxflags mozilla $(pic)` \
58                        $(CPPFLAGS_mozilla_EXTRA) -Imozilla
59 libplugin_a_DEPENDENCIES = $(DATA_npvlc_rc)
60
61 BUILT_SOURCES_mozilla = vlcintf.h
62 $(SOURCES_mozilla): vlcintf.h
63
64 plugin_DATA = $(LIBRARIES_mozilla) $(BUNDLE_mozilla)
65 plugindir = $(libdir)/mozilla/plugins
66 $(LIBRARIES_mozilla): $(libplugin_a_OBJECTS) \
67                       $(libplugin_a_DEPENDENCIES) stamp-pic
68         $(CXXLINK) $(libplugin_a_OBJECTS) $(DATA_npvlc_rc) \
69           $(LIBRARIES_libvlc) -shared \
70           `$(VLC_CONFIG) --libs vlc mozilla builtin $(pic)`
71
72 vlcintf_xpt_DATA = vlcintf.xpt
73 vlcintf_xptdir = $(libdir)/mozilla/components
74 vlcintf.xpt: vlcintf.idl
75         $(XPIDL) $(XPIDL_INCL) \
76           -m typelib -o vlcintf $(srcdir)/vlcintf.idl
77
78 vlcintf.h: vlcintf.idl
79         $(XPIDL) $(XPIDL_INCL) \
80           -m header -o vlcintf $(srcdir)/vlcintf.idl
81
82 if HAVE_WIN32
83 DATA_npvlc_rc = $(noinst_npvlc_rc_DATA)
84 noinst_npvlc_rc_DATA = npvlc_rc.$(OBJEXT)
85 noinst_npvlc_rcdir = $(libdir)
86 npvlc_rc.$(OBJEXT): npvlc_rc.rc
87         $(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 $@
88 endif
89 if HAVE_DARWIN
90 VLC\ Plugin.plugin:
91         rm -rf ./VLC\ Plugin.plugin
92         mkdir -p ./VLC\ Plugin.plugin/Contents/MacOS
93         mkdir -p ./VLC\ Plugin.plugin/Contents/Resources
94         /usr/bin/g++3 $(moz_plugin_FLAGS) $(srcdir)/vlcplugin.cpp -o ./libplugin_a-vlcplugin.o
95         /usr/bin/g++3 $(moz_plugin_FLAGS) $(srcdir)/vlcshell.cpp -o ./libplugin_a-vlcshell.o
96         /usr/bin/g++3 $(moz_plugin_FLAGS) $(srcdir)/vlcpeer.cpp -o ./libplugin_a-vlcpeer.o
97         /usr/bin/g++3 $(moz_plugin_FLAGS) $(srcdir)/support/npmac.cpp -o ./libplugin_a-npmac.o
98         /usr/bin/g++3 ./libplugin_a-vlcplugin.o ./libplugin_a-vlcshell.o ./libplugin_a-vlcpeer.o ./libplugin_a-npmac.o -o ./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 $(LIBRARIES_libvlc) -dylib $(vlc_moz_FLAGS)
99         cp $(top_srcdir)/extras/MacOSX/plugin/Info.plist ./VLC\ Plugin.plugin/Contents/Info.plist
100         cp $(top_srcdir)/extras/MacOSX/plugin/pbdevelopment.plist ./VLC\ Plugin.plugin/Contents/pbdevelopment.plist
101         cp -r $(top_srcdir)/extras/MacOSX/plugin/English.lproj ./VLC\ Plugin.plugin/Contents/Resources/
102         Rez /Developer/Headers/FlatCarbon/Types.r $(srcdir)/vlc.r -o ./VLC\ Plugin.plugin/Contents/Resources/Vlc\ Plugin.rsrc
103         mkdir ./VLC\ Plugin.plugin/Contents/MacOS/modules
104         cp -r $(top_builddir)/VLC.app/Contents/MacOS/modules/* ./VLC\ Plugin.plugin/Contents/MacOS/modules/
105 endif
106 endif
107
108 ###############################################################################
109 # Stamp rules
110 ###############################################################################
111 clean: clean-stamp clean-bundle
112 clean-stamp:
113         rm -f stamp-pic
114
115 stamp-pic: FORCE
116         @for dep in "" `$(VLC_CONFIG) --target builtin $(pic)`; do \
117           if test "$${dep}" -nt "$(LIBRARIES_mozilla)"; then \
118             rm -f $@; \
119             break; \
120           fi; \
121         done
122         @if test ! -f $@; then printf "" > $@; fi
123
124 clean-bundle:
125         rm -rf ./VLC\ Plugin.plugin
126
127 ###############################################################################
128 # Force rule
129 ###############################################################################
130 FORCE: