-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfarm-compile.in
74 lines (65 loc) · 1.41 KB
/
farm-compile.in
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
#! /bin/bash
# Compile code in the current directory against all configured trees
set -e
prefix=@prefix@
datarootdir=@datarootdir@
confdir=@datadir@/@PACKAGE_NAME@
. ${confdir}/farm-lib.sh
set_trap
if test -d ath_rate; then
flavor=madwifi
target=modules
cleanargs="KERNELRELEASE=0"
fi
if test -f utils/ndiswrapper; then
flavor=ndiswrapper
target=driver
fi
if test -d drivers/ssb; then
flavor=backports
target=modules
fi
error=
for bintree in $(ls -d $farmbin/* | sort -V); do
arch=
if test -r $bintree/configured-i386; then
arch=i386
ccflags=-m32
fi
if test -r $bintree/configured-x86_64; then
arch=x86_64
ccflags=-m64
fi
test -n "$arch" || continue
log=Log-$(basename $bintree)
rm -f $log $log-ok $log-error
treeargs="KBUILD=$bintree KERNELPATH=$bintree KERNEL_PATH=$bintree \
KLIB_BUILD=$bintree"
if ! $make clean $treeargs $cleanargs VERSION_HEADER=. >/dev/null; then
echo_red "Cannot clean"
error=1
continue
fi
if test "$flavor" = "backports"; then
$make ARCH=$arch $treeargs defconfig-wifi >/dev/null 2>&1
fi
echo -n "Checking $bintree "
if $make HOSTCC="$ucc $ucflags" CC="$kcc $ccflags" \
ARCH=$arch $treeargs C=2 CF="-D__CHECK_ENDIAN__" \
$target >$log 2>&1; then
mv $log $log-ok
echo_green "OK"
else
error=1
mv $log $log-error
echo_red "ERROR"
fi
done
unset_trap
if test -z "$error"; then
echo_green "All OK"
exit 0
else
echo_red "Errors found"
exit 1
fi