Przeglądaj źródła

environment variable VERBOSE=1 adds 'V=s' to make

The 'V=s' appendix to calls to 'make' enable verbose output which is
useful for debugging build issues.
Helge Jung 9 lat temu
rodzic
commit
f79a06ec32
1 zmienionych plików z 5 dodań i 2 usunięć
  1. 5 2
      build.sh

+ 5 - 2
build.sh

@@ -13,6 +13,7 @@
 # MAKEJOBS  = number of compiler processes running in parallel (default: number of CPUs/Cores)
 # TARGETS   = a space separated list of target platforms (if unset, all platforms will be build)
 # PRIORITY  = determines the number of day a rollout phase should last at most
+# VERBOSE   = 0 (default) or 1, call the make commands with 'V=s' to see actual errors better
 #
 
 function get_all_supported_platforms()
@@ -136,11 +137,13 @@ progress "Building the firmware - please stand by!"
 [ -n "${MAKEJOBS}" ] || MAKEJOBS=$(grep -c "^processor" /proc/cpuinfo)
 [ -n "${TARGETS}" ] || TARGETS=$(get_all_supported_platforms "./targets")
 [ -n "${PRIORITY}" ] || PRIORITY=0
+MAKE_PARAM=""
 
 if [ "${BRANCH}" == "experimental" -a -z "${VERSION}" ] ; then
     default_release_pattern=$( awk -F" := " '/^DEFAULT_GLUON_RELEASE/ { gsub("shell ", "", $2); print $2; }' ./site/site.mk )
     VERSION=$(eval echo ${default_release_pattern})
 fi
+[ "_$VERBOSE" = "_1" ] && MAKE_PARAM="${MAKE_PARAM} V=s"
 
 for target in ${TARGETS} ; do
     # configure build environment for our current target
@@ -150,11 +153,11 @@ for target in ${TARGETS} ; do
     # prepare build environment for our current target
     progress "Preparing build environment for target ${target}."
     [ "${BRANCH}" == "experimental" ] || make clean
-    make -j ${MAKEJOBS} prepare-target
+    make -j ${MAKEJOBS} prepare-target${MAKE_PARAM}
 
     # need to have a toolchain for the particular target 
     progress "Building toolchain for target ${target}."
-    make -j ${MAKEJOBS} toolchain/install
+    make -j ${MAKEJOBS} toolchain/install${MAKE_PARAM}
     [ "$?" -eq "0" ] || abort "Unable to build toolchain for target. Aborting."
 
     # now we can start building the images for the target platform