Pārlūkot izejas kodu

randconfig.sh: set number of make jobs

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Bernhard Reutner-Fischer 14 gadi atpakaļ
vecāks
revīzija
c13dd47ecb
1 mainītis faili ar 13 papildinājumiem un 3 dzēšanām
  1. 13 3
      extra/scripts/randconfig.sh

+ 13 - 3
extra/scripts/randconfig.sh

@@ -6,6 +6,7 @@
 #
 # The above builds random i386 configs and automatically stops after 30 minutes
 
+test "x$AWK" = "x" && AWK=awk
 test "x$ARCH" = "x" && ARCH=`uname -m`
 KCONFIG_ALLCONFIG=.config.allconfig
 (echo TARGET_$ARCH=y
@@ -15,12 +16,21 @@ KCONFIG_ALLCONFIG=.config.allconfig
 ) > $KCONFIG_ALLCONFIG
 export KCONFIG_ALLCONFIG
 
+if test "x$NCPU" = "x"
+then
+  test -r /proc/cpuinfo && \
+  eval `$AWK 'BEGIN{NCPU=0}
+/processor/{let NCPU++}
+END{if (NCPU<1) {NCPU=1}; print("NCPU="NCPU);}' /proc/cpuinfo` || \
+  NCPU=1
+fi
+MAKELEVEL="-j$NCPU"
 i=0
 while test ! -f STOP
 do
-  make $* randconfig > /dev/null
-  make $* silentoldconfig > /dev/null
-  if (make $*) 2>&1 >& mk.log
+  ARCH=$ARCH make $* randconfig > /dev/null
+  ARCH=$ARCH make $* silentoldconfig > /dev/null
+  if (make $MAKELEVEL $*) 2>&1 >& mk.log
   then
     :
   else