Configure parallel execution job count (#3531)
author오형석/동작제어Lab(SR)/Staff Engineer/삼성전자 <hseok82.oh@samsung.com>
Fri, 9 Nov 2018 06:50:12 +0000 (15:50 +0900)
committer박세희/동작제어Lab(SR)/Principal Engineer/삼성전자 <saehie.park@samsung.com>
Fri, 9 Nov 2018 06:50:12 +0000 (15:50 +0900)
User can configure parallel execution job count using NPROCS environment variable
- Reduce local compilation overhead when doing multiple job
- Protect excessive CI processor consumtion by one job

Signed-off-by: Hyeongseok Oh <hseok82.oh@samsung.com>
Makefile

index c264e8a..44234de 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -3,7 +3,6 @@ BUILD_TYPE?=Debug
 CROSS_BUILD?=0
 HOST_OS?=linux
 TARGET_OS?=linux
-NPROCS:=1
 PARALLEL_BUILD?=1
 ## TODO: fix obs build break
 OBS_BUILD?=OFF
@@ -62,10 +61,11 @@ endif
 ifeq ($(PARALLEL_BUILD),1)
        # Get number of processors (linux only for now)
        ifeq ($(HOST_OS),linux)
-               NPROCS:=$(shell grep -c ^processor /proc/cpuinfo)
+               NPROCS?=$(shell grep -c ^processor /proc/cpuinfo)
        endif
 endif
 
+NPROCS?=1
 WORKHOME=Product
 WORKFOLDER=$(TARGET_ARCH_LC)-$(TARGET_OS).$(BUILD_TYPE_LC)
 WORKDIR=$(WORKHOME)/$(WORKFOLDER)