summaryrefslogtreecommitdiff
path: root/build-rpi3.sh
blob: 27eac56c8f891122d6e35eca50fa27c3e7a199ee (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
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