svn merge -r 22571:22800 https://svn.blender.org/svnroot/bf-blender/trunk/blender
[blender-staging.git] / source / nan_compile.mk
index fd7960dff24038029ce75e9dea72e01f5024be3c..4a4e472fa66f56a15f46963c1f815c661fcea7a6 100644 (file)
@@ -1,3 +1,5 @@
+# -*- mode: gnumakefile; tab-width: 8; indent-tabs-mode: t; -*-
+# vim: tabstop=8
 #
 # $Id$
 #
@@ -22,7 +24,7 @@
 #
 # The Original Code is: all of this file.
 #
-# Contributor(s): none yet.
+# Contributor(s): GSR
 #
 # ***** END GPL LICENSE BLOCK *****
 #
@@ -37,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)
@@ -59,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++
@@ -84,7 +79,7 @@ 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_CFLAGS += -O
 #    REL_CCFLAGS       += -O2
     CPPFLAGS   += -D_THREAD_SAFE
     NAN_DEPEND = true
@@ -115,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)
@@ -168,10 +175,17 @@ 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
@@ -179,6 +193,7 @@ ifeq ($(OS),solaris)
 #    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"
 
+    # 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
@@ -195,7 +210,8 @@ ifeq ($(OS),solaris)
         JAVA_HEADERS = /usr/java/include
         JAVA_SYSTEM_HEADERS = /usr/java/include/solaris
     else
-        OPENGL_HEADERS = $(LCGDIR)/mesa/include
+        # OPENGL_HEADERS = /usr/X11/include/mesa
+       OPENGL_HEADERS = /usr/X11/include/
     endif
     AR = ar
     ARFLAGS = ruv