Welcome to the CHICKEN Scheme pasting service

make-chicken.sh added by mario-goulart on Fri Jan 19 13:57:16 2024

#! /bin/sh

set -e

PREFIX=${PREFIX:-$HOME/local/chicken-test}
C_COMPILER=${C_COMPILER:-tcc}
DEBUGBUILD=${DEBUGBUILD:-0}
CHICKEN=${CHICKEN:-chicken}

usage() {
    cat <<EOF
Usage: $(basename "$0") <options>

<options>
  --force-boot      Force boot-chicken
  --no-install      Do not install
  --check           Run make check
EOF
}

force_boot=false
installp=true
check=false

while [ $# -gt 0 ]; do
    case "$1" in
        -h|-help|--help)
            usage
            exit 0
            ;;
        --force-boot)
            force_boot=true
            shift
            ;;
        --no-install)
            installp=false
            shift
            ;;
        --check)
            check=true
            shift
            ;;
        *)
            shift
            ;;
    esac
done


bootp=true
[ -x chicken-boot ] && ! "$force_boot" && bootp=false

jobs=$(nproc)

build() {
    set -e
    set -x
    make PREFIX="$PREFIX" C_COMPILER="$C_COMPILER" DEBUGBUILD="$DEBUGBUILD" "$@"
    set +x
}

if "$bootp"; then
    build CHICKEN="$CHICKEN" spotless
    build CHICKEN="$CHICKEN" boot-chicken -j "$jobs"
fi

build CHICKEN=./chicken-boot -j "$jobs"

if "$installp"; then
    rm -rf "$PREFIX"
    build CHICKEN=./chicken-boot install
fi

if "$check"; then
    build CHICKEN=./chicken-boot check
fi

Your annotation:

Enter a new annotation:

Your nick:
The title of your paste:
Your paste (mandatory) :
Which egg implements a Scheme to JavaScript compiler?
Visually impaired? Let me spell it for you (wav file) download WAV