build: script: combine rpi3 32bit and 64bit scripts 68/213968/1
authorJaehoon Chung <jh80.chung@samsung.com>
Tue, 17 Sep 2019 05:10:17 +0000 (14:10 +0900)
committerJaehoon Chung <jh80.chung@samsung.com>
Tue, 17 Sep 2019 05:16:49 +0000 (14:16 +0900)
Combine rpi3 32bit and 64bit scripts.
e.g) build-rpi3.sh arm / arm64

Change-Id: I224b7944362245685e4557f2fe41837c3a685ad8
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
build-rpi3-arm32.sh [deleted file]
build-rpi3-arm64.sh [deleted file]
build-rpi3.sh [new file with mode: 0755]

diff --git a/build-rpi3-arm32.sh b/build-rpi3-arm32.sh
deleted file mode 100755 (executable)
index 1e8c02a..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-#!/bin/bash
-
-# Check this system has ccache
-check_ccache()
-{
-       type ccache
-       if [ "$?" -eq "0" ]; then
-               CCACHE=ccache
-       fi
-}
-
-check_ccache
-
-rm -f arch/arm/boot/zImage
-rm -f arch/arm/boot/dts/*.dtb
-
-if ! [ -e .config ] ; then
-       make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- tizen_bcm2709_defconfig
-fi
-
-make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- -j8
-
-if [ ! -f "./arch/arm/boot/zImage" ]; then
-       echo "Build fail"
-       exit 1
-fi
diff --git a/build-rpi3-arm64.sh b/build-rpi3-arm64.sh
deleted file mode 100755 (executable)
index 15b9391..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-#!/bin/bash
-
-# Check this system has ccache
-check_ccache()
-{
-       type ccache
-       if [ "$?" -eq "0" ]; then
-               CCACHE=ccache
-       fi
-}
-
-check_ccache
-
-rm -f arch/arm64/boot/Image
-rm -f arch/arm64/boot/dts/broadcom/*.dtb
-
-if ! [ -e .config ] ; then
-       make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- tizen_bcmrpi3_defconfig
-fi
-
-make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- -j8
-make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- dtbs
-if [ ! -f "./arch/arm64/boot/Image" ]; then
-       echo "Build fail"
-       exit 1
-fi
-
-make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- modules_prepare -j8
-make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- modules -j8
diff --git a/build-rpi3.sh b/build-rpi3.sh
new file mode 100755 (executable)
index 0000000..27eac56
--- /dev/null
@@ -0,0 +1,50 @@
+#!/bin/bash
+
+if [ $# != 1 ];
+then
+       echo "Usage : build-rpi3.sh <architecture>"
+       echo "  architecture : arm or arm64"
+       echo "  e.g) build-rpi3.sh arm"
+       exit
+fi
+
+# Check this system has ccache
+check_ccache()
+{
+       type ccache
+       if [ "$?" -eq "0" ]; then
+               CCACHE=ccache
+       fi
+}
+
+check_ccache
+
+if [ $1 = "arm" ]; then
+       echo "ARM"
+       rm -f arch/arm/boot/zImage
+       rm -f arch/arm/boot/dts/*.dtb
+       CROSS_COMPILER=arm-linux-gnueabi-
+       if ! [ -e .config ] ; then
+               make ARCH=arm CROSS_COMPILE="$CROSS_COMPILER" tizen_bcm2709_defconfig
+       fi
+       make ARCH=arm CROSS_COMPILE="$CROSS_COMPILER" -j8
+       if [ ! -f "./arch/arm/boot/zImage" ]; then
+               echo "Build fail"
+               exit 1
+       fi
+
+elif [ $1 = "arm64" ]; then
+       echo "ARM64"
+       rm -f arch/arm64/boot/Image
+       rm -f arch/arm64/boot/dts/broadcom/*.dtb
+       CROSS_COMPILER=aarch64-linux-gnu-
+
+       if ! [ -e .config ] ; then
+               make ARCH=arm64 CROSS_COMPILE="$CROSS_COMPILER" tizen_bcmrpi3_defconfig
+       fi
+       make ARCH=arm64 CROSS_COMPILE="$CROSS_COMPILER" -j8
+       if [ ! -f "./arch/arm64/boot/Image" ]; then
+               echo "Build fail"
+               exit 1
+       fi
+fi