Admin/bash_process/build
author wenzelm
Wed, 16 Mar 2016 22:19:08 +0100
changeset 62645 a2351f82bc48
parent 62566 fe02dcee9493
child 66691 a8703e8ee1d3
permissions -rwxr-xr-x
eliminated spurious Unicode, which is in conflict with Isabelle symbol interpretation;

#!/usr/bin/env bash
#
# Multi-platform build script

THIS="$(cd "$(dirname "$0")"; pwd)"
PRG="$(basename "$0")"


# diagnostics

function usage()
{
  echo
  echo "Usage: $PRG TARGET"
  echo
  exit 1
}

function fail()
{
  echo "$1" >&2
  exit 2
}


# command line args

[ "$#" -eq 0 ] && usage
TARGET="$1"; shift

[ "$#" -eq 0 ] || usage


# main

mkdir -p "$TARGET"

case "$TARGET" in
  x86_64-linux | x86_64-darwin)
    cc -Wall -m64 bash_process.c -o "$TARGET/bash_process"
    ;;
  x86-linux | x86-darwin)
    cc -Wall -m32 bash_process.c -o "$TARGET/bash_process"
    ;;
  x86-cygwin)
    cc -Wall bash_process.c -o "$TARGET/bash_process.exe"
    ;;
  *)
    cc -Wall bash_process.c -o "$TARGET/bash_process"
    ;;
esac