File: local-builds.sh

package info (click to toggle)
ncbi-vdb 2.8.1%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 41,972 kB
  • ctags: 36,168
  • sloc: ansic: 345,112; cpp: 35,285; sh: 4,407; makefile: 3,963; perl: 3,445; python: 2,737; java: 977; lex: 195; yacc: 126; lisp: 77; xml: 75
file content (72 lines) | stat: -rwxr-xr-x 1,734 bytes parent folder | download | duplicates (4)
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
70
71
72
#!/bin/bash

# consider the entire matrix to have a single timestamp
NOW=$(date "+%Y-%m-%d.%H.%M.%S")

# for most builds, we use a separate host to determine architecture
# and these will have a single item in the list called "default"
ARCH_LIST=$(make architectures)
if [ "$ARCH_LIST" = "default" ]
then
    CUR_ARCH=$(make architecture)
else
    CUR_ARCH=all-arch
fi

run ()
{
    echo "MAKE COMMANDS: make $*"

    for COMPILER in $(make compilers)
    do
        make $COMPILER 1> /dev/null

        for LINKAGE in dynamic static
        do

            make $LINKAGE 1> /dev/null

            for ARCHITECTURE in $ARCH_LIST 
            do

                if [ "$ARCHITECTURE" = "default" ]
                then
                    ARCHITECTURE=$CUR_ARCH
                else
                    make $ARCHITECTURE 1> /dev/null
                fi

                for OPTIMIZATION in debug release profile
                do

                    make $OPTIMIZATION 1> /dev/null

                    TARGET_DIR=$(make targdir)

                    if make $* 1> "$TARGET_DIR/$NOW-build.log" 2> "$TARGET_DIR/$NOW-build.err"
                    then
                        STATUS="COMPLETED"
                    else
                        STATUS=" FAILED  "
                    fi

                    printf "%-32s [ %s ]\n" $COMPILER.$LINKAGE.$ARCHITECTURE.$OPTIMIZATION "$STATUS"

                done

            done

        done

    done
}

# going to put a log of this activity into OS output directory
OS_DIR=$(make osdir)
[ -d "$OS_DIR" ] || mkdir -p "$OS_DIR"

# log based upon architecture to avoid competitions
LOG_FILE="$OS_DIR/$NOW-build-$CUR_ARCH.log"

# run the matrix of builds
run $* 2>&1 | tee "$LOG_FILE"