Skip to content
Snippets Groups Projects
makestatic.sh 942 B
Newer Older
  • Learn to ignore specific revisions
  • #!/bin/bash -e
    
    
    
    ::() { echo ":: $*" ; "$@" ; }
    die() { echo "$*" ; exit 1 ; }
    
    [ -d .git ] || die "$0 only works in the git-repository!"
    
    
    Thorsten Wißmann's avatar
    Thorsten Wißmann committed
    dir=cool-$(uname -m)-$(date +%Y-%m-%d-%H-%M)
    
    :: mkdir -p $dir
    :: pushd $dir
    :: git --git-dir=.git pull || :: git clone .. .
    
    make clean
    oasis setup
    ocaml setup.ml -configure --enable-static
    ocaml setup.ml -build
    
    files=(
    )
    
    binary() {
        files+=( "$1" )
        cp $1.native $1
    }
    
    binary coalg
    binary cool-testsuite
    binary coalgcompare
    binary cool-owl
    
    files+=(
        *.sh
        BUGS
        INSTALL
        VERSION
        _oasis
        testbench/
        cool2tatl
        setup.ml
        src/
    )
    
    cat >VERSION <<EOF
    COOL Static Linux-Binaries
    ==========================
    This version of COOL was...
      - build on $(date).
      - build for the architecture $(uname -m).
    
      - distributed without benchmarks (to reduce file size)
    
    
    
    Last commit
    -----------
    $(git log HEAD~1..)
    
    EOF
    
    popd
    
    zip -r "$dir.zip" $(printf "$dir/%s\n" "${files[@]}")