zephyr: restructure the build process to use board config files
Move the board specific configurations into its own header file, which
can now be created per board, once it gets tested and validated by the
bootloader.
Signed-off-by: Ricardo Salveti <ricardo.salveti@linaro.org>
diff --git a/build_boot.sh b/build_boot.sh
index b998812..72ee96f 100755
--- a/build_boot.sh
+++ b/build_boot.sh
@@ -1,6 +1,22 @@
-#! /bin/bash
+#!/bin/sh
-source $(dirname 0)/target.sh
-source ../zephyr/zephyr-env.sh
+# Assume first argument is the board name (as defined in Zephyr)
+BOARD=$1
-make BOARD=$BOARD "$@"
+if [ -z "$BOARD" ]; then
+ echo "Please specify the board name (as in Zephyr) as first argument."
+ exit 1;
+fi
+
+if [ ! -f "$(dirname $0)/boot/zephyr/targets/${BOARD}.h" ]; then
+ echo "Board $BOARD not yet supported, please use a supported target."
+ exit 1;
+fi
+
+# Check if there is a valid Zephyr environment available
+if [ -z "$ZEPHYR_BASE" ]; then
+ echo "ZEPHYR_BASE not provided by the environment."
+ exit 1;
+fi
+
+make BOARD=$BOARD