]> git.sesse.net Git - vlc/blobdiff - Makefile.am
use *$(LIBEXT) and not *.so in package-win32 and package-beos targets. Also
[vlc] / Makefile.am
index 2d7587ecebb9faf4c3427bbcbed65421892792de..2dcffe8dcde239bc70b9e6758e7faf61b2271916 100644 (file)
@@ -8,13 +8,14 @@
 SUBDIRS = po intl m4 share
 DIST_SUBDIRS = $(SUBDIRS) modules src debian doc ipkg lib
 
-EXTRA_DIST = BUGS FAQ HACKING MAINTAINERS STATUS \
+EXTRA_DIST = FAQ HACKING MAINTAINERS STATUS src/extras/COPYING \
              INSTALL.win32 README.MacOSX.rtf vlc.spec install-win32 \
              Modules.am macosx-dmg \
              configure.ac.in mkinstalldirs bootstrap
 MOSTLYCLEANFILES =
 BUILT_SOURCES =
 SUFFIXES = 
+NULL =
 
 # List of programs, libraries and headers that need to be built and/or
 # distributed. Initialized to empty because we'll use += later.
@@ -93,7 +94,7 @@ if RELEASE
 CPPFLAGS_release = -DHAVE_RELEASE
 endif
 if DEBUG
-CPPFLAGS_debug = -DDEBUG -DHAVE_RELEASE
+CPPFLAGS_debug = -DDEBUG
 CFLAGS_debug = -g
 endif
 if GPROF
@@ -134,7 +135,8 @@ OBJCFLAGS_default += $(CFLAGS_optim) $(CFLAGS_nodebug) \
 BUILT_SOURCES += \
        include/vlc_symbols.h \
        src/misc/modules_builtin.h \
-       src/misc/modules_plugin.h
+       src/misc/modules_plugin.h \
+       $(NULL)
 
 pkgincludedir = $(includedir)/vlc
 
@@ -145,7 +147,8 @@ dist_pkginclude_HEADERS = \
        include/vlc/sout.h \
        include/vlc/decoder.h \
        include/vlc/input.h \
-       include/vlc/intf.h
+       include/vlc/intf.h \
+       $(NULL)
 
 noinst_HEADERS += $(HEADERS_include) $(HEADERS_include_built)
 
@@ -155,6 +158,7 @@ HEADERS_include = \
        include/beos_specific.h \
        include/configuration.h \
        include/darwin_specific.h \
+       include/codecs.h \
        include/error.h \
        include/input_ext-dec.h \
        include/input_ext-intf.h \
@@ -183,10 +187,12 @@ HEADERS_include = \
        include/vlc_playlist.h \
        include/vlc_threads.h \
        include/vlc_threads_funcs.h \
-       include/win32_specific.h
+       include/win32_specific.h \
+       $(NULL)
 
 HEADERS_include_built = \
-       include/vlc_symbols.h
+       include/vlc_symbols.h \
+       $(NULL)
 
 include/vlc_symbols.h: Makefile $(HEADERS_include)
        rm -f $@.in
@@ -227,20 +233,6 @@ endif
 $(SOURCES): include/vlc_symbols.h
 $(SOURCES_libvlc): src/misc/modules_plugin.h src/misc/modules_builtin.h $(LIB_intl)
 
-###############################################################################
-# Optional getopt
-###############################################################################
-
-EXTRA_DIST += \
-       extras/GNUgetopt/COPYING \
-       extras/GNUgetopt/getopt.c \
-       extras/GNUgetopt/getopt.h \
-       extras/GNUgetopt/getopt1.c
-
-if BUILD_GETOPT
-SOURCES_libgetopt = extras/GNUgetopt/getopt.c extras/GNUgetopt/getopt1.c
-endif
-
 ###############################################################################
 # Optional libintl - FIXME, bad dependencies
 ###############################################################################
@@ -268,12 +260,47 @@ EXTRA_DIST += \
        extras/MacOSX/Resources/mpeg2.icns \
        extras/MacOSX/Resources/mpeg4.icns \
        extras/MacOSX/Resources/vlc.icns \
+       extras/MacOSX/Resources/back.png \
+       extras/MacOSX/Resources/begin.png \
+       extras/MacOSX/Resources/end.png \
+       extras/MacOSX/Resources/forw.png \
+       extras/MacOSX/Resources/list.png \
        extras/MacOSX/Resources/pause.png \
        extras/MacOSX/Resources/play.png \
