convenience makefile: support spaces in paths

also update for new source/tools paths.
This commit is contained in:
Campbell Barton 2013-11-17 18:54:03 +11:00
parent 85bbef0f4e
commit 4882cb6f28
3 changed files with 44 additions and 44 deletions

View File

@ -32,7 +32,7 @@ OS_NCASE:=$(shell uname -s | tr '[A-Z]' '[a-z]')
# Source and Build DIR's
BLENDER_DIR:="$(shell pwd -P)"
BLENDER_DIR:=$(shell pwd -P)
BUILD_TYPE:=Release
ifndef BUILD_CMAKE_ARGS
@ -40,7 +40,7 @@ ifndef BUILD_CMAKE_ARGS
endif
ifndef BUILD_DIR
BUILD_DIR:="$(shell dirname $(BLENDER_DIR))/build_$(OS_NCASE)"
BUILD_DIR:=$(shell dirname "$(BLENDER_DIR)")/build_$(OS_NCASE)
endif
@ -87,8 +87,8 @@ endif
# Macro for configuring cmake
CMAKE_CONFIG = cmake $(BUILD_CMAKE_ARGS) \
-H$(BLENDER_DIR) \
-B$(BUILD_DIR) \
-H"$(BLENDER_DIR)" \
-B"$(BUILD_DIR)" \
-DCMAKE_BUILD_TYPE:STRING=$(BUILD_TYPE)
@ -133,7 +133,7 @@ bpy: all
# -----------------------------------------------------------------------------
# Configuration (save some cd'ing around)
config:
$(CMAKE_CONFIG_TOOL) $(BUILD_DIR)
$(CMAKE_CONFIG_TOOL) "$(BUILD_DIR)"
# -----------------------------------------------------------------------------
@ -205,7 +205,7 @@ package_pacman:
cd build_files/package_spec/pacman ; MAKEFLAGS="-j$(NPROCS)" makepkg --asroot
package_archive:
make -C $(BUILD_DIR) -s package_archive
make -C "$(BUILD_DIR)" -s package_archive
@echo archive in "$(BUILD_DIR)/release"
@ -231,25 +231,25 @@ test_deprecated:
test_style_c:
# run our own checks on C/C++ style
PYTHONIOENCODING=utf_8 python3 $(BLENDER_DIR)/source/tools/check_style_c.py $(BLENDER_DIR)/source/blender $(BLENDER_DIR)/source/creator --no-length-check
PYTHONIOENCODING=utf_8 python3 "$(BLENDER_DIR)/source/tools/check_source/check_style_c.py" "$(BLENDER_DIR)/source/blender" "$(BLENDER_DIR)/source/creator" --no-length-check
test_style_c_qtc:
# run our own checks on C/C++ style
USE_QTC_TASK=1 \
PYTHONIOENCODING=utf_8 python3 $(BLENDER_DIR)/source/tools/check_style_c.py $(BLENDER_DIR)/source/blender $(BLENDER_DIR)/source/creator --no-length-check > \
PYTHONIOENCODING=utf_8 python3 "$(BLENDER_DIR)/source/tools/check_source/check_style_c.py" "$(BLENDER_DIR)/source/blender" "$(BLENDER_DIR)/source/creator" --no-length-check > \
test_style.tasks
@echo "written: test_style.tasks"
test_style_osl:
# run our own checks on C/C++ style
PYTHONIOENCODING=utf_8 python3 $(BLENDER_DIR)/source/tools/check_style_c.py $(BLENDER_DIR)/intern/cycles/kernel/shaders
PYTHONIOENCODING=utf_8 python3 "$(BLENDER_DIR)/source/tools/check_source/check_style_c.py" "$(BLENDER_DIR)/intern/cycles/kernel/shaders"
test_style_osl_qtc:
# run our own checks on C/C++ style
USE_QTC_TASK=1 \
PYTHONIOENCODING=utf_8 python3 $(BLENDER_DIR)/source/tools/check_style_c.py $(BLENDER_DIR)/intern/cycles/kernel/shaders > \
PYTHONIOENCODING=utf_8 python3 "$(BLENDER_DIR)/source/tools/check_source/check_style_c.py" "$(BLENDER_DIR)/intern/cycles/kernel/shaders" > \
test_style.tasks
@echo "written: test_style.tasks"
@ -258,13 +258,13 @@ test_style_osl_qtc:
#
project_qtcreator:
python3 build_files/cmake/cmake_qtcreator_project.py $(BUILD_DIR)
python3 build_files/cmake/cmake_qtcreator_project.py "$(BUILD_DIR)"
project_netbeans:
python3 build_files/cmake/cmake_netbeans_project.py $(BUILD_DIR)
python3 build_files/cmake/cmake_netbeans_project.py "$(BUILD_DIR)"
project_eclipse:
cmake -G"Eclipse CDT4 - Unix Makefiles" -H$(BLENDER_DIR) -B$(BUILD_DIR)
cmake -G"Eclipse CDT4 - Unix Makefiles" -H"$(BLENDER_DIR)" -B"$(BUILD_DIR)"
# -----------------------------------------------------------------------------
@ -273,49 +273,49 @@ project_eclipse:
check_cppcheck:
$(CMAKE_CONFIG)
cd $(BUILD_DIR) ; \
python3 $(BLENDER_DIR)/build_files/cmake/cmake_static_check_cppcheck.py 2> \
$(BLENDER_DIR)/check_cppcheck.txt
cd "$(BUILD_DIR)" ; \
python3 "$(BLENDER_DIR)/build_files/cmake/cmake_static_check_cppcheck.py" 2> \
"$(BLENDER_DIR)/check_cppcheck.txt"
@echo "written: check_cppcheck.txt"
check_clang_array:
$(CMAKE_CONFIG)
cd $(BUILD_DIR) ; \
python3 $(BLENDER_DIR)/build_files/cmake/cmake_static_check_clang_array.py
cd "$(BUILD_DIR)" ; \
python3 "$(BLENDER_DIR)/build_files/cmake/cmake_static_check_clang_array.py"
check_splint:
$(CMAKE_CONFIG)
cd $(BUILD_DIR) ; \
python3 $(BLENDER_DIR)/build_files/cmake/cmake_static_check_splint.py
cd "$(BUILD_DIR)" ; \
python3 "$(BLENDER_DIR)/build_files/cmake/cmake_static_check_splint.py"
check_sparse:
$(CMAKE_CONFIG)
cd $(BUILD_DIR) ; \
python3 $(BLENDER_DIR)/build_files/cmake/cmake_static_check_sparse.py
cd "$(BUILD_DIR)" ; \
python3 "$(BLENDER_DIR)/build_files/cmake/cmake_static_check_sparse.py"
check_smatch:
$(CMAKE_CONFIG)
cd $(BUILD_DIR) ; \
python3 $(BLENDER_DIR)/build_files/cmake/cmake_static_check_smatch.py
cd "$(BUILD_DIR)" ; \
python3 "$(BLENDER_DIR)/build_files/cmake/cmake_static_check_smatch.py"
check_spelling_py:
cd $(BUILD_DIR) ; \
PYTHONIOENCODING=utf_8 python3 $(BLENDER_DIR)/source/tools/spell_check_source.py $(BLENDER_DIR)/release/scripts
cd "$(BUILD_DIR)" ; \
PYTHONIOENCODING=utf_8 python3 "$(BLENDER_DIR)/source/tools/check_source/check_spelling.py" "$(BLENDER_DIR)/release/scripts"
check_spelling_c:
cd $(BUILD_DIR) ; \
PYTHONIOENCODING=utf_8 python3 $(BLENDER_DIR)/source/tools/spell_check_source.py $(BLENDER_DIR)/source
cd "$(BUILD_DIR)" ; \
PYTHONIOENCODING=utf_8 python3 "$(BLENDER_DIR)/source/tools/check_source/check_spelling.py" "$(BLENDER_DIR)/source"
check_spelling_c_qtc:
cd $(BUILD_DIR) ; USE_QTC_TASK=1 \
PYTHONIOENCODING=utf_8 python3 $(BLENDER_DIR)/source/tools/spell_check_source.py $(BLENDER_DIR)/source > \
$(BLENDER_DIR)/check_spelling_c.tasks
cd "$(BUILD_DIR)" ; USE_QTC_TASK=1 \
PYTHONIOENCODING=utf_8 python3 "$(BLENDER_DIR)/source/tools/check_source/check_spelling.py" "$(BLENDER_DIR)/source" > \
"$(BLENDER_DIR)/check_spelling_c.tasks"
check_spelling_osl:
cd $(BUILD_DIR) ; PYTHONIOENCODING=utf_8 python3 $(BLENDER_DIR)/source/tools/spell_check_source.py $(BLENDER_DIR)/intern/cycles/kernel/shaders
cd "$(BUILD_DIR)" ; PYTHONIOENCODING=utf_8 python3 "$(BLENDER_DIR)/source/tools/check_source/check_spelling.py" "$(BLENDER_DIR)/intern/cycles/kernel/shaders"
check_descriptions:
$(BUILD_DIR)/bin/blender --background -noaudio --factory-startup --python $(BLENDER_DIR)/source/tools/check_descriptions.py
"$(BUILD_DIR)/bin/blender" --background -noaudio --factory-startup --python "$(BLENDER_DIR)/source/tools/check_source/check_descriptions.py"
# -----------------------------------------------------------------------------
# Utilities
@ -328,8 +328,8 @@ tbz:
@echo "blender_archive.tar.bz2 written"
icons:
$(BLENDER_DIR)/release/datafiles/blender_icons.sh
$(BLENDER_DIR)/release/datafiles/prvicons.sh
"$(BLENDER_DIR)/release/datafiles/blender_icons.sh"
"$(BLENDER_DIR)/release/datafiles/prvicons.sh"
# -----------------------------------------------------------------------------
@ -338,7 +338,7 @@ icons:
# Simple version of ./doc/python_api/sphinx_doc_gen.sh with no PDF generation.
doc_py:
$(BUILD_DIR)/bin/blender --background -noaudio --factory-startup --python doc/python_api/sphinx_doc_gen.py
"$(BUILD_DIR)/bin/blender" --background -noaudio --factory-startup --python doc/python_api/sphinx_doc_gen.py
cd doc/python_api ; sphinx-build -b html sphinx-in sphinx-out
@echo "docs written into: '$(BLENDER_DIR)/doc/python_api/sphinx-out/contents.html'"
@ -347,14 +347,14 @@ doc_doxy:
@echo "docs written into: '$(BLENDER_DIR)/doc/doxygen/html/index.html'"
doc_dna:
$(BUILD_DIR)/bin/blender --background -noaudio --factory-startup --python doc/blender_file_format/BlendFileDnaExporter_25.py
"$(BUILD_DIR)/bin/blender" --background -noaudio --factory-startup --python doc/blender_file_format/BlendFileDnaExporter_25.py
@echo "docs written into: '$(BLENDER_DIR)/doc/blender_file_format/dna.html'"
doc_man:
python3 doc/manpage/blender.1.py $(BUILD_DIR)/bin/blender
python3 doc/manpage/blender.1.py "$(BUILD_DIR)/bin/blender"
clean:
$(MAKE) -C $(BUILD_DIR) clean
$(MAKE) -C "$(BUILD_DIR)" clean
.PHONY: all

View File

@ -1,8 +1,8 @@
#!/bin/sh
# This script updates icons from the SVG file
BASEDIR=$(dirname $0)
BASEDIR=$(dirname "$0")
inkscape $BASEDIR/blender_icons.svg --export-dpi=90 --without-gui --export-png=$BASEDIR/blender_icons16.png
inkscape $BASEDIR/blender_icons.svg --export-dpi=180 --without-gui --export-png=$BASEDIR/blender_icons32.png
inkscape "$BASEDIR/blender_icons.svg" --export-dpi=90 --without-gui --export-png="$BASEDIR/blender_icons16.png"
inkscape "$BASEDIR/blender_icons.svg" --export-dpi=180 --without-gui --export-png="$BASEDIR/blender_icons32.png"

View File

@ -1,7 +1,7 @@
#!/bin/sh
# This script updates icons from the SVG file
BASEDIR=$(dirname $0)
BASEDIR=$(dirname "$0")
inkscape $BASEDIR/prvicons.svg --without-gui --export-png=$BASEDIR/prvicons.png
inkscape "$BASEDIR/prvicons.svg" --without-gui --export-png="$BASEDIR/prvicons.png"