Browse Source

build.sh: set environment variable defaults before writing build-info

Helge Jung 9 years ago
parent
commit
717f935d5a
1 changed files with 8 additions and 6 deletions
  1. 8 6
      build.sh

+ 8 - 6
build.sh

@@ -125,6 +125,14 @@ if [ "${BRANCH}" == "experimental" -a -z "${VERSION}" ] ; then
     info "EXPERIMENTAL FIRMWARE: using version tag '$VERSION'"
 fi
 
+# set reasonable defaults for unset environment variables
+[ -n "${BROKEN}" ] || BROKEN=0
+[ -n "${MAKEJOBS}" ] || MAKEJOBS=$(grep -c "^processor" /proc/cpuinfo)
+[ -n "${TARGETS}" ] || TARGETS=$(get_all_supported_platforms "./targets")
+[ -n "${PRIORITY}" ] || PRIORITY=0
+MAKE_PARAM=""
+[ "_$VERBOSE" = "_1" ] && MAKE_PARAM="${MAKE_PARAM} V=s"
+
 # we are now ready to produke the firmware images, so let's "save" our state
 build_info_path="${OUTPUT_DIR}/${BRANCH}/${BUILD_INFO_FILENAME}"
 progress "Saving build information to: ${build_info_path}"
@@ -142,12 +150,6 @@ echo "TS=${BUILD_TS}" >> ${build_info_path}
 
 ### BUILD FIRMWARE
 progress "Building the firmware - please stand by!"
-[ -n "${BROKEN}" ] || BROKEN=0
-[ -n "${MAKEJOBS}" ] || MAKEJOBS=$(grep -c "^processor" /proc/cpuinfo)
-[ -n "${TARGETS}" ] || TARGETS=$(get_all_supported_platforms "./targets")
-[ -n "${PRIORITY}" ] || PRIORITY=0
-MAKE_PARAM=""
-[ "_$VERBOSE" = "_1" ] && MAKE_PARAM="${MAKE_PARAM} V=s"
 
 for target in ${TARGETS} ; do
     # configure build environment for our current target