MAKEALL 1 KB
Newer Older
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
#!/bin/sh

# This trivially compiles all known-good configurations

function build_one () {
    make -s clean
    echo "####################"
    echo "Build for " "$1"
    make -s -k $2
    test -f pproto.o && size pproto.o
    test -f pproto && size pproto
}

function build_diags () {
    build_one "arch \"$ARCH\", ext \"$PROTO_EXT\", no diag"
    build_one "arch \"$ARCH\", ext \"$PROTO_EXT\", mini diag" HAS_DIAG=y
    build_one "arch \"$ARCH\", ext \"$PROTO_EXT\", full diag" HAS_FULL_DIAG=y
}

function build_ext () {
    unset PROTO_EXT
    build_diags
    #export PROTO_EXT=one
    #build_diags
}

for var in HAS_DIAG HAS_FULL_DIAG CROSS_COMPILE ARCH; do
    unset $var
done

# Build for default ARCH first
unset ARCH
build_ext

# Finally, loop over all archs, using our local names for compilers
PREFIX_bare_linux=""
PREFIX_spec="/opt/gcc-lm32/bin/lm32-elf-"

for a in bare-linux spec; do
    export ARCH=$a
    ARCH_=""
    eval export CROSS_COMPILE="\${PREFIX_$(echo $ARCH | sed 's/-/_/g')}"
    build_ext
done