3 declare canon_name="canon-name/src/canon-name"
4 declare archive="work/archive"
6 if [[ ! -x "$canon_name" ]]; then
7 gmake -f mk/canon-name.mk
9 readonly platform=$("$canon_name")
11 echo "This is build-hc-pkg, running on \"$platform\"."
13 if [[ "$1" = "clean" ]]; then
20 if [[ -e "$archive" ]]; then
21 srcpath=$(cat "$archive")
24 if [[ -z "$srcpath" || ! -e "$srcpath" ]]; then
26 read -e -p "Enter the file path to ghc-x.y.z-src.tar.bz2: " srcpath
27 if [[ -e "$srcpath" ]]; then
29 echo "$srcpath" > "$archive"
31 echo "$srcpath not found." >&2
36 gmake -f mk/main.mk SRCPATH="$srcpath" PLATFORM="$platform" SHELL="$SHELL"
38 echo "If you are done, run \"$0 clean\" to cleanup the working directory."