8201788: Number of make jobs wrong for bootcycle-images target
authorsgehwolf
Thu, 19 Apr 2018 17:43:26 +0200
changeset 49841 b39ba7ae45cc
parent 49840 799e6e42b95f
child 49842 8c1a4628b2f0
8201788: Number of make jobs wrong for bootcycle-images target Reviewed-by: erikj, ihse
make/Init.gmk
--- a/make/Init.gmk	Fri Apr 20 15:16:36 2018 +0800
+++ b/make/Init.gmk	Thu Apr 19 17:43:26 2018 +0200
@@ -310,9 +310,13 @@
           ifneq ($(PARALLEL_TARGETS), )
 	    $(call StartGlobalTimer)
 	    $(call PrepareSmartJavac)
+            # JOBS will only be empty for a bootcycle-images recursive call
+            # or if specified via a make argument directly. In those cases
+            # treat it as NOT using jobs at all.
 	    ( cd $(TOPDIR) && \
 	        $(NICE) $(MAKE) $(MAKE_ARGS) $(OUTPUT_SYNC_FLAG) \
-	            -j $(JOBS) -f make/Main.gmk $(USER_MAKE_VARS) \
+                    $(if $(JOBS), -j $(JOBS)) \
+	            -f make/Main.gmk $(USER_MAKE_VARS) \
 	            $(PARALLEL_TARGETS) $(COMPARE_BUILD_MAKE) $(BUILD_LOG_PIPE) || \
 	        ( exitcode=$$? && \
 	        $(PRINTF) "\nERROR: Build failed for $(TARGET_DESCRIPTION) (exit code $$exitcode) \n" \