summaryrefslogtreecommitdiff
path: root/MAKEALL
blob: dd0f66b7b2ce652fc7369604773dc467afa1f926 (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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
#!/bin/bash

check_pipe_status() {
        for i in  "${PIPESTATUS[@]}"; do
		[ $i -gt 0 ] && return 1
        done
	return 0
}


HERE=$(pwd)
AUTOBUILD_DIR=${HERE}/autobuild
REPORT=${AUTOBUILD_DIR}/REPORT

if [ -d "${AUTOBUILD_DIR}" ]; then
	echo "warning: ${AUTOBUILD_DIR} exists, press <ctrl-c> to exit or wait for 3 seconds"
	sleep 3
	rm -fr ${AUTOBUILD_DIR}
fi

mkdir -p ${AUTOBUILD_DIR}

BOARDS="${BOARDS} sandbox"
sandbox_ARCH=sandbox
sandbox_CROSS_COMPILE=

BOARDS="${BOARDS} ipe337"
ipe337_ARCH=blackfin
ipe337_CROSS_COMPILE=bfin-elf-

BOARDS="${BOARDS} netx_nxdb500"
netx_nxdb500_ARCH=arm
netx_nxdb500_CROSS_COMPILE=arm-v4t-linux-gnueabi-

BOARDS="${BOARDS} pcm030"
pcm030_ARCH=ppc
pcm030_CROSS_COMPILE=powerpc-603e-linux-gnu-

BOARDS="${BOARDS} pcm037"
pcm037_ARCH=arm
pcm037_CROSS_COMPILE=arm-1136jfs-linux-gnueabi-

BOARDS="${BOARDS} pcm038"
pcm038_ARCH=arm
pcm038_CROSS_COMPILE=arm-v4t-linux-gnueabi-

for board in ${BOARDS}; do

	time_start=$(date +%s)
	arch=${board}_ARCH
	cross_compile=${board}_CROSS_COMPILE
	mkdir -p ${AUTOBUILD_DIR}/${board}
	printf "%-20s defconfig: " ${board} | tee -a ${REPORT}

	make -C ${HERE} \
		O=${AUTOBUILD_DIR}/${board} \
		ARCH=${!arch} \
		${board}_defconfig \
		> ${AUTOBUILD_DIR}/${board}.log 2>&1

	check_pipe_status
	if [ "$?" = "0" ]; then

		printf "OK     " | tee -a ${REPORT}
		printf "compile: " ${board} | tee -a ${REPORT}

		make -C ${HERE} \
			O=${AUTOBUILD_DIR}/${board} \
			ARCH=${!arch} \
			CROSS_COMPILE=${!cross_compile} \
			> ${AUTOBUILD_DIR}/${board}.log 2>&1

		check_pipe_status
		if [ "$?" = "0" ]; then
			printf "OK     " | tee -a ${REPORT}
		else
			printf "FAILED " | tee -a ${REPORT}
		fi

	else
		printf "FAILED " | tee -a ${REPORT}
		printf "compile: ------ " | tee -a ${REPORT}
	fi

	time_stop=$(date +%s)
	time_diff=$(($time_stop - $time_start))
	printf "%4is\n" $time_diff | tee -a ${REPORT}
done