more flexible and changed KERNEL_DIR environment variable to APHRODITE_DIR
All checks were successful
/ test (push) Successful in 12s

This commit is contained in:
Arthur Beck 2025-02-22 16:10:10 -06:00
parent 8d10160ea1
commit c8c5b5ad86
Signed by: ArthurB
GPG key ID: ACE3D14F5CEF14BF
2 changed files with 16 additions and 4 deletions

View file

@ -17,6 +17,7 @@
fi fi
fi fi
trap 'popd -0 2>&1 > /dev/null' EXIT
set -o errexit # put down here as getopt returns error code four if it's working, and it probably would work otherwise, but I'm not taking chances set -o errexit # put down here as getopt returns error code four if it's working, and it probably would work otherwise, but I'm not taking chances
check=false check=false
@ -60,7 +61,9 @@
fi fi
fi fi
export KERNEL_DIR=$(readlink -e .) TEMP_APHRODITE_DIR=$(readlink -e .)
APHRODITE_DIR="${APHRODITE_DIR:-$TEMP_APHRODITE_DIR}"
DIR="${BASH_SOURCE%/*}" DIR="${BASH_SOURCE%/*}"
if [[ ! -d "$DIR" ]]; then DIR="$PWD"; fi if [[ ! -d "$DIR" ]]; then DIR="$PWD"; fi
@ -75,10 +78,16 @@
rm -f targets.tmp rm -f targets.tmp
envsubst < "targets" > "targets.tmp" envsubst < "targets" > "targets.tmp"
# see above about -f
rm -f /tmp/aphrodite_dir
echo $APHRODITE_DIR > /tmp/aphrodite_dir # we really don't want this to be overwritten
export $(grep -Ev '^#' targets.tmp | xargs) export $(grep -Ev '^#' targets.tmp | xargs)
export $(grep -Ev '^#' config.aphro.tmp | xargs) export $(grep -Ev '^#' config.aphro.tmp | xargs)
APHRODITE_DIR=$(cat /tmp/aphrodite_dir)
get_version get_version
if [[ "$CFG_VERSION" != "$VERSION" ]]; then if [[ "$CFG_VERSION" != "$VERSION" ]]; then
@ -91,9 +100,12 @@
fi fi
function compile_one { function compile_one {
pushd . 2>&1 > /dev/null
cd "$APHRODITE_DIR"
target=$1 target=$1
real_target=${!target} real_target=${!target}
real_target=$(basename $real_target) target_json=$(basename $real_target)
real_target="$APHRODITE_DIR/$target_json"
if [[ $check = "true" ]]; then if [[ $check = "true" ]]; then
echo "[INFO] Checking target $target(with rust target of $real_target)" echo "[INFO] Checking target $target(with rust target of $real_target)"
cargo clippy --target "$real_target" --release -Zbuild-std=core,alloc --bin entrypoint_$target cargo clippy --target "$real_target" --release -Zbuild-std=core,alloc --bin entrypoint_$target
@ -103,7 +115,7 @@
cargo clippy --target "$real_target" --release -Zbuild-std=core,alloc --bin entrypoint_$target cargo clippy --target "$real_target" --release -Zbuild-std=core,alloc --bin entrypoint_$target
echo "[INFO] Building" echo "[INFO] Building"
cargo build --target "$real_target" --release -Zbuild-std=core,alloc --bin entrypoint_$target 2>/dev/null cargo build --target "$real_target" --release -Zbuild-std=core,alloc --bin entrypoint_$target 2>/dev/null
cp "target/$(echo $real_target | sed 's/\.json//')/release/entrypoint_$target" kernel-$target cp "target/$(echo $target_json | sed 's/\.json//')/release/entrypoint_$target" kernel-$target
if [[ "$CONFIG_BUILD_GRUB" = "true" ]]; then if [[ "$CONFIG_BUILD_GRUB" = "true" ]]; then
if [[ "$target" = "x86" || "$target" = "mips64" || "$target" = "mipsel" || "$target" = "mipsle" ]]; then if [[ "$target" = "x86" || "$target" = "mips64" || "$target" = "mipsel" || "$target" = "mipsle" ]]; then

View file

@ -1,4 +1,4 @@
# Targets used for documentation. # Targets used for documentation.
x86=$KERNEL_DIR/i686-unknown-none.json x86=$APHRODITE_DIR/i686-unknown-none.json
TARGETS=x86 TARGETS=x86