Idris2/bootstrap-stage2.sh
Stiopa Koltsov afaf416673 Write files into bootstrap-build directory during bootstrap
... instead of `bootstrap` which contains source files. Make it easier to understand
how build works, and in particular, which files are sources and
which files are generated.
2021-07-04 03:17:13 +01:00

36 lines
1.1 KiB
Bash
Executable File

#!/bin/sh
set -e # exit on any error
PREFIX=$PWD/bootstrap-build
if [ "$OS" = "windows" ]; then
# IDRIS_PREFIX is only used to build IDRIS2_BOOT_PATH
IDRIS_PREFIX=$(cygpath -m "$PREFIX")
SEP=";"
else
IDRIS_PREFIX=$PREFIX
SEP=":"
fi
IDRIS2_CG="${IDRIS2_CG-"chez"}"
BOOT_PATH_BASE=$IDRIS_PREFIX/idris2-$IDRIS2_VERSION
IDRIS2_BOOT_PATH="$BOOT_PATH_BASE/prelude$SEP $BOOT_PATH_BASE/base$SEP $BOOT_PATH_BASE/contrib$SEP $BOOT_PATH_BASE/network $BOOT_PATH_BASE/test"
# PREFIX must be the "clean" build root, without cygpath -m
# Otherwise, we get 'git: Bad address'
echo "$PREFIX"
DYLIB_PATH="$PREFIX/lib"
$MAKE libs IDRIS2_CG="$IDRIS2_CG" LD_LIBRARY_PATH="$DYLIB_PATH" \
PREFIX="$PREFIX" SCHEME="$SCHEME"
$MAKE install IDRIS2_CG="$IDRIS2_CG" LD_LIBRARY_PATH="$DYLIB_PATH" \
PREFIX="$PREFIX" SCHEME="$SCHEME"
# Now rebuild everything properly
$MAKE clean-libs IDRIS2_BOOT="$PREFIX/bin/idris2"
$MAKE all IDRIS2_BOOT="$PREFIX/bin/idris2" IDRIS2_CG="$IDRIS2_CG" \
IDRIS2_PATH="$IDRIS2_BOOT_PATH" LD_LIBRARY_PATH="$DYLIB_PATH" \
SCHEME="$SCHEME"