summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2019-05-19 19:04:07 +0300
committerLaurent Pinchart <laurent.pinchart@ideasonboard.com>2019-05-19 19:04:07 +0300
commitc743f77f9979b813da18585e9ca559d26913a62e (patch)
tree74b6b531e5803256e4b7ee6255907493fec44271
parentf9f2e2a794d43ad145703fe58f9869e8f131a45a (diff)
Modularise architecture handling
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
-rw-r--r--arch/arm.sh3
-rw-r--r--arch/arm64.sh3
-rw-r--r--arch/x86.sh3
-rwxr-xr-xkbuild.sh32
4 files changed, 21 insertions, 20 deletions
diff --git a/arch/arm.sh b/arch/arm.sh
new file mode 100644
index 0000000..53462fb
--- /dev/null
+++ b/arch/arm.sh
@@ -0,0 +1,3 @@
+arch_dir=arm32
+cross_compile=arm-buildroot-linux-uclibcgnueabihf-
+image_kernel=zImage
diff --git a/arch/arm64.sh b/arch/arm64.sh
new file mode 100644
index 0000000..a4b4b87
--- /dev/null
+++ b/arch/arm64.sh
@@ -0,0 +1,3 @@
+arch_dir=arm64
+cross_compile=aarch64-buildroot-linux-gnu-
+image_kernel=Image
diff --git a/arch/x86.sh b/arch/x86.sh
new file mode 100644
index 0000000..50edef3
--- /dev/null
+++ b/arch/x86.sh
@@ -0,0 +1,3 @@
+arch_dir=x86
+cross_compile=
+image_kernel=bzImage
diff --git a/kbuild.sh b/kbuild.sh
index 9bd2274..50f8d21 100755
--- a/kbuild.sh
+++ b/kbuild.sh
@@ -73,7 +73,7 @@ while [[ $# != 0 ]] ; do
done
#
-# Platform handling
+# Platform
#
if [[ -z "$platform" ]] ; then
@@ -89,7 +89,7 @@ if [[ -z "$platform" ]] ; then
fi
if [[ ! -r "$kbuild_root/platforms/$platform.sh" ]] ; then
- echo "Unknown platform '$platform'. Available platforms are"
+ echo "Unknown platform '$platform'. Supported platforms are"
for f in $kbuild_root/platforms/*.sh ; do
echo "- $(basename -s .sh $f)"
done
@@ -99,26 +99,18 @@ fi
source "${kbuild_root}/platforms/$platform.sh" || exit 1
#
-# Architecture handling
+# Architecture
#
-case $arch in
- arm)
- arch_dir=arm32
- cross_compile=arm-buildroot-linux-uclibcgnueabihf-
- image_kernel=zImage
- ;;
- arm64)
- arch_dir=arm64
- cross_compile=aarch64-buildroot-linux-gnu-
- image_kernel=Image
- ;;
- x86)
- arch_dir=x86
- cross_compile=
- image_kernel=bzImage
- ;;
-esac
+if [[ ! -r "$kbuild_root/arch/$arch.sh" ]] ; then
+ echo "Unknown architecture '$arch'. Supported architectures are"
+ for f in $kbuild_root/arch/*.sh ; do
+ echo "- $(basename -s .sh $f)"
+ done
+ exit 1
+fi
+
+source "${kbuild_root}/arch/$arch.sh" || exit 1
target_dir=${target_dir:-$NFS_ROOT/$arch_dir}
output_dir=${output_dir:-$PWD/output/$arch_dir}