summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2009-06-29 22:12:23 (GMT)
committerH. Peter Anvin <hpa@zytor.com>2009-06-29 22:12:23 (GMT)
commit90f0cbc9a9e25e95730a74ab5aaca95ea31d6a3f (patch)
treed31f04b6e4e7e313d2958724353d3ec9c15ad50f
parent6b81a8d8e9c40b71cdfa1812ca20b10f66d6613b (diff)
downloadktest-90f0cbc9a9e25e95730a74ab5aaca95ea31d6a3f.zip
ktest-90f0cbc9a9e25e95730a74ab5aaca95ea31d6a3f.tar.gz
ktest-90f0cbc9a9e25e95730a74ab5aaca95ea31d6a3f.tar.bz2
ktest-90f0cbc9a9e25e95730a74ab5aaca95ea31d6a3f.tar.xz
allmake.sh: clean up a lot
-rwxr-xr-xallmake.sh42
1 files changed, 21 insertions, 21 deletions
diff --git a/allmake.sh b/allmake.sh
index 520b49d..e8ef4af 100755
--- a/allmake.sh
+++ b/allmake.sh
@@ -8,15 +8,16 @@ fi
set -xe
canned='i386 x86_64 i386-pae'
+special='i386-allconfig x86_64-allconfig i386-noconfig x86_64-noconfig'
if [ -z "$ALL" ]; then
- ALL="$canned i386-allconfig x86_64-allconfig i386-noconfig x86_64-noconfig"
+ ALL="$canned $special"
fi
here=`dirname "$0"`
cpus=$(grep '^processor' < /proc/cpuinfo | wc -l)
-jobs=$((cpus*2))
+jobs=$((cpus))
# This can be 'ccache gcc'
gcc=gcc
@@ -39,22 +40,17 @@ done
#
# Automatic configurations
#
-mkdir -p o.i386-allconfig o.x86_64-allconfig \
- o.i386-noconfig o.x86_64-noconfig
-make ARCH=x86_64 O=o.x86_64-allconfig CC="$gcc" allyesconfig
-sed -r -e 's/^(CONFIG_DEBUG_INFO)=./\1=n/' -i o.x86_64-allconfig/.config
-sed -r -e 's/^(CONFIG_CMDLINE_BOOL)=./\1=n/' -i o.x86_64-allconfig/.config
-sed -r -e 's/^(CONFIG_BROKEN)=./\1=n/' -i o.x86_64-allconfig/.config
-sed -r -e 's/^(CONFIG_SERIAL_MAX3100)=./\1=n/' -i o.x86_64-allconfig/.config
-make ARCH=i386 O=o.i386-allconfig CC="$gcc -m32" allyesconfig
-sed -r -e 's/^(CONFIG_DEBUG_INFO)=./\1=n/' -i o.i386-allconfig/.config
-sed -r -e 's/^(CONFIG_CMDLINE_BOOL)=./\1=n/' -i o.i386-allconfig/.config
-sed -r -e 's/^(CONFIG_BROKEN)=./\1=n/' -i o.i386-allconfig/.config
-sed -r -e 's/^(CONFIG_SERIAL_MAX3100)=./\1=n/' -i o.i386-allconfig/.config
-make ARCH=x86_64 O=o.x86_64-noconfig CC="$gcc" allnoconfig
-make ARCH=i386 O=o.i386-noconfig CC="$gcc -m32" allnoconfig
+for a in x86_64 i386; do
+ if [ "$a" = i386 ]; then gccopt=' -m32'; else gccopt=''; fi
+ mkdir -p o.$a-allconfig o.$a-noconfig
+ make ARCH=$a O=o.$a-allconfig CC="$gcc$gccopt" allyesconfig
+ sed -r -e 's/^(CONFIG_DEBUG_INFO|CONFIG_CMDLINE_BOOL|CONFIG_BROKEN|CONFIG_SERIAL_MAX3100)=./\1=n/' \
+ -i o.$a-allconfig/.config
+ make ARCH=$a O=o.$a-noconfig CC="$gcc$gccopt" allnoconfig
+done
MKFILE=/tmp/allmake.$$
+rm -f $MKFILE
fdargs='ro root=/dev/sda1 console=ttyS0,115200 earlyprintk=serial,ttyS0'
@@ -66,15 +62,19 @@ CONFIG_DEBUG_SECTION_MISMATCH := y
export CONFIG_DEBUG_SECTION_MISMATCH
all: $ALL
+EOF
-x86_64 x86_64-allconfig x86_64-noconfig:
- \$(MAKE) ARCH=x86_64 O=o.\$@ CC="$gcc" \$(TARGET) \
- 2>&1 | tee \$(TEEOPT) o.\$@/make.log
+for c in $canned $special; do
+ arch=$(echo "$c" | cut -d- -f1)
+ if [ "$arch" = i386 ]; then gccopt=' -m32'; else gccopt=''; fi
+
+cat >> $MKFILE <<EOF
-i386 i386-allconfig i386-noconfig:
- \$(MAKE) ARCH=i386 O=o.\$@ CC="$gcc -m32" \$(TARGET) \
+$c:
+ \$(MAKE) ARCH=$arch O=o.\$@ CC="$gcc$gccopt" \$(TARGET) \
2>&1 | tee \$(TEEOPT) o.\$@/make.log
EOF
+done
make -j$jobs -f $MKFILE "$@"
make -j$jobs -f $MKFILE FDARGS="$fdargs" TARGET=isoimage TEEOPT='-a' "$@"