📄 makefile
字号:
#***************************************************************************# src/Makefile : Dearchive and compile all files necessary# ***************************************************************************# Copyright (C) 2003 - 2008 the VideoLAN team# $Id$## Authors: Christophe Massiot <massiot@via.ecp.fr># Derk-Jan Hartman <hartman at videolan dot org># Eric Petit <titer@m0k.org># Felix Paul Kühne <fkuehne@videolan.org># Christophe Mutricy <xtophe AT xtelevision.com># Gildas Bazin <gbazin at videolan dot org># Damien Fouilleul <damienf at videolan dot org># Jean-Baptiste Kempf <jb at videolan dot org>## This program is free software; you can redistribute it and/or modify# it under the terms of the GNU General Public License as published by# the Free Software Foundation; either version 2 of the License, or# (at your option) any later version.## This program is distributed in the hope that it will be useful,# but WITHOUT ANY WARRANTY; without even the implied warranty of# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the# GNU General Public License for more details.## You should have received a copy of the GNU General Public License# along with this program; if not, write to the Free Software# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.# ***************************************************************************include ../config.makinclude ./packages.mak# ***************************************************************************# Set a clean environment# ***************************************************************************export PATH := $(PREFIX)/bin:$(EXTRA_PATH):$(PATH)export PKG_CONFIG_PATHexport PKG_CONFIG_LIBDIR = $(PREFIX)/lib/pkgconfigexport MACOSX_DEPLOYMENT_TARGET = $(SDK_TARGET)export LIBRARY_PATH := $(PREFIX)/lib:$(LIBRARY_PATH)export CFLAGS = -I$(PREFIX)/include $(EXTRA_CFLAGS) $(EXTRA_CPPFLAGS)export CPPFLAGS = -I$(PREFIX)/include $(EXTRA_CFLAGS) $(EXTRA_CPPFLAGS)export CXXFLAGS = -I$(PREFIX)/include $(EXTRA_CFLAGS) $(EXTRA_CPPFLAGS)export LDFLAGS = -L$(PREFIX)/lib $(EXTRA_LDFLAGS)# ***************************************************************************# Cross compilation variables# We'll usually use --host=<platform>, except for a few libraries which# don't handle it (gotta set CC/CXX/etc), and obviously FFmpeg has its own# way of doing it... ;)# ***************************************************************************ifneq ($(CC),)HOSTCC+= CC="$(CC)"endififneq ($(CXX),)HOSTCC+= CXX="$(CXX)"endififneq ($(LD),)HOSTCC+= LD="$(LD)"endififneq ($(RANLIB),)HOSTCC+= RANLIB="$(RANLIB)"endififneq ($(AR),)HOSTCC+= AR="$(AR)"endififneq ($(STRIP),)HOSTCC+= STRIP="$(STRIP)"endif# Define ranlib on non-cross compilation setupsifeq ($(RANLIB),)RANLIB=ranlibendif# For libebml/libmatroska. Grrr.ifneq ($(AR),)HOSTCC2=$(HOSTCC) AR="$(AR) rcvu"elseHOSTCC2=$(HOSTCC)endif# For ffmpeg if not cross compilingifneq ($(CC),) FFMPEGCONF=--cc="$(CC)"endif## cross compiling##This should be inside the if block but some config scripts are buggyHOSTCONF=--target=$(HOST) --host=$(HOST) --build=$(BUILD) --program-prefix=""ifneq ($(BUILD),$(HOST)) # # Compiling for MinGW under Cygwin could be deemed as cross compiling # unfortunately there isn't a complete separate GCC toolchain for MinGW under Cygwin # ifndef HAVE_CYGWIN # We are REALLY cross compiling FFMPEGCONF=--cross-prefix=$(HOST)- --enable-cross-compile X264CONF=--host=$(HOST) PTHREADSCONF="CROSS=$(HOST)-" else # We are compiling for MinGW on Cygwin PTHREADSCONF=$(HOSTCC) endifendif## Special target-dependant options#ifdef HAVE_WIN32HOSTCONF+= --without-pic --disable-shared --enable-msw --with-included-opencdk --with-included-libtasn1 --disable-dependency-trackingFFMPEGCONF+= --target-os=mingw32 --enable-memalign-hack --cpu=i686 --arch=i686 --disable-debugendififdef HAVE_WINCEHOSTCONF+= --without-pic --disable-sharedFFMPEGCONF+= --enable-mingwce --cpu=armv4l --disable-debug --disable-encoders --disable-muxers --disable-mpegaudio-hp --disable-decoder=snow --disable-decoder=vc9 --disable-decoder=wmv3 --disable-decoder=vorbis --disable-decoder=dvdsub --disable-decoder=dvbsub --disable-protocolsendififdef HAVE_UCLIBCifdef HAVE_BIGENDIANFFMPEGCONF+= --arch=armeb --enable-armv5te --enable-iwmmxtelseFFMPEGCONF+= --arch=armv4lendifFFMPEGCONF+= --enable-small --disable-debug --disable-mpegaudio-hpFFMPEG_CFLAGS += -DHAVE_LRINTF --std=c99elseFFMPEGCONF+= --enable-libmp3lame --enable-libfaac --enable-swscaleendififdef HAVE_BEOSFFMPEGCONF+= --cpu=x86 --disable-debug --disable-audio-beosendififdef HAVE_DARWIN_OS_ON_INTELFFMPEGCONF += --enable-memalign-hack --cpu=pentium-mendififdef NO_TEXT_RELOCATIONFFMPEGCONF += --disable-mmxendififdef HAVE_DARWIN_OSX264CONF += --enable-picifdef HAVE_DARWIN_OS_ON_INTELFFMPEG_CFLAGS += -DHAVE_LRINTFelseFFMPEGCONF += --disable-altivecendifendififdef HAVE_AMRFFMPEGCONF+= --enable-libamr-nb --enable-libamr-wb --enable-nonfreeendifDATE=`date +%Y-%m-%d`# ***************************************************************************# Standard rules# ***************************************************************************# Generated by ./bootstrap from default configuration in src/Distributions# include ../distro.makFORCE:# ***************************************************************************# Useful macros# ***************************************************************************define EXTRACT_GZ rm -rf $@ || true gunzip -c $< | tar xf - --exclude='[*?:<>\|]' mv $(patsubst %.tar.gz,%,$(patsubst %.tgz,%,$(notdir $<))) $@ || true touch $@endefdefine EXTRACT_BZ2 rm -rf $@ || true bunzip2 -c $< | tar xf - --exclude='[*?:<>\|]' mv $(patsubst %.tar.bz2,%,$(notdir $<)) $@ || true touch $@endefdefine EXTRACT_ZIP rm -rf $@ || true unzip $< mv $(patsubst %.zip,%,$(notdir $<)) $@ || true touch $@endef### Darwin-specific #### These macros prepare the dynamic libraries for inclusion in the Mac OS X# bundle. For instance if you're building a library named libtoto.dylib,# which depends on the contrib library libtata.dylib, you should have the# following entry :# .toto: toto_directory .tata# cd $< ; ./configure --prefix=$(PREFIX)# $(MAKE) -C $<# $(MAKE) -C $< install# $(INSTALL_NAME)# touch $@ifeq ($(HOST),i586-pc-beos)# We test if the file actually exists, as sometimes (but not always)# libtool won't accept to build the shared librarydefine INSTALL_NAME if test -f $(PREFIX)/lib/lib$(patsubst .%,%,$@).so ; then \ mkdir -p $(PREFIX)/vlc-lib ; \ cp $(PREFIX)/lib/lib$(patsubst .%,%,$@).so \ $(PREFIX)/vlc-lib/ ; \ fiendefendif# ***************************************************************************# perl# ***************************************************************************ifeq ($(BUILD),i586-pc-beos)perl-$(PERL_VERSION).tar.gz: $(WGET) $(PERL_URL)perl: perl-$(PERL_VERSION).tar.gz $(EXTRACT_GZ) sed -i.orig 's%prefix="/boot/home/config"%prefix="$(PREFIX)"%' perl/hints/beos.sh.perl: perl (cd $<; ./Configure -d -e && make && make install && ln -sf perl5/$(PERL_VERSION)/BePC-beos/CORE/libperl.so $(PREFIX)/lib/libperl.so) touch $@CLEAN_FILE += .perlCLEAN_PKG += perlDISTCLEAN_PKG += perl-$(PERL_VERSION).tar.gzendif# ***************************************************************************# autoconf# ***************************************************************************autoconf-$(AUTOCONF_VERSION).tar.bz2: $(WGET) $(AUTOCONF_URL)autoconf: autoconf-$(AUTOCONF_VERSION).tar.bz2 $(EXTRACT_BZ2).autoconf: autoconf (cd $<; ./configure --prefix=$(PREFIX) && make && make install) touch $@CLEAN_FILE += .autoconfCLEAN_PKG += autoconfDISTCLEAN_PKG += autoconf-$(AUTOCONF_VERSION).tar.bz2# ***************************************************************************# gnumake# ***************************************************************************make-$(GNUMAKE_VERSION).tar.bz2: $(WGET) $(GNUMAKE_URL)gnumake: make-$(GNUMAKE_VERSION).tar.bz2 $(EXTRACT_BZ2).gnumake: gnumakeifdef HAVE_DARWIN_OSifndef HAVE_DARWIN_9 (cd $<; ./configure --prefix=$(PREFIX) && make && make install)endifendif touch $@CLEAN_FILE += .gnumakeCLEAN_PKG += gnumakeDISTCLEAN_PKG += make-$(GNUMAKE_VERSION).tar.bz2# ***************************************************************************# CMake# ***************************************************************************cmake-$(CMAKE_VERSION).tar.gz: $(WGET) $(CMAKE_URL)cmake: cmake-$(CMAKE_VERSION).tar.gz $(EXTRACT_GZ) #cmake:# cvs -d :pserver:anonymous:cmake@www.cmake.org:/cvsroot/CMake co -d cmake CMake.cmake: cmake (cd $<; ./configure --prefix=$(PREFIX) && make && make install) touch $@CLEAN_FILE += .cmakeCLEAN_PKG += cmake# ***************************************************************************# libtool# ***************************************************************************ifdef HAVE_DARWIN_OSlibtool-$(LIBTOOL_VERSION).tar.gz: $(WGET) $(LIBTOOL_URL)libtool: libtool-$(LIBTOOL_VERSION).tar.gz $(EXTRACT_GZ).libtool: libtool (cd $<; ./configure --prefix=$(PREFIX) && make && make install) ln -sf libtool $(PREFIX)/bin/glibtool ln -sf libtoolize $(PREFIX)/bin/glibtoolize touch $@CLEAN_PKG += libtoolDISTCLEAN_PKG += libtool-$(LIBTOOL_VERSION).tar.gzCLEAN_FILE += .libtoolendififeq ($(BUILD),i586-pc-beos)libtool-$(LIBTOOL_VERSION).tar.gz: $(WGET) $(LIBTOOL_URL)libtool: libtool-$(LIBTOOL_VERSION).tar.gz $(EXTRACT_GZ).libtool: libtool (cd $<; ./configure --prefix=$(PREFIX) && make && make install) touch $@CLEAN_PKG += libtoolDISTCLEAN_PKG += libtool-$(LIBTOOL_VERSION).tar.gzCLEAN_FILE += .libtoolendif# ***************************************************************************# automake# ***************************************************************************automake-$(AUTOMAKE_VERSION).tar.gz: $(WGET) $(AUTOMAKE_URL)automake: automake-$(AUTOMAKE_VERSION).tar.gz $(EXTRACT_GZ).automake: automake (cd $<; ./configure --prefix=$(PREFIX) && make && make install) touch $@CLEAN_FILE += .automakeCLEAN_PKG += automakeDISTCLEAN_PKG += automake-$(AUTOMAKE_VERSION).tar.gz# ***************************************************************************# pkgconfig# ***************************************************************************pkg-config-$(PKGCFG_VERSION).tar.gz: $(WGET) $(PKGCFG_URL)pkgconfig: pkg-config-$(PKGCFG_VERSION).tar.gz $(EXTRACT_GZ) patch -d pkgconfig/glib-1.2.8 -p 1 < Patches/glib.patch patch -d pkgconfig -p0 < Patches/pkgcfg.patch.pkgcfg: pkgconfig (cd pkgconfig; autoconf && ./configure --prefix=$(PREFIX) --disable-shared --enable-static && make && make install) touch $@CLEAN_FILE += .pkgcfgCLEAN_PKG += pkgconfigDISTCLEAN_PKG += pkg-config-$(PKGCFG_VERSION).tar.gz# ***************************************************************************# gettext# ***************************************************************************gettext-$(GETTEXT_VERSION).tar.gz: $(WGET) $(GETTEXT_URL)gettext: gettext-$(GETTEXT_VERSION).tar.gz $(EXTRACT_GZ)ifdef HAVE_WIN32 patch -p0 < Patches/gettext-win32.patchendififdef HAVE_DARWIN_OS patch -p0 < Patches/gettext-macosx.patchendif.intl: gettext .iconvifdef HAVE_WIN32 ( cd $< && $(HOSTCC) ./configure $(HOSTCONF) --prefix=$(PREFIX) --disable-relocatable --with-iconv-prefix=$(PREFIX) --disable-java --disable-native-java)else ( cd $< && $(HOSTCC) ./configure $(HOSTCONF) --prefix=$(PREFIX) --disable-java --disable-native-java --without-emacs)endififeq ($(BUILD),i586-pc-beos)# The ugliest kludge ever - so libtool correctly links shared libraries# on BeOS. Sorry, I just can't figure out how libtool works ( cd $< && for f in `find . -name libtool`; do sed -e 's/ -shared / -nostart /' -e 's/^predep_objects.*/predep_objects=""/' -i $$f; chmod +x $$f; done )endififneq ($(HOST),$(BUILD)) ifndef HAVE_CYGWIN # We'll use the installed gettext and only need to cross-compile libintl, also build autopoint and gettextsize tools need for VLC bootstrap ( cd $< && make -C gettext-runtime/intl && patch -p1 < ../Patches/libintl.patch && make -C gettext-runtime/intl install && make -C gettext-tools/misc install ) else # We are compiling for MinGW on Cygwin -- build the full current gettext ( cd $< && make && patch -p1 < ../Patches/libintl.patch && make install )
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -