This commit is contained in:
K. Lange 2018-03-21 17:17:48 +09:00 committed by Kevin Lange
parent 5408b34ccf
commit 5688627461
4 changed files with 33 additions and 12 deletions

View File

@ -1,7 +1,16 @@
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)
ifeq ($(shell util/check.sh),y)
export PATH := $(shell util/activate.sh)
else
FOO := $(shell util/prompt.sh)
ifeq ($(shell util/check.sh),y)
export PATH := $(shell util/activate.sh)
else
$(error "No toolchain, and you did not ask to build it.")
endif
endif
endif
KERNEL_TARGET=i686-pc-toaru

View File

@ -1,17 +1,6 @@
#!/bin/bash
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
if [ ! -e "$DIR/local/bin/i686-pc-toaru-gcc" ]; then
echo -n "Toolchain has not been built. Would you like to build it now? (y/n) " >&2
read response
case $response in
[yY]) bash $DIR/build-gcc.sh ;;
[nN]) exit 1 ;;
*) exit 1 ;;
esac
fi
export PATH="$DIR/local/bin:$PATH"
export TOOLCHAIN="$DIR"
echo "$DIR/local/bin:$PATH"

11
util/check.sh Executable file
View File

@ -0,0 +1,11 @@
#!/bin/bash
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
if [ ! -e "$DIR/local/bin/i686-pc-toaru-gcc" ]; then
echo -n "n";
exit 1;
else
echo -n "y";
exit 0;
fi

12
util/prompt.sh Executable file
View File

@ -0,0 +1,12 @@
#!/bin/bash
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
echo -n "Toolchain has not been built. Would you like to build it now? (y/n) " >&2
read response
case $response in
[yY]) bash $DIR/build-gcc.sh >&2 ;;
[nN]) echo -n "n" && exit 1 ;;
*)
esac