#!/bin/sh # build the gdo executable set -e HC="ghc -v0" gdo --if Changed build_util.sh Main.hs gdo --if Created environment source ./build_util.sh if [ -e environment ]; then source ./environment fi TEMPMAKEFILE=$(mktemp) trap "rm ${TEMPMAKEFILE} -rf" EXIT SIGTERM SIGINT ${HC} Main.hs -M -dep-suffix '' -dep-makefile ${TEMPMAKEFILE} OBJECTS=$(cat ${TEMPMAKEFILE} | filter_comments | extract_exec_deps) gdo --if Changed ${OBJECTS} ${HC} ${OBJECTS} ${GHC_PACKAGES} -o ${3}