Automatically source toolchain when building

This commit is contained in:
K. Lange 2018-03-21 16:48:33 +09:00 committed by Kevin Lange
parent f6bbb8b2cb
commit 0c41873da8
2 changed files with 12 additions and 0 deletions

View File

@ -1,5 +1,9 @@
APPS=init hello sh ls terminal uname compositor drawlines background session kdebug cat yutani-test sysinfo hostname yutani-query env mount date echo nyancat kill ps pstree bim terminal-vga cursor-off font-server migrate free uptime
ifeq ($(TOOLCHAIN),)
export PATH := $(shell util/activate.sh)
endif
KERNEL_TARGET=i686-pc-toaru
KCC = $(KERNEL_TARGET)-gcc
KAS = $(KERNEL_TARGET)-as

8
util/activate.sh Normal file → Executable file
View File

@ -1,4 +1,12 @@
#!/bin/bash
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
if [ ! -e "$DIR/local/bin/i686-pc-toaru-gcc" ]; then
echo "Toolchain has not been built. Please run \`bash util/build-gcc.sh\`." >&2
exit 1
fi
export PATH="$DIR/local/bin:$PATH"
export TOOLCHAIN="$DIR"
echo "$DIR/local/bin:$PATH"