Cleanup: de-duplicate popover_group arguments
[blender.git] / GNUmakefile
index b434787..821b2f5 100644 (file)
@@ -101,13 +101,21 @@ Utilities
 
    * icons:
      Updates PNG icons from SVG files.
-     Set environment variables 'BLENDER_BIN' and 'INKSCAPE_BIN'
-     to define your own commands.
+
+     Optionally pass in variables: 'BLENDER_BIN', 'INKSCAPE_BIN'
+     otherwise default paths are used.
+
+     Example
+        make icons INKSCAPE_BIN=/path/to/inkscape
 
    * icons_geom:
      Updates Geometry icons from BLEND file.
-     Set environment variable 'BLENDER_BIN'
-     to define your own command.
+
+     Optionally pass in variable: 'BLENDER_BIN'
+     otherwise default paths are used.
+
+     Example
+        make icons_geom BLENDER_BIN=/path/to/blender
 
    * tgz:
      Create a compressed archive of the source code.
@@ -115,6 +123,11 @@ Utilities
    * update:
      updates git and all submodules
 
+   * format
+     Format source code using clang (uses PATHS if passed in). For example::
+
+        make format PATHS="source/blender/blenlib source/blender/blenkernel"
+
 Environment Variables
 
    * BUILD_CMAKE_ARGS:      Arguments passed to CMake.
@@ -212,10 +225,12 @@ endif
 # -----------------------------------------------------------------------------
 # Blender binary path
 
+# Allow passing in own BLENDER_BIN so developers who don't
+# 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?="$(BUILD_DIR)/bin/blender.app/Contents/MacOS/blender"
 else
-       BLENDER_BIN="$(BUILD_DIR)/bin/blender"
+       BLENDER_BIN?="$(BUILD_DIR)/bin/blender"
 endif
 
 
@@ -476,9 +491,12 @@ check_descriptions: .FORCE
 tgz: .FORCE
        ./build_files/utils/build_tgz.sh
 
+INKSCAPE_BIN?="inkscape"
 icons: .FORCE
-       "$(BLENDER_DIR)/release/datafiles/blender_icons_update.py"
-       "$(BLENDER_DIR)/release/datafiles/prvicons_update.py"
+       BLENDER_BIN=$(BLENDER_BIN) INKSCAPE_BIN=$(INKSCAPE_BIN) \
+               "$(BLENDER_DIR)/release/datafiles/blender_icons_update.py"
+       BLENDER_BIN=$(BLENDER_BIN) INKSCAPE_BIN=$(INKSCAPE_BIN) \
+               "$(BLENDER_DIR)/release/datafiles/prvicons_update.py"
 
 icons_geom: .FORCE
        BLENDER_BIN=$(BLENDER_BIN) \
@@ -497,6 +515,10 @@ update: .FORCE
        git submodule foreach git checkout master
        git submodule foreach git pull --rebase origin master
 
+format: .FORCE
+       PATH="../lib/${OS_NCASE}/llvm/bin/:$(PATH)" \
+               python3 source/tools/utils_maintenance/clang_format_paths.py $(PATHS)
+
 
 # -----------------------------------------------------------------------------
 # Documentation