]> git.sesse.net Git - vlc/blob - mozilla/Makefile.am
* mozilla/Makefile.am: Moved mozilla plugin generation directives here.
[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
33 SOURCES_macosx = support/npmac.cpp
34 else
35 LIBRARIES_mozilla = libvlcplugin$(LIBEXT)
36 SOURCES_unix = support/npunix.c
37 endif
38 endif
39
40 if BUILD_MOZILLA
41 if UNTRUE
42 noinst_LIBRARIES_mozilla = libplugin.a
43 endif
44
45 libplugin_a_SOURCES = $(SOURCES_mozilla)
46 libplugin_a_CFLAGS = `$(VLC_CONFIG) --cflags mozilla pic` \
47                      $(CPPFLAGS_mozilla_EXTRA) -Imozilla
48 libplugin_a_CXXFLAGS = `$(VLC_CONFIG) --cxxflags mozilla pic` \
49                        $(CPPFLAGS_mozilla_EXTRA) -Imozilla
50 libplugin_a_DEPENDENCIES = $(DATA_npvlc_rc)
51
52 BUILT_SOURCES_mozilla = vlcintf.h
53 $(SOURCES_mozilla): vlcintf.h
54
55 plugin_DATA = $(LIBRARIES_mozilla)
56 plugindir = $(libdir)/mozilla/plugins
57 $(LIBRARIES_mozilla): $(libplugin_a_OBJECTS) \
58                       $(libplugin_a_DEPENDENCIES) $(top_builddir)/stamp-pic
59         $(CXXLINK) $(libplugin_a_OBJECTS) $(DATA_npvlc_rc) \
60           $(top_builddir)/lib/libvlc_pic.a -shared \
61           `$(VLC_CONFIG) --libs vlc mozilla builtin pic`
62
63 vlcintf_xpt_DATA = vlcintf.xpt
64 vlcintf_xptdir = $(libdir)/mozilla/components
65 vlcintf.xpt: vlcintf.idl
66         $(XPIDL) -I/usr/share/idl/mozilla -I/usr/lib/mozilla/include/idl \
67           -m typelib -o vlcintf $(srcdir)/vlcintf.idl
68
69 vlcintf.h: vlcintf.idl
70         $(XPIDL) -I/usr/share/idl/mozilla -I/usr/lib/mozilla/include/idl \
71           -m header -o vlcintf $(srcdir)/vlcintf.idl
72
73 if HAVE_WIN32
74 DATA_npvlc_rc = $(noinst_npvlc_rc_DATA)
75 noinst_npvlc_rc_DATA = npvlc_rc.$(OBJEXT)
76 noinst_npvlc_rcdir = $(libdir)
77 npvlc_rc.$(OBJEXT): npvlc_rc.rc
78         $(WINDRES) --include-dir $(srcdir)/mozilla -i $< -o $@
79 endif
80 endif
81
82 ###############################################################################
83 # Stamp rules
84 ###############################################################################
85 clean: clean-stamp
86 clean-stamp:
87         rm -f stamp-pic
88
89 stamp-pic: FORCE
90         @for dep in "" `$(VLC_CONFIG) --target builtin pic`; do \
91           if test "$${dep}" -nt "$(LIBRARIES_mozilla)"; then \
92             rm -f $@; \
93             break; \
94           fi; \
95         done
96         @if test ! -f $@; then printf "" > $@; fi
97
98 ###############################################################################
99 # Force rule
100 ###############################################################################
101 FORCE: