Reduce number of parallel gcc invocations from 4 to 2 per cpu
[vpp.git] / build-root / Makefile
index aa50255..34d6c9d 100644 (file)
@@ -318,10 +318,15 @@ BUILD_DEBUG =
 # Message from build system itself (as opposed to make or shell commands)
 build_msg_fn = echo "@@@@ $(1) @@@@"
 
+# Allow CCACHE_DIR to be overridden, e.g. in .../build-root/build-config.mk
+ifeq ($(CCACHE_DIR),)
+  CCACHE_DIR=$(MU_BUILD_ROOT_DIR)/.ccache
+endif
+
 # Always prefer our own tools to those installed on system.
 # Note: ccache-bin must be before tool bin.
 BUILD_ENV =                                                                            \
-    export CCACHE_DIR=$(MU_BUILD_ROOT_DIR)/.ccache ;                                   \
+    export CCACHE_DIR=$(CCACHE_DIR) ;                                  \
     export PATH=$(TOOL_INSTALL_DIR)/ccache-bin:$(TOOL_INSTALL_DIR)/bin:$${PATH} ;      \
     export PATH="`echo $${PATH} | sed -e s/[.]://`" ;                                  \
     $(if $(not_native),export CONFIG_SITE=$(MU_BUILD_ROOT_DIR)/config.site ;,) \
@@ -665,7 +670,7 @@ linux_n_cpus = `grep '^processor' /proc/cpuinfo | wc -l`
 MAKE_PARALLEL_JOBS =                           \
   -j $(shell                                   \
     if [ -f /proc/cpuinfo ] ; then             \
-      expr 4 '*' $(linux_n_cpus) ;             \
+      expr 2 '*' $(linux_n_cpus) ;             \
     else                                       \
       echo 1 ;                                 \
     fi)