Do a better job of running check-reqs

This commit is contained in:
Kevin Lange 2012-02-05 17:40:19 -06:00
parent c4e33117c0
commit 9b5e26164f
4 changed files with 18 additions and 36 deletions

View File

@ -39,11 +39,11 @@ ENDRM = util/mk-end-rm
EMUARGS = -kernel toaruos-kernel -m 256 -initrd toaruos-initrd -append "vid=qemu hdd" -serial stdio -vga std -hda toaruos-disk.img
EMUKVM = -enable-kvm
.PHONY: all check-toolchain system clean clean-once clean-hard clean-soft clean-docs clean-bin clean-aux clean-core update-version install run docs utils
.PHONY: all system clean clean-once clean-hard clean-soft clean-docs clean-bin clean-aux clean-core update-version install run docs utils
.SECONDARY:
all: .passed system docs utils tags
system: toaruos-initrd toaruos-disk.img toaruos-kernel
system: .passed toaruos-initrd toaruos-disk.img toaruos-kernel
install: system
@${BEG} "CP" "Installing to /boot..."
@ -63,15 +63,12 @@ utils: ${UTILITIES}
@util/check-reqs > /dev/null
@touch .passed
check-toolchain:
@util/install-toolchain.sh
#################
# Documentation #
#################
docs: docs/core.pdf
docs/core.pdf: docs/*.tex
docs/core.pdf: docs/*.tex
@${BEG} "docs" "Generating documentation..."
@pdflatex -draftmode -halt-on-error -output-directory docs/ docs/core.tex > /dev/null ${ERRORS}
@makeindex -q docs/*.idx ${ERRORS}
@ -81,7 +78,7 @@ docs/core.pdf: docs/*.tex
################
# Kernel #
################
toaruos-kernel: kernel/start.o kernel/link.ld kernel/main.o ${SUBMODULES}
toaruos-kernel: .passed kernel/start.o kernel/link.ld kernel/main.o ${SUBMODULES}
@${BEG} "LD" "$<"
@${LD} -T kernel/link.ld -o toaruos-kernel kernel/*.o ${SUBMODULES} ${ERRORS}
@${END} "LD" "$<"
@ -102,7 +99,7 @@ kernel/sys/version.o: kernel/*/*.c kernel/*.c
################
# Ram disk #
################
toaruos-initrd: initrd/boot/kernel
toaruos-initrd: .passed initrd/boot/kernel
@${BEG} "initrd" "Generating initial RAM disk"
@# Get rid of the old one
@-rm -f toaruos-initrd

View File

@ -22,7 +22,7 @@ Clone the git repository and run:
# Retreive the precompiled binaries:
util/grab-binaries.sh
make # to build the kernel
make system # to build the kernel
make run # to run qemu with the proper arguments
# Or, if you have KVM...
make kvm # to run qemu in KVM mode

View File

@ -18,6 +18,8 @@ function BAIL {
exit 1
}
INFO "Checking for required tools (one-time check)..."
if [ -z `which clang` ] ; then
WARN "Missing clang"
if [ -z `which gcc` ] ; then
@ -35,3 +37,13 @@ if [ -z `which genext2fs` ] ; then
BAIL
fi
if [ -z `which qemu` ] ; then
if [ -z `which qemu-system-i386` ] ; then
ERROR "Missing qemu"
INFO "You can probably install it from a package of the same name."
fi
ERROR "qemu is installed, but not as 'qemu'"
INFO "You have a version of qemu which does not provide the 'qemu' binary."
INFO "You should run 'ln -s ~/bin/qemu \`which qemu-system-i386\` or similar to correct this."
fi

View File

@ -1,27 +0,0 @@
#!/bin/bash
TOOLCHAIN=`which i686-pc-toaru-gcc`
if [[ -n "$TOOLCHAIN" ]] ; then
echo "Toolchain is present at $TOOLCHAIN"
exit 0
fi
echo -e "\033[1mYou do not appear to have a toolchain available for とあるOS (i686-pc-toaru-gcc was not found in your path).\033[0m"
echo -e "\033[1mI can retreive a pre-built copy of the toolchain for Linux (32-bit, approx. 300MB)\033[0m"
echo -en "\033[1;32mWould you like me to do that?\033[0m (Y/n) "
read PROMPT
if [[ "$PROMPT" = "y" ]] ; then
echo "The toolchain will be pulled from Dropbox: http://dl.dropbox.com/u/44305966/toaru-toolchain-0.0.1.tar.gz"
pushd /tmp
wget "http://dl.dropbox.com/u/44305966/toaru-toolchain-0.0.1.tar.gz"
popd
tar -x -C util/ -f "/tmp/toaru-toolchain-0.0.1.tar.gz"
rm "/tmp/toaru-toolchain-0.0.1.tar.gz"
echo "Done!"
echo "You should now add \033[1;33m`pwd`/util/toaru-toolchain/bin\033[0m to your path"
else
echo "I will not retreive the toolchain. Bailing..."
exit 1
fi