Bugfix:
[blender.git] / GNUmakefile
index 2abb6846e955995c1b4d2a6d90b30c3e092f6d96..42d7c33e46b73c1025cd5e23ec2c0360b8c19143 100644 (file)
@@ -37,13 +37,22 @@ BLENDER_DIR:=$(shell pwd -P)
 BUILD_DIR:=$(shell dirname $(BLENDER_DIR))/build/$(OS_NCASE)
 
 
+# support 'make debug'
+ifneq "$(findstring debug, $(MAKECMDGOALS))" ""
+       BUILD_DIR:=$(BUILD_DIR)_debug
+       BUILD_TYPE:=Debug
+else
+       BUILD_TYPE:=Release
+endif
+
+
 # Get the number of cores for threaded build
 NPROCS:=1
 ifeq ($(OS), Linux)
        NPROCS:=$(shell grep -c ^processor /proc/cpuinfo)
 endif
 ifeq ($(OS), Darwin)
-       NPROCS:=$(shell system_profiler | awk '/Number Of CPUs/{print $4}{next;}')
+       NPROCS:=$(shell sysctl -a | grep "hw.ncpu " | cut -d" " -f3)
 endif
 ifeq ($(OS), FreeBSD)
        NPROCS:=$(shell sysctl -a | grep "hw.ncpu " | cut -d" " -f3 )
@@ -61,14 +70,35 @@ all:
        if test ! -f $(BUILD_DIR)/CMakeCache.txt ; then \
                mkdir -p $(BUILD_DIR) ; \
                cd $(BUILD_DIR) ; \
-               cmake $(BLENDER_DIR) -DCMAKE_BUILD_TYPE:STRING=Release ; \
+               cmake $(BLENDER_DIR) -DCMAKE_BUILD_TYPE:STRING=$(BUILD_TYPE) ; \
        fi
 
        @echo 
        @echo Building Blender ...
-       cd $(BUILD_DIR) ; make -s -j $(NPROCS)
+       cd $(BUILD_DIR) ; make -s -j $(NPROCS) install
        @echo 
        @echo run blender from "$(BUILD_DIR)/bin/blender"
        @echo 
 
+debug: all
+       # pass
+
+# package types
+package_debian:
+       cd build_files/package_spec ; DEB_BUILD_OPTIONS="parallel=$(NPROCS)" sh ./build_debian.sh
+
+package_pacman:
+       cd build_files/package_spec/pacman ; MAKEFLAGS="-j$(NPROCS)" makepkg --asroot
+
+package_archive:
+       cd $(BUILD_DIR) ; make -s package_archive
+       @echo archive in "$(BUILD_DIR)/release"
+
+# forward build targets
+test:
+       cd $(BUILD_DIR) ; ctest . --output-on-failure
+
+clean:
+       cd $(BUILD_DIR) ; make clean
+
 .PHONY: all