diff options
author | Colin Basnett <cmbasnett@gmail.com> | 2022-09-17 03:50:37 +0300 |
---|---|---|
committer | Colin Basnett <cmbasnett@gmail.com> | 2022-09-17 03:50:37 +0300 |
commit | 564bda241a973396da51d7c3ccd9efd97d51728a (patch) | |
tree | 4d9aa4cccd82e2e606b47774afa5e1015bf14768 /GNUmakefile | |
parent | 0fff238150d076576053c25b646f653d6e3b0edb (diff) | |
parent | 48d7ff68f0df209c77bbb081ab46fbc109fd825a (diff) |
Merge branch 'master' into feature-imformatfeature-imformat
Diffstat (limited to 'GNUmakefile')
-rw-r--r-- | GNUmakefile | 28 |
1 files changed, 20 insertions, 8 deletions
diff --git a/GNUmakefile b/GNUmakefile index a82d1bedace..884d2232d71 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -162,6 +162,7 @@ CPU:=$(shell uname -m) # Source and Build DIR's BLENDER_DIR:=$(shell pwd -P) BUILD_TYPE:=Release +BLENDER_IS_PYTHON_MODULE:= # CMake arguments, assigned to local variable to make it mutable. CMAKE_CONFIG_ARGS := $(BUILD_CMAKE_ARGS) @@ -229,9 +230,18 @@ endif # ----------------------------------------------------------------------------- -# additional targets for the build configuration +# Additional targets for the build configuration -# support 'make debug' +# NOTE: These targets can be combined and are applied in reverse order listed here. +# So it's important that `bpy` comes before `release` (for example) +# `make bpy release` first loads `release` configuration, then `bpy`. +# This is important as `bpy` will turn off some settings enabled by release. + +ifneq "$(findstring bpy, $(MAKECMDGOALS))" "" + BUILD_DIR:=$(BUILD_DIR)_bpy + CMAKE_CONFIG_ARGS:=-C"$(BLENDER_DIR)/build_files/cmake/config/bpy_module.cmake" $(CMAKE_CONFIG_ARGS) + BLENDER_IS_PYTHON_MODULE:=1 +endif ifneq "$(findstring debug, $(MAKECMDGOALS))" "" BUILD_DIR:=$(BUILD_DIR)_debug BUILD_TYPE:=Debug @@ -256,10 +266,6 @@ ifneq "$(findstring headless, $(MAKECMDGOALS))" "" BUILD_DIR:=$(BUILD_DIR)_headless CMAKE_CONFIG_ARGS:=-C"$(BLENDER_DIR)/build_files/cmake/config/blender_headless.cmake" $(CMAKE_CONFIG_ARGS) endif -ifneq "$(findstring bpy, $(MAKECMDGOALS))" "" - BUILD_DIR:=$(BUILD_DIR)_bpy - CMAKE_CONFIG_ARGS:=-C"$(BLENDER_DIR)/build_files/cmake/config/bpy_module.cmake" $(CMAKE_CONFIG_ARGS) -endif ifneq "$(findstring developer, $(MAKECMDGOALS))" "" CMAKE_CONFIG_ARGS:=-C"$(BLENDER_DIR)/build_files/cmake/config/blender_developer.cmake" $(CMAKE_CONFIG_ARGS) @@ -297,8 +303,10 @@ endif # use the default build path can still use utility helpers. ifeq ($(OS), Darwin) BLENDER_BIN?="$(BUILD_DIR)/bin/Blender.app/Contents/MacOS/Blender" + BLENDER_BIN_DIR?="$(BUILD_DIR)/bin/Blender.app/Contents/MacOS/Blender" else BLENDER_BIN?="$(BUILD_DIR)/bin/blender" + BLENDER_BIN_DIR?="$(BUILD_DIR)/bin" endif @@ -355,8 +363,12 @@ all: .FORCE @echo Building Blender ... $(BUILD_COMMAND) -C "$(BUILD_DIR)" -j $(NPROCS) install @echo - @echo edit build configuration with: "$(BUILD_DIR)/CMakeCache.txt" run make again to rebuild. - @echo Blender successfully built, run from: $(BLENDER_BIN) + @echo Edit build configuration with: \"$(BUILD_DIR)/CMakeCache.txt\" run make again to rebuild. + @if test "$(BLENDER_IS_PYTHON_MODULE)" == ""; then \ + echo Blender successfully built, run from: $(BLENDER_BIN); \ + else \ + echo Blender successfully built as a Python module, \"bpy\" can be imported from: $(BLENDER_BIN_DIR); \ + fi @echo debug: all |