Cleanup: use sections for editmesh tools/select
[blender.git] / GNUmakefile
index 1fda1a25a9266767ff6eca126803afb09da6a06d..46f0fa18eecf1e372be068067a4008fd693becd3 100644 (file)
@@ -1,4 +1,4 @@
-# -*- mode: gnumakefile; tab-width: 8; indent-tabs-mode: t; -*-
+# -*- mode: gnumakefile; tab-width: 4; indent-tabs-mode: t; -*-
 # vim: tabstop=4
 #
 # ##### BEGIN GPL LICENSE BLOCK #####
@@ -43,6 +43,16 @@ ifndef BUILD_DIR
        BUILD_DIR:=$(shell dirname "$(BLENDER_DIR)")/build_$(OS_NCASE)
 endif
 
+# Dependencies DIR's
+DEPS_SOURCE_DIR:=$(BLENDER_DIR)/build_files/build_environment
+DEPS_BUILD_DIR:=$(BUILD_DIR)/deps
+DEPS_INSTALL_DIR:=$(shell dirname "$(BLENDER_DIR)")/lib/$(OS_NCASE)
+
+ifneq ($(OS_NCASE),darwin)
+       # Add processor type to directory name
+       DEPS_INSTALL_DIR:=$(DEPS_INSTALL_DIR)_$(shell uname -p)
+endif
+
 # Allow to use alternative binary (pypy3, etc)
 ifndef PYTHON
        PYTHON:=python3
@@ -86,13 +96,7 @@ ifndef NPROCS
        ifeq ($(OS), Linux)
                NPROCS:=$(shell nproc)
        endif
-       ifeq ($(OS), Darwin)
-               NPROCS:=$(shell sysctl -n hw.ncpu)
-       endif
-       ifeq ($(OS), FreeBSD)
-               NPROCS:=$(shell sysctl -n hw.ncpu)
-       endif
-       ifeq ($(OS), NetBSD)
+       ifneq (,$(filter $(OS),Darwin FreeBSD NetBSD))
                NPROCS:=$(shell sysctl -n hw.ncpu)
        endif
 endif
@@ -104,7 +108,7 @@ endif
 CMAKE_CONFIG = cmake $(BUILD_CMAKE_ARGS) \
                      -H"$(BLENDER_DIR)" \
                      -B"$(BUILD_DIR)" \
-                     -DCMAKE_BUILD_TYPE:STRING=$(BUILD_TYPE)
+                     -DCMAKE_BUILD_TYPE_INIT:STRING=$(BUILD_TYPE)
 
 
 # -----------------------------------------------------------------------------
@@ -113,7 +117,7 @@ CMAKE_CONFIG = cmake $(BUILD_CMAKE_ARGS) \
 # X11 spesific
 ifdef DISPLAY
        CMAKE_CONFIG_TOOL = cmake-gui
-else 
+else
        CMAKE_CONFIG_TOOL = ccmake
 endif
 
@@ -127,7 +131,7 @@ all: .FORCE
 #      # if test ! -f $(BUILD_DIR)/CMakeCache.txt ; then \
 #      #       $(CMAKE_CONFIG); \
 #      # fi
-       
+
 #      # do this always incase of failed initial build, could be smarter here...
        @$(CMAKE_CONFIG)
 
@@ -146,6 +150,27 @@ cycles: all
 headless: all
 bpy: all
 
+# -----------------------------------------------------------------------------
+# Build dependencies
+DEPS_TARGET = install
+ifneq "$(findstring clean, $(MAKECMDGOALS))" ""
+       DEPS_TARGET = clean
+endif
+
+deps: .FORCE
+       @echo
+       @echo Configuring dependencies in \"$(DEPS_BUILD_DIR)\"
+
+       @cmake -H"$(DEPS_SOURCE_DIR)" \
+              -B"$(DEPS_BUILD_DIR)" \
+                  -DHARVEST_TARGET=$(DEPS_INSTALL_DIR)
+
+       @echo
+       @echo Building dependencies ...
+       $(MAKE) -C "$(DEPS_BUILD_DIR)" -s -j $(NPROCS) $(DEPS_TARGET)
+       @echo
+       @echo Dependencies successfully built and installed to $(DEPS_INSTALL_DIR).
+       @echo
 
 # -----------------------------------------------------------------------------
 # Configuration (save some cd'ing around)
@@ -164,6 +189,7 @@ help: .FORCE
        @echo "  * headless  - build without an interface (renderfarm or server automation)"
        @echo "  * cycles    - build Cycles standalone only, without Blender"
        @echo "  * bpy       - build as a python module which can be loaded from python directly"
+       @echo "  * deps      - build library dependencies (intended only for platform maintainers)"
        @echo ""
        @echo "  * config    - run cmake configuration tool to set build options"
        @echo ""
@@ -398,10 +424,16 @@ icons: .FORCE
        "$(BLENDER_DIR)/release/datafiles/prvicons_update.py"
 
 update: .FORCE
+       if [ "$(OS_NCASE)" == "darwin" ] && [ ! -d "../lib/$(OS_NCASE)" ]; then \
+               svn checkout https://svn.blender.org/svnroot/bf-blender/trunk/lib/$(OS_NCASE) ../lib/$(OS_NCASE) ; \
+       fi
        if [ -d "../lib" ]; then \
+               svn cleanup ../lib/* ; \
                svn update ../lib/* ; \
        fi
        git pull --rebase
+       git submodule update --init --recursive
+       git submodule foreach git checkout master
        git submodule foreach git pull --rebase origin master