+       extras/MacOSX/Resources/prefs.png \
        extras/MacOSX/Resources/stop.png \
-       extras/MacOSX/Resources/stepf.png \
-       extras/MacOSX/Resources/stepr.png \
-       extras/MacOSX/vlc.pbproj/project.pbxproj
+       extras/MacOSX/Resources/vlc_hg.png \
+       extras/MacOSX/vlc.pbproj/project.pbxproj \
+       $(NULL)
+
+###############################################################################
+# MS Visual Studio and eMbedded Visual Studio projects
+###############################################################################
+
+EXTRA_DIST += \
+       msvc/vlc.dsw \
+       msvc/libvlc.dsp.in \
+       msvc/plugins.dsp.in \
+       msvc/vlc.dsp.in \
+       msvc/config.h \
+       msvc/modules_builtin_msvc.h \
+       evc/vlc.vcw \
+       evc/libvlc.vcp.in \
+       evc/vlc.vcp.in \
+       evc/plugins.vcp.in \
+       evc/vlc.c \
+       evc/config.h \
+       evc/modules_builtin_evc.h \
+       $(NULL)
+
+show-libvlc-sources: FORCE
+       @echo X: $(SOURCES_libvlc_common) $(SOURCES_libvlc_win32) $(SOURCES_libvlc_dirent) $(SOURCES_libvlc_getopt)
+
+show-libvlc-headers: FORCE
+       @echo X: $(HEADERS_include) $(HEADERS_include_built)
+
+show-libvlc-pkg-headers: FORCE
+       @echo X: $(dist_pkginclude_HEADERS)
 
 ###############################################################################
 # Building libvlc
@@ -286,30 +313,64 @@ lib_LIBRARIES += lib/libvlc.a $(LIBRARIES_libvlc_pic)
 lib_libvlc_a_SOURCES = $(SOURCES_libvlc)
 lib_libvlc_a_CFLAGS = $(CPPFLAGS_default) -D__VLC__ $(CFLAGS_default) @CFLAGS_vlc@
 lib_libvlc_a_CXXFLAGS = $(CPPFLAGS_default) -D__VLC__ $(CXXFLAGS_default)
+lib_libvlc_a_OBJCFLAGS = $(CPPFLAGS_default) -D__VLC__ $(OBJCFLAGS_default)
 
 lib_libvlc_pic_a_SOURCES = $(SOURCES_libvlc)
 lib_libvlc_pic_a_CFLAGS = $(CPPFLAGS_pic) -D__VLC__ $(CFLAGS_pic) @CFLAGS_vlc@
 lib_libvlc_pic_a_CXXFLAGS = $(CPPFLAGS_pic) -D__VLC__ $(CXXFLAGS_pic)
+lib_libvlc_pic_a_OBJCFLAGS = $(CPPFLAGS_pic) -D__VLC__ $(OBJCFLAGS_pic)
 
 if HAVE_BEOS
-SOURCES_libvlc_beos = src/misc/beos_specific.cpp
+OPT_SOURCES_libvlc_beos = $(SOURCES_libvlc_beos)
 endif
 if HAVE_DARWIN
-SOURCES_libvlc_darwin = src/misc/darwin_specific.c
+OPT_SOURCES_libvlc_darwin = $(SOURCES_libvlc_darwin)
 endif
 if HAVE_WIN32
-SOURCES_libvlc_win32 = src/misc/win32_specific.c
+OPT_SOURCES_libvlc_win32 = $(SOURCES_libvlc_win32)
+endif
+if BUILD_DIRENT
+OPT_SOURCES_libvlc_dirent = $(SOURCES_libvlc_dirent)
+endif
+if BUILD_GETOPT
+OPT_SOURCES_libvlc_getopt = $(SOURCES_libvlc_getopt)
 endif
 if BUILD_MOZILLA
 LIBRARIES_libvlc_pic = lib/libvlc_pic.a
 endif
 
 EXTRA_DIST += \
+       $(SOURCES_libvlc_beos) \
+       $(SOURCES_libvlc_darwin) \
+       $(SOURCES_libvlc_win32) \
+       $(SOURCES_libvlc_dirent) \
+       $(SOURCES_libvlc_getopt) \
+       $(NULL)
+
+SOURCES_libvlc_beos = \
        src/misc/beos_specific.cpp \
