svn merge -r 22571:22800 https://svn.blender.org/svnroot/bf-blender/trunk/blender
[blender-staging.git] / source / nan_compile.mk
index 192528aa5a68d1d8b02b7d3a3eb34eab3c5a0f23..4a4e472fa66f56a15f46963c1f815c661fcea7a6 100644 (file)
@@ -1,15 +1,14 @@
+# -*- mode: gnumakefile; tab-width: 8; indent-tabs-mode: t; -*-
+# vim: tabstop=8
 #
 # $Id$
 #
-# ***** BEGIN GPL/BL DUAL LICENSE BLOCK *****
+# ***** BEGIN GPL LICENSE BLOCK *****
 #
 # 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. The Blender
-# Foundation also sells licenses for use in proprietary software under
-# the Blender License.  See http://www.blender.org/BL/ for information
-# about this.
+# 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
@@ -25,9 +24,9 @@
 #
 # The Original Code is: all of this file.
 #
-# Contributor(s): none yet.
+# Contributor(s): GSR
 #
-# ***** END GPL/BL DUAL LICENSE BLOCK *****
+# ***** END GPL LICENSE BLOCK *****
 #
 # Compile and archive
 
@@ -40,16 +39,24 @@ CPPFLAGS ?= $(NAN_CPPFLAGS)
 # Uncomment next lines to enable integrated game engine
 ifneq ($(NAN_NO_KETSJI), true)
     CFLAGS  += -DGAMEBLENDER=1
-    CFLAGS  += -DUSE_SUMO_SOLID
-    CCFLAGS += -DUSE_SUMO_SOLID
     ifeq ($(NAN_USE_BULLET), true)
-      CFLAGS  += -DUSE_BULLET
-      CCFLAGS += -DUSE_BULLET
+      CFLAGS  += -DUSE_BULLET -DWITH_BULLET
+      CCFLAGS += -DUSE_BULLET -DWITH_BULLET
     endif
 else
    CPPFLAGS += -DNO_KETSJI
 endif
 
+ifeq ($(BF_PROFILE), true)
+    CFLAGS += -pg
+    CCFLAGS += -pg
+endif
+
+ifeq ($(WITH_BF_OPENMP), true)
+    CFLAGS += -fopenmp
+    CCFLAGS += -fopenmp
+endif
+
 ifdef NAN_DEBUG
     CFLAGS += $(NAN_DEBUG)
     CCFLAGS += $(NAN_DEBUG)
@@ -62,21 +69,6 @@ DBG_CCFLAGS  += -g
 
 # OS dependent parts ---------------------------------------------------
 
-ifeq ($(OS),beos)
-    CC = gcc
-    CCC        = g++
-    CFLAGS     += -pipe -fPIC -funsigned-char -fno-strict-aliasing
-    CCFLAGS    += -pipe -fPIC -funsigned-char -fno-strict-aliasing
-    REL_CFLAGS += -O2
-    REL_CCFLAGS        += -O2
-    NAN_DEPEND = true
-    OPENGL_HEADERS  = .
-    CPPFLAGS   += -D__BeOS
-    AR = ar
-    ARFLAGS = ruv
-    ARFLAGSQUIET = ru
-endif
-
 ifeq ($(OS),darwin)
     CC = gcc
     CCC        = g++
@@ -87,8 +79,8 @@ ifeq ($(OS),darwin)
         CFLAGS += -pipe -fPIC -ffast-math -march=pentium-m -funsigned-char -fno-strict-aliasing
         CCFLAGS        += -pipe -fPIC  -funsigned-char -fno-strict-aliasing
        endif
-    REL_CFLAGS += -O2
-    REL_CCFLAGS        += -O2
+#   REL_CFLAGS += -O
+#    REL_CCFLAGS       += -O2
     CPPFLAGS   += -D_THREAD_SAFE
     NAN_DEPEND = true
     OPENGL_HEADERS = /System/Library/Frameworks/OpenGL.framework
@@ -118,22 +110,34 @@ ifeq ($(OS),freebsd)
 endif
 
 ifeq ($(OS),irix)
