gst-inspect: fix unused-const-variable error in windows
[platform/upstream/gstreamer.git] / scripts / git-update.sh
index 89cb826..25cb7cc 100755 (executable)
@@ -18,8 +18,6 @@ EXTRA_MODULES="\
     gst-rtsp-server \
     gst-python"
 
-MAKE_FLAGS=
-
 tmp=${TMPDIR-/tmp}
 tmp=$tmp/git-update.$(date +%Y%m%d-%H%M-).$RANDOM.$RANDOM.$RANDOM.$$
 
@@ -31,6 +29,8 @@ tmp=$tmp/git-update.$(date +%Y%m%d-%H%M-).$RANDOM.$RANDOM.$RANDOM.$$
 ERROR_LOG="$tmp/failures.log"
 ERROR_RETURN=255
 
+CPUCORES=$(grep -c ^processor /proc/cpuinfo 2>/dev/null || sysctl -n hw.ncpu  2>/dev/null || echo "1")
+
 for m in $CORE $MODULES $EXTRA_MODULES; do
   if test -d $m; then
     echo "+ updating $m"
@@ -93,7 +93,7 @@ build()
     fi
 
     echo "+ $1: make"
-    make $MAKE_FLAGS > "$tmp/$1-make.log" 2>&1
+    MAKEFLAGS="-j$CPUCORES $MAKEFLAGS" make > "$tmp/$1-make.log" 2>&1
     if test $? -ne 0
     then
       echo "$1: make [$tmp/$1-make.log]" >> $ERROR_LOG
@@ -130,8 +130,6 @@ fi
 exit
 }
 
-MAKE_FLAGS=$@
-
 # build core and base plugins sequentially
 # exit if build fails (excluding checks)
 for m in $CORE; do
@@ -142,7 +140,7 @@ for m in $CORE; do
 done
 
 # build other modules in parallel
-for m in $MODULES; do
+for m in $MODULES $EXTRA_MODULES; do
   build $m &
   PIDS="$PIDS $!"
 done