summaryrefslogtreecommitdiff
path: root/kernel/build.sh
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/build.sh')
-rwxr-xr-xkernel/build.sh10
1 files changed, 7 insertions, 3 deletions
diff --git a/kernel/build.sh b/kernel/build.sh
index 4a8130b..8fa91ce 100755
--- a/kernel/build.sh
+++ b/kernel/build.sh
@@ -1,14 +1,18 @@
#!/usr/bin/sh
ASM_PATH="src/"
-TARGET_PATH="target/"
+TARGET_PATH="target"
TMP_PATH="$TARGET_PATH/temp/"
OBJ_PATH="$TMP_PATH"
LINK_SCRIPT_PATH="src/"
GRUB_CFG_PATH="src/grub.cfg"
+ARCH="x86_64"
+TARGET="$ARCH-uff"
+RUST_BIN="$TARGET_PATH/$TARGET/debug/libkernel.a"
remove_target() {
- rm -rf $TARGET_PATH &> /dev/null
+ rm -rf $TMP_PATH/* &> /dev/null
+ rm -f $TARGET_PATH/uff.iso &> /dev/null
}
create_target() {
@@ -27,7 +31,7 @@ build_kernel_elf() {
for f in $ASM_PATH/*.asm; do
nasm -felf64 "$f" -o $OBJ_PATH/"$(basename -s .asm $f)".o
done
- ld -n -o $TARGET_PATH/kernel.bin -T $LINK_SCRIPT_PATH/linker.ld $OBJ_PATH/*.o
+ ld -n -o $TARGET_PATH/kernel.bin -gc-sections -T $LINK_SCRIPT_PATH/linker.ld $OBJ_PATH/*.o $RUST_BIN
cleanup_temp
}