-       src/misc/darwin_specific.c \
-       src/misc/win32_specific.c
+       $(NULL)
 
-SOURCES_libvlc = \
+SOURCES_libvlc_darwin = \
+       src/misc/darwin_specific.m \
+       $(NULL)
+
+SOURCES_libvlc_win32 = \
+       src/misc/win32_specific.c \
+       $(NULL)
+
+SOURCES_libvlc_dirent = \
+       src/extras/dirent.c \
+       src/extras/dirent.h \
+       $(NULL)
+
+SOURCES_libvlc_getopt = \
+       src/extras/getopt.c \
+       src/extras/getopt.h \
+       src/extras/getopt1.c \
+       $(NULL)
+
+SOURCES_libvlc_common = \
        src/libvlc.c \
        src/libvlc.h \
        src/interface/interface.c \
@@ -344,15 +405,22 @@ SOURCES_libvlc = \
        src/misc/configuration.c \
        src/misc/netutils.c \
        src/misc/iso_lang.c \
-       src/misc/iso-639.def \
+       src/misc/iso-639_def.h \
        src/misc/messages.c \
        src/misc/objects.c \
        src/misc/variables.c \
        src/misc/error.c \
-       src/misc/extras.c \
-       $(SOURCES_libvlc_win32) \
-       $(SOURCES_libvlc_beos) \
-       $(SOURCES_libvlc_darwin)
+       src/extras/libc.c \
+       $(NULL)
+
+SOURCES_libvlc = \
+       $(SOURCES_libvlc_common) \
+       $(OPT_SOURCES_libvlc_beos) \
+       $(OPT_SOURCES_libvlc_darwin) \
+       $(OPT_SOURCES_libvlc_win32) \
+       $(OPT_SOURCES_libvlc_dirent) \
+       $(OPT_SOURCES_libvlc_getopt) \
+       $(NULL)
 
 ###############################################################################
 # Building vlc
@@ -360,7 +428,7 @@ SOURCES_libvlc = \
 
 bin_PROGRAMS += vlc
 
-vlc_SOURCES = src/vlc.c $(SOURCES_libgetopt)
+vlc_SOURCES = src/vlc.c
 
 # @AUTOMAKE_SUCKS@ gets expanded to $(L_builtin) $(LDFLAGS_builtin)
 # but we don't write it directly, otherwise automake will go amok and eat all
@@ -392,15 +460,24 @@ if HAVE_DARWIN
 # Create the MacOS X app
 vlc_app_DATA = vlc.app
 vlc_appdir = $(bindir)
-vlc.app: vlc
+vlc.app: vlc $(PLUGIN_FILES)
        rm -Rf vlc.app
        cd extras/MacOSX ; pbxbuild | grep -v '^[ \t]' | grep -v "^$$"
        cp -r extras/MacOSX/build/vlc.bundle ./vlc.app
-       $(INSTALL) -d vlc.app/Contents/MacOS/share
-       $(INSTALL) -d vlc.app/Contents/MacOS/modules
+       $(INSTALL) -d vlc.app/Contents/MacOS
        $(INSTALL) vlc vlc.app/Contents/MacOS/
