build: tell users to do non-paralle builds on errors
authorFelix Fietkau <nbd@openwrt.org>
Thu, 16 Apr 2015 12:18:26 +0000 (12:18 +0000)
committerFelix Fietkau <nbd@openwrt.org>
Thu, 16 Apr 2015 12:18:26 +0000 (12:18 +0000)
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
SVN-Revision: 45457

include/toplevel.mk
include/verbose.mk

index 33baa86da92db66c0a502d2bc49a2fa02a656057..d8651d923b58fa8663b5affab11390be85a0b61f 100644 (file)
@@ -166,6 +166,8 @@ clean dirclean: .config
 prereq:: prepare-tmpinfo .config
        @+$(NO_TRACE_MAKE) -r -s $@
 
+WARN_PARALLEL_ERROR = $(if $(BUILD_LOG),,$(and $(filter -j,$(MAKEFLAGS)),$(findstring s,$(OPENWRT_VERBOSE))))
+
 ifeq ($(SDK),1)
 
 %::
@@ -184,7 +186,10 @@ else
                        printf "$(_R)WARNING: your configuration is out of sync. Please run make menuconfig, oldconfig or defconfig!$(_N)\n" >&2; \
                fi \
        )
-       @+$(ULIMIT_FIX) $(SUBMAKE) -r $@
+       @+$(ULIMIT_FIX) $(SUBMAKE) -r $@ $(if $(WARN_PARALLEL_ERROR), || { \
+               printf "$(_R)Build failed - please re-run with -j1 to see the real error message$(_N)\n" >&2; \
+               false; \
+       } )
 
 endif
 
index 90aab4c2f5a8b17307d61264b8350e2c79526364..b7e43f74300edbe54094641d157ff7f11b3bdd90 100644 (file)
@@ -54,7 +54,7 @@ ifeq ($(findstring s,$(OPENWRT_VERBOSE)),)
   else
     SILENT:=>/dev/null $(if $(findstring w,$(OPENWRT_VERBOSE)),,2>&1)
     export QUIET:=1
-    SUBMAKE=cmd() { $(SILENT) $(MAKE) -s $$* < /dev/null || { echo "make $$*: build failed. Please re-run make with V=s to see what's going on"; false; } } 8>&1 9>&2; cmd
+    SUBMAKE=cmd() { $(SILENT) $(MAKE) -s $$* < /dev/null || { echo "make $$*: build failed. Please re-run make with -j1 V=s to see what's going on"; false; } } 8>&1 9>&2; cmd
   endif
 
   .SILENT: $(MAKECMDGOALS)