#!/bin/sh

echo -n "Updating PATH environment variable..................."
#used to access the compiler binaries without having to specify the full path in Makefiles
export PATH=$PATH:$PWD/Toolchain/Compiler/bin:$PWD/Fides/Image_creator:$PWD/Toolchain/Linker/pcbac-x86_64-fides-ld
echo "[OK]"

echo -n "Updating PCBAC_PASSES environment variable..........."
#used to pass the compiled llvm passes to the spm compilers
export PCBAC_PASSES=$PWD/Toolchain/Compiler/build/x86_64/Fides/
echo "[OK]"

echo -n "Updating PCBAC_INCLUDE environment variable.........."
#used to be able to use annotations to the SPMs
export PCBAC_INCLUDE=$PWD:$PWD/Toolchain/Compiler/:$PWD/Fides/:$PWD/Fides/Fides/:$PWD/Toolchain/Linker/libelf/:$PWD/Toolchain/Resources:$PWD/Toolchain/
echo "[OK]"

echo -n "Updating PCBAC_RESOURCES environment variable........"
#used to find the linker script, fides_libc etc.
export PCBAC_RESOURCES=$PWD/Toolchain/fides_libc:$PWD/Toolchain/Crypto:$PWD/Toolchain/ICE/libicebase:$PWD/Toolchain/ICE/libice0:$PWD/Toolchain/ICE/libicen:$PWD/Toolchain/ICE/libicesupport:$PWD/Toolchain/Compiler/Resources:$PWD/Toolchain/Linker/libelf/:$PWD/Toolchain/SPM_Support:$PWD/Toolchain/SPM_Loader:$PWD/Toolchain/SPM_Core
echo "[OK]"

echo -n "Updating PCBAC_ICE0 environment variable............."
#used to find the ice0.spm SPM
export PCBAC_ICE0=$PWD/Toolchain/ICE/ice0/ice0.spm
echo "[OK]"

echo -n "Updating PCBAC_ICE0_EMULATED environment variable...."
#used to find the ice0.emulated.spm SPM
export PCBAC_ICE0_EMULATED=$PWD/Toolchain/ICE/ice0/ice0.emulated.spm
echo "[OK]"
echo "...................................................[DONE]"
