add 'make debug' option for stub cmake makefile.
authorCampbell Barton <ideasman42@gmail.com>
Sat, 19 Feb 2011 13:46:08 +0000 (13:46 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Sat, 19 Feb 2011 13:46:08 +0000 (13:46 +0000)
GNUmakefile

index 703b8355a5ef24aa71c1e189c2739d83f7b98e6a..9815477dd3931512b301931f215c25db8834fe75 100644 (file)
@@ -37,6 +37,15 @@ 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)
@@ -61,7 +70,7 @@ 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 
@@ -71,6 +80,9 @@ all:
        @echo run blender from "$(BUILD_DIR)/bin/blender"
        @echo 
 
+debug: all
+       # pass
+
 # package types
 package_debian:
        cd build_files/package_spec ; sh ./build_debian.sh