-#      FIXME: install modules ! (and add dependency on modules)
+       $(INSTALL) -d vlc.app/Contents/MacOS/modules
+       for i in dummy $(PLUGIN_FILES) ; do if test "x$$i" != "xdummy" ; then \
+               $(INSTALL) $$i vlc.app/Contents/MacOS/modules/ ; \
+       fi ; done
+       $(INSTALL) -d vlc.app/Contents/MacOS/share
        $(INSTALL) -m 644 share/*.psf vlc.app/Contents/MacOS/share
+       $(INSTALL) -d vlc.app/Contents/MacOS/locale
+       for i in $(CATALOGS); do \
+               mkdir -p vlc.app/Contents/MacOS/locale/$${i%.gmo}/LC_MESSAGES ; \
+               cp po/$$i vlc.app/Contents/MacOS/locale/$${i%.gmo}/LC_MESSAGES/vlc.mo ; \
+       done
+       echo -n "APPLVLC#" >| vlc.app/Contents/PkgInfo
 endif
 
 if HAVE_WIN32
@@ -408,9 +485,95 @@ DATA_win32_rc = $(noinst_share_vlc_win32_rc_DATA)
 noinst_share_vlc_win32_rc_DATA = share/vlc_win32_rc.$(OBJEXT)
 noinst_share_vlc_win32_rcdir = $(libdir)
 share/vlc_win32_rc.$(OBJEXT): share/vlc_win32_rc.rc
-       $(WINDRES) -i $< -o $@
+       $(WINDRES) --include-dir share -i $< -o $@
 endif
 
+###############################################################################
+# Building architecture-specific binary packages
+###############################################################################
+
+# XXX: this rule is probably only useful to you if you have exactly
+# the same setup as me. Contact sam@zoy.org if you need to use it.
+#
+# Check that tmp isn't in the way
+package-win32:
+       @if test -e tmp; then \
+               echo "Error: please remove ./tmp, it is in the way"; false; \
+       else \
+               echo "OK."; mkdir tmp; \
+       fi
+# Create installation script
+       cp install-win32 tmp/nsi
+# Copy relevant files
+       cp vlc.exe tmp/ 
+       $(STRIP) tmp/vlc.exe
+       cp INSTALL.win32 tmp/INSTALL.txt ; unix2dos tmp/INSTALL.txt
+       for file in AUTHORS COPYING ChangeLog README FAQ ; \
+                       do cp $$file tmp/$${file}.txt ; \
+                       unix2dos tmp/$${file}.txt ; done
+       mkdir tmp/plugins
+       for i in dummy $(PLUGIN_FILES) ; do if test "x$$i" != "xdummy" ; then \
+               $(INSTALL) $$i tmp/plugins/ ; \
+       fi ; done
+# don't include these two
+#rm -f tmp/plugins/gtk.so tmp/plugins/sdl.so
+       for i in dummy tmp/plugins/*$(LIBEXT) ; do if test $$i != tmp/plugins/intfwin.so -a $$i != dummy ; then $(STRIP) $$i ; fi ; done
+       mkdir tmp/share
+       for file in default8x16.psf default8x9.psf ; \
+               do cp share/$$file tmp/share/ ; done
+# Create package 
+       wine ~/.wine/fake_windows/Program\ Files/NSIS/makensis.exe -- /DVERSION=${VERSION} tmp/nsi
+# Clean up
+       rm -Rf tmp
+
+package-beos:
+# Check that tmp isn't in the way
+       @if test -e tmp; then \
+               echo "Error: please remove ./tmp, it is in the way"; false; \
+       else \
+               echo "OK."; mkdir tmp; \
+       fi
+       
+# Create dir
+       mkdir -p tmp/vlc/share
+# Copy relevant files
+       cp vlc tmp/vlc/
+       $(STRIP) tmp/vlc/vlc
+       xres -o tmp/vlc/vlc ./share/vlc_beos.rsrc
+       cp AUTHORS COPYING ChangeLog README FAQ tmp/vlc/
+       for file in default8x16.psf default8x9.psf ; \
+               do cp share/$$file tmp/vlc/share/ ; done
+       mkdir tmp/vlc/plugins
+       for i in dummy $(PLUGIN_FILES) ; do if test "x$$i" != "xdummy" ; then \
+               $(INSTALL) $$i tmp/vlc/plugins/ ; \
+       fi ; done
+       for i in dummy tmp/vlc/plugins/*$(LIBEXT) ; do if test $$i != dummy ; then $(STRIP) $$i ; fi ; done
+# Create package 
+       mv tmp/vlc tmp/vlc-${VERSION}
+       (cd tmp ; find vlc-${VERSION} | \
+       zip -9 -@ vlc-${VERSION}-BeOS-x86.zip )
+       mv tmp/vlc-${VERSION}-BeOS-x86.zip .
+# Clean up
+       rm -Rf tmp
+
+package-macosx:
+# Check that tmp isn't in the way
+       @if test -e tmp; then \
+               echo "Error: please remove ./tmp, it is in the way"; false; \
+       else \
+               echo "OK."; mkdir tmp; \
+       fi
+
+# Copy relevant files 
+       cp -R vlc.app tmp/
+       cp AUTHORS COPYING ChangeLog README README.MacOSX.rtf FAQ tmp/
+
+# Create disk image 
+       ./macosx-dmg 18 "vlc-${VERSION}" tmp/* 
+
+# Clean up
+       rm -Rf tmp
+
 ###############################################################################
 # Building the Mozilla plugin
 ###############################################################################
@@ -431,7 +594,8 @@ SOURCES_mozilla = \
        mozilla/vlcpeer.h \
        mozilla/classinfo.h \
        $(SOURCES_mozilla_win32) \
-       $(SOURCES_mozilla_unix)
+       $(SOURCES_mozilla_unix) \
+       $(NULL)
 
 # Under Win32, Mozilla plugins need to be named NP******.DLL, but under Unix
 # the common naming scheme is lib******plugin.so. Also, we need npwin.cpp
@@ -446,25 +610,28 @@ SOURCES_mozilla_unix = mozilla/npunix.c
 endif
 
 if BUILD_MOZILLA
-noinst_LIBRARIES_mozilla = mozilla/libvlcplugin.a
-
-mozilla_libvlcplugin_a_SOURCES = $(SOURCES_mozilla) $(BUILT_SOURCES_mozilla) \
-                                 $(SOURCES_libgetopt)
-mozilla_libvlcplugin_a_CFLAGS = $(CPPFLAGS_pic) $(CFLAGS_pic) \
-                                $(CPPFLAGS_mozilla) $(CFLAGS_mozilla) \
-                                $(CPPFLAGS_mozilla_EXTRA)
-mozilla_libvlcplugin_a_CXXFLAGS = $(CPPFLAGS_pic) $(CXXFLAGS_pic) \
-                                  $(CPPFLAGS_mozilla) $(CXXFLAGS_mozilla) \
-                                  $(CPPFLAGS_mozilla_EXTRA)
-mozilla_libvlcplugin_a_DEPENDENCIES = lib/libvlc_pic.a $(L_builtin_pic) $(DATA_npvlc_rc)
+if UNTRUE
+noinst_LIBRARIES_mozilla = mozilla/libplugin.a
+endif
+
+mozilla_libplugin_a_SOURCES = $(SOURCES_mozilla)
+mozilla_libplugin_a_CFLAGS = $(CPPFLAGS_pic) $(CFLAGS_pic) \
+                             $(CPPFLAGS_mozilla) $(CFLAGS_mozilla) \
+                             $(CPPFLAGS_mozilla_EXTRA)
+mozilla_libplugin_a_CXXFLAGS = $(CPPFLAGS_pic) $(CXXFLAGS_pic) \
+                               $(CPPFLAGS_mozilla) $(CXXFLAGS_mozilla) \
+                               $(CPPFLAGS_mozilla_EXTRA)
+mozilla_libplugin_a_DEPENDENCIES = lib/libvlc_pic.a $(L_builtin_pic) $(DATA_npvlc_rc)
 
 BUILT_SOURCES_mozilla = mozilla/vlcintf.h
 $(SOURCES_mozilla): mozilla/vlcintf.h
 
 mozilla_plugin_DATA = $(LIBRARIES_mozilla)
 mozilla_plugindir = $(libdir)/mozilla/plugins
-$(LIBRARIES_mozilla): mozilla/libvlcplugin.a $(L_builtin_pic)
-       $(CXXLINK) -o $@ $(mozilla_libvlcplugin_a_OBJECTS) $(DATA_npvlc_rc) \
+$(LIBRARIES_mozilla): $(mozilla_libplugin_a_OBJECTS) \
+                      $(mozilla_libplugin_a_DEPENDENCIES) \
+                      $(L_builtin_pic)
+       $(CXXLINK) $(mozilla_libplugin_a_OBJECTS) $(DATA_npvlc_rc) \
                lib/libvlc_pic.a $(L_builtin_pic) -shared $(LDFLAGS) \
                $(LDFLAGS_vlc) $(LDFLAGS_mozilla) $(LDFLAGS_builtin_pic)
 
@@ -483,13 +650,16 @@ DATA_npvlc_rc = $(noinst_mozilla_npvlc_rc_DATA)
 noinst_mozilla_npvlc_rc_DATA = mozilla/npvlc_rc.$(OBJEXT)
 noinst_mozilla_npvlc_rcdir = $(libdir)
 mozilla/npvlc_rc.$(OBJEXT): mozilla/npvlc_rc.rc
-       $(WINDRES) -i $< -o $@
+       $(WINDRES) --include-dir mozilla -i $< -o $@
 endif
 endif
 
 ###############################################################################
 # Modules
 ###############################################################################
+MOSTLYCLEANFILES += $(PLUGIN_FILES)
+PLUGIN_FILES =
+
 libvlcdir = $(libdir)/vlc
 
 include Modules.am