blender/source/nan_link.mk

195 lines
5.4 KiB
Makefile
Raw Normal View History

# -*- mode: gnumakefile; tab-width: 8; indent-tabs-mode: t; -*-
# vim: tabstop=8
2002-10-12 11:37:38 +00:00
#
# $Id$
#
# ***** BEGIN GPL LICENSE BLOCK *****
2002-10-12 11:37:38 +00:00
#
# 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.
2002-10-12 11:37:38 +00:00
#
# 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,
2010-02-12 13:34:04 +00:00
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
2002-10-12 11:37:38 +00:00
#
# The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
# All rights reserved.
#
# The Original Code is: all of this file.
#
# Contributor(s): GSR
2002-10-12 11:37:38 +00:00
#
# ***** END GPL LICENSE BLOCK *****
2002-10-12 11:37:38 +00:00
#
# linking only
include nan_definitions.mk
ifdef NAN_DEBUG
LDFLAGS += $(NAN_DEBUG)
endif
2009-08-15 23:42:16 +00:00
DBG_LDFLAGS += -g
2002-10-12 11:37:38 +00:00
ifneq (x$(DEBUG_DIR), x)
LDFLAGS+=$(DBG_LDFLAGS)
else
LDFLAGS+=$(REL_LDFLAGS)
endif
######################## OS dependencies (alphabetic!) ################
# default (overriden by windows)
2002-10-12 11:37:38 +00:00
SOEXT = .so
ifeq ($(OS),darwin)
LLIBS += -lGLU -lGL
LLIBS += -lz -lstdc++
ifdef USE_OSX10.4STUBS
2006-01-10 06:29:57 +00:00
LLIBS +=-lSystemStubs
endif
ifeq ($(WITH_COCOA), true)
LLIBS += -framework Cocoa
endif
LLIBS += -framework Carbon -framework AGL -framework OpenGL
OS X Makefiles: * added some new variables (mostly the same as with scons): - USE_COCOA: use Cocoa for ghost (defaults to true) - MACOSX_ARCHITECTURE: can be ppc, ppc64, i386, x86_64. By default this is the host architecture (ppc for PowerPC Macs, i386 for Intel Macs). In theory this allows to cross compile blender for a different architecture, though cross compilation only works on Intel Macs, because makesdna and makesrna are built for the target architecture. For a 64 bit build, set MACOSX_ARCHITECTURE to x86_64 (Intel) or ppc64 (PowerPC). - MACOSX_MIN_VERS: minimum OS X version to run blender on (10.4 for 32 bit builds, 10.5 for 64 bit builds) - MACOSX_DEPLOYMENT_TARGET: needed by the linker to create an Application targeted for a specific OS version (defaults to 10.4 for 32 bit builds, 10.5 for 64 bit builds) - MACOSX_SDK: path to a specific SDK. currently not used - USE_QTKIT: use QTKit instead of QuickTime (defaults to true for 64 bit builds, as using QTKit is mandatory in that case)) * use the same compiler flags as scons * default compiler now is gcc-4.0 when building for 10.4 and gcc-4.2 when building for 10.5 * extract $(LCGDIR)/release/python_$(MACOSX_ARCHITECTURE).zip to Application bundle. This might break building on 10.4, to fix that, rename $(LCGDIR)/release/python.zip When compiling blender, only MACOSX_ARCHITECTURE might be of interest, as it allows doing 64 bit builds (or 32 bit PowerPC builds on Intel). All other variables are then set to reasonable defaults. For current users of the Makefile system, this commit shouldn't change much.
2010-01-03 20:35:13 +00:00
ifeq ($(WITH_QUICKTIME), true)
ifeq ($(USE_QTKIT), true)
LLIBS += -framework QTKit
else
LLIBS += -framework QuickTime
endif
endif
LLIBS += -framework CoreAudio
LLIBS += -framework AudioUnit -framework AudioToolbox
2002-10-12 11:37:38 +00:00
LDFLAGS += -L/System/Library/Frameworks/OpenGL.framework/Libraries
OS X Makefiles: * added some new variables (mostly the same as with scons): - USE_COCOA: use Cocoa for ghost (defaults to true) - MACOSX_ARCHITECTURE: can be ppc, ppc64, i386, x86_64. By default this is the host architecture (ppc for PowerPC Macs, i386 for Intel Macs). In theory this allows to cross compile blender for a different architecture, though cross compilation only works on Intel Macs, because makesdna and makesrna are built for the target architecture. For a 64 bit build, set MACOSX_ARCHITECTURE to x86_64 (Intel) or ppc64 (PowerPC). - MACOSX_MIN_VERS: minimum OS X version to run blender on (10.4 for 32 bit builds, 10.5 for 64 bit builds) - MACOSX_DEPLOYMENT_TARGET: needed by the linker to create an Application targeted for a specific OS version (defaults to 10.4 for 32 bit builds, 10.5 for 64 bit builds) - MACOSX_SDK: path to a specific SDK. currently not used - USE_QTKIT: use QTKit instead of QuickTime (defaults to true for 64 bit builds, as using QTKit is mandatory in that case)) * use the same compiler flags as scons * default compiler now is gcc-4.0 when building for 10.4 and gcc-4.2 when building for 10.5 * extract $(LCGDIR)/release/python_$(MACOSX_ARCHITECTURE).zip to Application bundle. This might break building on 10.4, to fix that, rename $(LCGDIR)/release/python.zip When compiling blender, only MACOSX_ARCHITECTURE might be of interest, as it allows doing 64 bit builds (or 32 bit PowerPC builds on Intel). All other variables are then set to reasonable defaults. For current users of the Makefile system, this commit shouldn't change much.
2010-01-03 20:35:13 +00:00
# useful for crosscompiling
LDFLAGS += -arch $(MACOSX_ARCHITECTURE) #-isysroot $(MACOSX_SDK) -mmacosx-version-min=$(MACOSX_MIN_VERS)
2002-10-12 11:37:38 +00:00
DBG_LDFLAGS += -L/System/Library/Frameworks/OpenGL.framework/Libraries
endif
ifeq ($(OS),freebsd)
LLIBS = -L/usr/X11R6/lib -lX11 -lXmu -lXi -lm -lutil -lz -pthread -lc_r
2002-10-12 11:37:38 +00:00
DADD = -lGL -lGLU
DYNLDFLAGS = -shared $(LDFLAGS)
LOPTS = -Wl,--export-dynamic
2002-10-12 11:37:38 +00:00
endif
ifeq ($(OS),irix)
ifeq ($(IRIX_USE_GCC), true)
LDFLAGS += -mabi=n32 -mips4
DBG_LDFLAGS += -LD_LAYOUT:lgot_buffer=40
else
LDFLAGS += -n32 -mips3
LDFLAGS += -woff 84,171
endif
LLIBS = -lmovieGL -lGLU -lGL -lXmu -lXext -lXi -lX11 -lc -lm -ldmedia
LLIBS += -lcl -laudio
ifneq ($(IRIX_USE_GCC), true)
LLIBS += -lCio -ldb
endif
LLIBS += -lz -lpthread
2002-10-12 11:37:38 +00:00
DYNLDFLAGS = -shared $(LDFLAGS)
endif
ifeq ($(OS),linux)
ifeq ($(CPU),alpha)
COMMENT = "MESA 3.1"
LLIBS = -lGL -lGLU -L/usr/X11R6/lib/ -lXmu -lXext -lX11
LLIBS += -lc -lm -ldl -lutil
LOPTS = -export-dynamic
endif
2008-03-23 12:59:26 +00:00
ifeq ($(CPU),$(findstring $(CPU), "i386 x86_64 ia64 parisc64 powerpc sparc64"))
2002-10-12 11:37:38 +00:00
COMMENT = "MESA 3.1"
LLIBS = -L$(NAN_MESA)/lib -L/usr/X11R6/lib -lXmu -lXext -lX11 -lXi
LLIBS += -lutil -lc -lm -ldl -lpthread
LLIBS += -L$(NAN_PYTHON)/lib -Wl,-rpath -Wl,$(NAN_PYTHON)/lib -lpython$(NAN_PYTHON_VERSION)
2002-10-12 11:37:38 +00:00
LOPTS = -export-dynamic
DADD = -lGL -lGLU
SADD = $(NAN_MESA)/lib/libGL.a $(NAN_MESA)/lib/libGLU.a
DYNLDFLAGS = -shared $(LDFLAGS)
endif
LLIBS += -lz
endif
ifeq ($(OS),openbsd)
SADD = /usr/local/lib/libGL.a /usr/local/lib/libGLU.a
SADD += /usr/X11R6/lib/libXmu.a /usr/X11R6/lib/libXext.a
SADD += /usr/X11R6/lib/libX11.a /usr/lib/libm.a -pthread
endif
ifeq ($(OS),solaris)
ifeq (x86_64, $(findstring x86_64, $(CPU)))
LLIBS = -lrt
LLIBS += -L$(NAN_MESA)/lib/amd64
else
LLIBS += -L$(NAN_MESA)/lib
endif
LLIBS += $(NAN_ZLIB)/lib/libz.a -lGLU -lGL -lXmu -lXext -lXi -lX11 -lc -lm -ldl -lsocket -lnsl
2002-10-12 11:37:38 +00:00
DYNLDFLAGS = -shared $(LDFLAGS)
endif
ifeq ($(OS),windows)
EXT = .exe
2009-08-15 23:42:16 +00:00
SOEXT = .dll
ifeq ($(FREE_WINDOWS),true)
MINGWLIB = /usr/lib/w32api
LDFLAGS += -mwindows -mno-cygwin -mconsole
DADD += -L/usr/lib/w32api -lnetapi32 -lopengl32 -lglu32 -lshfolder
DADD += -L/usr/lib/w32api -lwinmm -lwsock32
else
2009-08-15 23:42:16 +00:00
DADD = kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib
DADD += advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib
DADD += vfw32.lib winmm.lib opengl32.lib glu32.lib largeint.lib dxguid.lib
DADD += libcmt.lib
LOPTS = /link
LOPTS += /NODEFAULTLIB:"libc"
LOPTS += /NODEFAULTLIB:"libcd"
LOPTS += /NODEFAULTLIB:"libcp"
LOPTS += /NODEFAULTLIB:"libcpd"
2010-04-20 15:46:28 +00:00
LOPTS += /NODEFAULTLIB:"python31"
2009-08-15 23:42:16 +00:00
LOPTS += /NODEFAULTLIB:"msvcrt"
LOPTS += /SUBSYSTEM:CONSOLE
LDFLAGS += /MT
DYNLDFLAGS = /LD
endif
2002-10-12 11:37:38 +00:00
endif
ifneq ($(OS), irix)
2003-07-16 23:53:09 +00:00
LLIBS += $(NAN_SDLLIBS)
endif
ifeq ($(WITH_ICONV),true)
LLIBS += $(NAN_ICONV_LIBS)
endif
ifeq ($(WITH_FFMPEG),true)
LLIBS += $(NAN_FFMPEGLIBS)
endif
ifeq ($(INTERNATIONAL),true)
LLIBS += $(NAN_GETTEXT_LIB)
endif
ifeq ($(WITH_BF_OPENMP),true)
LLIBS += -lgomp
endif
ifeq ($(WITH_FFTW3),true)
LLIBS += $(BF_FFTW3_LIBS)
endif
ifeq ($(WITH_OPENCOLLADA),true)
LLIBS += $(BF_OPENCOLLADA_LIBS)
endif
LLIBS += $(NAN_PYTHON_LIB)