-    CC = cc
-    CCC        = CC
-    CFLAGS     += -n32 -mips3 -Xcpluscomm
-    CCFLAGS    += -n32 -mips3 -Xcpluscomm -LANG:std
-ifdef MIPS73_ISOHEADERS
-    CCFLAGS    += -LANG:libc_in_namespace_std=off -I$(MIPS73_ISOHEADERS)
-else
-    CCFLAGS    += -LANG:libc_in_namespace_std=off
-endif
-    REL_CFLAGS += -n32 -mips3 -O2 -OPT:Olimit=0
-    REL_CCFLAGS += -n32 -mips3 -O2 -OPT:Olimit=0
+    ifeq ($(IRIX_USE_GCC),true)
+        CC = gcc
+        CCC = g++
+        CFLAGS += -fPIC -funsigned-char -fno-strict-aliasing -mabi=n32 -mips4
+        CCFLAGS += -fPIC -fpermissive -funsigned-char -fno-strict-aliasing -mabi=n32 -mips4
+        REL_CFLAGS += -O2
+        REL_CCFLAGS += -O2
+        CPPFLAGS += -DXP_UNIX
+        DBG_CFLAGS += -g3 -gdwarf-2 -ggdb
+        DBG_CCFLAGS += -g3 -gdwarf-2 -ggdb
+    else
+        CC = cc
+        CCC = CC
+        CFLAGS += -n32 -mips3 -Xcpluscomm
+        CCFLAGS        += -n32 -mips3 -Xcpluscomm -LANG:std
+        ifdef MIPS73_ISOHEADERS
+            CCFLAGS    += -LANG:libc_in_namespace_std=off -I$(MIPS73_ISOHEADERS)
+        else
+            CCFLAGS    += -LANG:libc_in_namespace_std=off
+        endif
+        REL_CFLAGS     += -n32 -mips3 -O2 -OPT:Olimit=0
+        REL_CCFLAGS += -n32 -mips3 -O2 -OPT:Olimit=0
+    endif
     OPENGL_HEADERS = /usr/include
     NAN_DEPEND = true
     AR = CC
     ARFLAGS = -ar -o
-       ARFLAGSQUIET = -ar -o
+    ARFLAGSQUIET = -ar -o
 endif
 
 ifeq ($(OS),linux)
@@ -171,27 +175,44 @@ ifeq ($(OS),openbsd)
 endif
 
 ifeq ($(OS),solaris)
-    CC = gcc
-    CCC = g++
-#    CC        = cc
-#    CCC = CC
+    # Adding gcc flag to $CC is not good, however if its not there makesdna wont build - Campbell
+    ifeq (x86_64, $(findstring x86_64, $(CPU)))
+        CC  = gcc -m64
+        CCC = g++ -m64
+    else
+        CC  = gcc
+        CCC = g++
+        #CC  = cc
+        #CCC = CC
+    endif
+    
     JAVAC = javac
     JAVAH = javah
     CFLAGS     += -pipe -fPIC -funsigned-char -fno-strict-aliasing
     CCFLAGS    += -pipe -fPIC -funsigned-char -fno-strict-aliasing
 #    CFLAGS    += "-fast -xdepend -xarch=v8plus -xO3 -xlibmil -KPIC -DPIC -xchar=unsigned"
 #    CCFLAGS   += "-fast -xdepend -xarch=v8plus -xO3 -xlibmil -xlibmopt -features=tmplife -norunpath -KPIC -DPIC -xchar=unsigned"
-    REL_CFLAGS += -O1
-    REL_CCFLAGS += -O1
+
+    # Note, you might still want to compile a 32 bit binary if you have a 64bit system. if so remove the following lines
+#    ifeq ($(findstring 64,$(CPU)), 64)
+#        CFLAGS        += -m64
+#        CCFLAGS       += -m64
+#    endif
+
+    REL_CFLAGS += -O2
+    REL_CCFLAGS        += -O2
+
     NAN_DEPEND = true
-  ifeq ($(CPU),sparc)
-    OPENGL_HEADERS = /usr/openwin/share/include
-    CPPFLAGS += -DSUN_OGL_NO_VERTEX_MACROS
-    JAVA_HEADERS = /usr/java/include
-    JAVA_SYSTEM_HEADERS = /usr/java/include/solaris
-  else
-    OPENGL_HEADERS = /usr/X11/include
-  endif
+#    ifeq ($(CPU),sparc)
+    ifeq ($(findstring sparc,$(CPU)), sparc)
+        OPENGL_HEADERS = /usr/openwin/share/include
+        CPPFLAGS += -DSUN_OGL_NO_VERTEX_MACROS
+        JAVA_HEADERS = /usr/java/include
+        JAVA_SYSTEM_HEADERS = /usr/java/include/solaris
+    else
+        # OPENGL_HEADERS = /usr/X11/include/mesa
+       OPENGL_HEADERS = /usr/X11/include/
+    endif
     AR = ar
     ARFLAGS = ruv
     ARFLAGSQUIET = ru