Admin/bash_process/build
author wenzelm
Wed, 19 May 2021 11:54:58 +0200
changeset 73740 c46ff0efa1ce
parent 73599 981df2e1f646
child 73705 ac07f6be27ea
permissions -rwxr-xr-x
more direct use of latex tools: avoid diversion into "isabelle latex -o pdf" and its confusion of ISABELLE_PDFLATEX vs. ISABELLE_LUALATEX; clarified ISABELLE_MAKEINDEX options;

#!/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
  arm64-linux)
    cc -Wall bash_process.c -o "$TARGET/bash_process"
    ;;
  x86_64-linux | x86_64-darwin)
    cc -Wall -m64 bash_process.c -o "$TARGET/bash_process"
    ;;
  x86_64-cygwin)
    cc -Wall bash_process.c -o "$TARGET/bash_process.exe"
    ;;
  *)
    fail "Bad target platform: \"$TARGET\""
    ;;
esac