-
Notifications
You must be signed in to change notification settings - Fork 1
/
make-all
executable file
·69 lines (59 loc) · 1.32 KB
/
make-all
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
#!/bin/sh
INSTALL_DIR=/var/www/midge/kamikaze/20061129/
clean_root(){
make clean_root
}
clean_linux(){
rm -rf build_mipsel/linux*
}
clean_build(){
rm -rf build_mipsel
}
install(){
mkdir -p $INSTALL_DIR
cp -a bin $INSTALL_DIR
rm -f bin/openwrt*
}
build(){
local ver=$1
local config=$2
clean_linux
temp=`tempfile -p linux -s -config`
if [ -r target/linux/adm5120-$ver/config-$config ]; then
cp target/linux/adm5120-$ver/config $temp
cp target/linux/adm5120-$ver/config-$config target/linux/adm5120-$ver/config
fi
cp target/linux/adm5120-$ver/openwrt-config-$config .config
make oldconfig DEVELOPER=1
make --jobs=4 V=99
ret=$?
if [ "$ret" = 0 ]; then
rename "s/.bin/-$config.bin/" bin/*
install
fi
if [ -s $temp ]; then
cp $temp target/linux/adm5120-$ver/config
fi
rm $temp
[ "$ret" != 0 ] && exit 1
}
make_snapshot() {
dir=$(basename `pwd`)
cd ..
tar cvjf $INSTALL_DIR/openwrt-midge-snapshot-`date +%Y%m%d`.tar.bz2 \
--exclude $dir/dl \
--exclude $dir/bin \
--exclude $dir/build_mips \
--exclude $dir/build_mipsel \
--exclude $dir/staging_dir_mips \
--exclude $dir/staging_dir_mipsel \
--exclude $dir/toolchain_build_mips \
--exclude $dir/toolchain_build_mipsel \
$dir
}
#clean_build
build 2.4 midge-cirouter
#build 2.4 midge-full
#clean_build
#build 2.6 sigrand
make_snapshot