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

5 6 7 8
# Prevent random user setup to invalidate building for all.
unset CROSS_COMPILE
unset ARCH

9 10
# Backup previous .config file, if present
rm -f .config.backup 2> /dev/null
11
cp -a .config .config.backup 2> /dev/null
12

13 14 15 16 17 18 19
# make some temporary files for logs
C=$(mktemp /tmp/ppsi-config.XXXXXX)
remove_tmp_c=true

B=$(mktemp /tmp/ppsi-build.XXXXXX)
remove_tmp_b=true

20 21 22
# loop on default .config files, building for all architectures or for those
# listed on the command line
[ $# -ne 0 ] && configs=$* || configs=$(ls configs)
23 24 25
for c in $configs; do
    echo "##### Building with '$c'"
    echo "##### Building with '$c'" >> $B
26 27
    echo "##### Configuring for '$c'" >> $C
    # make config and log
28 29 30 31
    if ! make -s $c 2>&1 >> $C; then
	echo "Error in configuration (see $C)"
	remove_tmp_c=false
    fi
32
    make -s clean
33
    # build binaries and log
34 35 36
    if ! make  -j5  2>&1 >> $B; then
	echo "Build error (see $B)"
	remove_tmp_b=false
37
    fi
38
    # print sizes
39
    test -f ppsi.o && size ppsi.o
40
    test -f ppsi && size ppsi | tail -n 1
41

42
done
43 44 45 46

make -s clean

# clean logs if succesful
47 48
if $remove_tmp_c; then rm $C; fi
if $remove_tmp_b; then rm $B; fi
49 50 51 52

# restore previous .config file if needed, otherwise just clean.
rm -f .config 2> /dev/null
mv -f .config.backup .config 2> /dev/null