diff options
| author | Jan Tuomi <jans.tuomi@gmail.com> | 2024-01-24 16:57:56 +0200 |
|---|---|---|
| committer | Jan Tuomi <jans.tuomi@gmail.com> | 2024-01-24 17:12:45 +0200 |
| commit | 0bc80beb699000826b8e9415a7b254c92dc86a5a (patch) | |
| tree | c67c5ea7e06447339e811ef2c177bcf920d68fc5 /build.sh | |
| parent | b5ddfdc53cf1cf2197adf8718ea405acfa2fe6f7 (diff) | |
Do things
Diffstat (limited to 'build.sh')
| -rwxr-xr-x | build.sh | 31 |
1 files changed, 22 insertions, 9 deletions
@@ -1,18 +1,31 @@ #!/bin/bash -set -euxo pipefail +# if the first flag is -h or --help, then show usage +if [[ $1 == "-h" || $1 == "--help" ]]; then + echo "Usage: build.sh [OPTION]" + echo "Builds the desmoctl binary." + echo "" + echo "Options:" + echo " -h, --help Show this help message" + echo " -d, --debug Enable debugging" + exit 0 +fi -CSC_FLAGS=-O3 BUILD_DIR=build -mkdir -p ${BUILD_DIR} -cd ${BUILD_DIR} +# if the first flag is --debug or -d, then set CHICKEN_DEBUGGER=localhost:9999 and add -d3 to CSC_FLAGS +if [[ $1 == "--debug" || $1 == "-d" ]]; then + export CHICKEN_DEBUGGER=localhost:9999 + export CSC_FLAGS="-d3" +else + export CHICKEN_DEBUGGER= + export CSC_FLAGS=-O3 +fi -modules=$(cat ../modules.list) +set -euxo pipefail -for mod in $modules; do - csc ${CSC_FLAGS} -c -static -J ../${mod}.scm -unit ${mod} -o ${mod}.o -done +mkdir -p ${BUILD_DIR} +cd ${BUILD_DIR} -csc ${CSC_FLAGS} -o desmoctl -static -uses desmo-apply ../desmoctl.scm +csc ${CSC_FLAGS} -o desmoctl -static ../desmoctl.scm chmod +x desmoctl |
