MAKEALL 1.87 KB
Newer Older
1 2
#!/bin/sh
# A trivial script to build with all known configurations
3
# (please add a file in configs/*_defconfig to test your special case)
4 5

T=$(mktemp /tmp/wrpc-config.XXXXXX)
6 7 8 9
TW=$(mktemp /tmp/save-dotconfig-wrpc.XXXXXX)
TP=$(mktemp /tmp/save-dotconfig-ppsi.XXXXXX)
test -f .config && cp .config $TW
test -f ppsi/.config && cp ppsi/.config $TP
10

11 12 13 14 15 16 17
# check whether we want to compare sizes of binaries to older builds
if [ $# -ne 0 ] && [ x"$1" = x"-c" ]; then
    compare_mode=y
    shift;
fi


18
configs=$(cd configs; echo *_defconfig)
19 20 21 22
if [ $# -ne 0 ]; then
    configs="$*"
fi

23 24 25 26 27
if [ x"$compare_mode" = x"y" ]; then
    if ! [ -n "$size_db_file" ]; then
	size_db_file=size_db.txt
	echo "No file with size DB specified! Using default ($size_db_file)"
    fi
28

29 30 31 32
    if ! [ -n "$size_info_file" ]; then
	size_info_file=size_info.txt
	echo "No file with size info specified! Using default ($size_info_file)"
    fi
33 34 35 36 37 38 39
fi

export size_db_file
export size_info_file

rm -rf $size_info_file

40
# remove files from the previous compilations first
41
make distclean -s
42

43 44
for c in $configs; do
    echo "##### Building with '$c'"
45 46 47 48 49 50
    if ! make -s clean; then
	echo "Error while cleaning (see $T)"
	exit 1
    fi
    rm -f ppsi/.config

51 52 53 54
    if ! make $c 2>&1 >> $T; then
	echo "Error in configuration (see $T)"
	exit 1
    fi
55 56
    DEFCONFIG_NAME=$c
    export DEFCONFIG_NAME
57 58
    # Remove "# configuration written to .config" from output
    make -s | grep -v '^#'
59 60 61
    if [ x"$compare_mode" = x"y" ]; then
	make makeall_copy
    fi
62
done
63 64 65 66 67 68 69
make -s clean

# Recover local configs
cp $TW .config; rm $TW
cp $TP ppsi/.config; rm $TP

rm $T
70

71 72 73 74 75 76 77 78
if [ x"$compare_mode" = x"y" ]; then
    ./compare_size.sh 1>&2
    GIT_HASH=`git log --format=format:%H -1`
    if [ -f "$size_db_file" ]; then
	cat "$size_db_file" | grep -v $GIT_HASH > "$size_db_file".tmp
	mv "$size_db_file".tmp "$size_db_file"
    fi
    cat "$size_info_file" >> "$size_db_file"
79
fi