summaryrefslogtreecommitdiff
path: root/nuttx/tools/autobuild.sh
diff options
context:
space:
mode:
Diffstat (limited to 'nuttx/tools/autobuild.sh')
-rwxr-xr-xnuttx/tools/autobuild.sh34
1 files changed, 34 insertions, 0 deletions
diff --git a/nuttx/tools/autobuild.sh b/nuttx/tools/autobuild.sh
new file mode 100755
index 000000000..d8ae8c3e2
--- /dev/null
+++ b/nuttx/tools/autobuild.sh
@@ -0,0 +1,34 @@
+#!/bin/bash
+
+# Build job count
+BUILDJOBS=${BUILDJOBS:-2}
+BUILDJOBID=${BUILDJOBID:-a}
+
+# Config count
+CONFCOUNT=`find nuttx/configs -name \*defconfig -print | wc -l`
+# Number of non-commented (#) and non-empty lines in ignore file
+IGNORECOUNT=`cat .travis_ignored_configs.txt | sed '/^\s*#/d;/^\s*$/d' | wc -l`
+# Get rid of whitespace
+CONFCOUNT=$(echo $CONFCOUNT )
+IGNORECOUNT=$(echo $IGNORECOUNT )
+
+echo -e "\n"
+echo -e "\0033[34mNuttX Configs: $CONFCOUNT total, $IGNORECOUNT excluded from build\0033[0m"
+echo -e "(Add or remove configs to file .travis_ignored_configs to exclude)"
+echo -e "----------------------------------------------------------------------------\n"
+
+CONFIGS=configs.txt
+
+find nuttx/configs -name \*defconfig -print > $CONFIGS
+
+# Lines per file
+LINES_TOTAL=$(wc -l <${CONFIGS})
+((LINES_PER_FILE = (LINES_TOTAL + BUILDJOBS - 1) / BUILDJOBS))
+
+# Perform the split
+split -a1 -l${LINES_PER_FILE} ${CONFIGS} configparts.
+
+echo -e "Operating total $BUILDJOBS build jobs"
+echo -e "Running job: configparts.$BUILDJOBID"
+
+cat "configparts.$BUILDJOBID" | xargs -L1 nuttx/tools/build_config.sh