aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKimplul <kimi.h.kuparinen@gmail.com>2022-05-05 23:04:21 +0000
committerKimplul <kimi.h.kuparinen@gmail.com>2022-05-05 23:04:21 +0000
commit346c0c9f4916bfe42108f79478bfddadc0f14cae (patch)
treed9270d320cfcff2b3ef59c461dd7800058bb1458
parenta3c239e78ac9e2f6238287c89222671b23624b7f (diff)
downloadkmi-346c0c9f4916bfe42108f79478bfddadc0f14cae.tar.gz
kmi-346c0c9f4916bfe42108f79478bfddadc0f14cae.zip
apos compiles on netbsd with LLVM=1
+ Turns out I had a dumb debugging echo that was messing up my variables. Oh well. + I'd still like to get riscv64-unknown-elf-gcc to compile, currently I've only managed with riscv64--netbsd-gcc, weird. Also, I have learned that BSD make doesn't use $< for some reason, so all rules should reference the full file name henceforth. BSD make does use $@, but for consistency I did away with it as well.
-rw-r--r--.gitignore2
-rw-r--r--Makefile10
-rwxr-xr-xscripts/gen-deps1
3 files changed, 6 insertions, 7 deletions
diff --git a/.gitignore b/.gitignore
index 7c1c102..62e021c 100644
--- a/.gitignore
+++ b/.gitignore
@@ -4,6 +4,6 @@
*.elf
*.ld
include/apos/gen/*
-include/arch/*/gen/*
+arch/*/include/gen/*
deps.mk
*.img
diff --git a/Makefile b/Makefile
index 7d7e04d..5f3eb47 100644
--- a/Makefile
+++ b/Makefile
@@ -58,7 +58,7 @@ GENELF = $(COMPILER) $(DEBUGFLAGS)\
GENLINK = $(COMPILER) $(COMPILE_FLAGS) $(PREPROCESS) $(DEPFLAGS) $(INCLUDE_FLAGS)
STRIPLINK = sed -n '/^[^\#]/p'
-KERN_SIZE = wc -c kernel.bin | cut -d ' ' -f 1
+KERN_SIZE = wc -c kernel.bin | awk '{print $$1}'
KERN_INFO = sed "s/<KERNEL_SIZE>/$$($(KERN_SIZE))/"
KERNEL_LINK := arch/$(ARCH)/conf/kernel-link
@@ -79,16 +79,16 @@ $(INIT_LD): kernel.bin
lint: $(INIT_OBJECTS:.o=.o.l) $(KERNEL_OBJECTS:.o=.o.l)
init.elf: $(INIT_OBJECTS) $(INIT_LD)
- $(GENELF) -T $(INIT_LD) $(INIT_OBJECTS) -o $@ $(LINK_FLAGS)
+ $(GENELF) -T $(INIT_LD) $(INIT_OBJECTS) -o init.elf $(LINK_FLAGS)
kernel.elf: $(KERNEL_OBJECTS) $(KERNEL_LD)
- $(GENELF) -T $(KERNEL_LD) $(KERNEL_OBJECTS) -o $@ $(LINK_FLAGS)
+ $(GENELF) -T $(KERNEL_LD) $(KERNEL_OBJECTS) -o kernel.elf $(LINK_FLAGS)
init.bin: init.elf
- $(OBJCOPY) $(OBJCOPY_FLAGS) $< $@
+ $(OBJCOPY) $(OBJCOPY_FLAGS) init.elf init.bin
kernel.bin: kernel.elf
- $(OBJCOPY) $(OBJCOPY_FLAGS) $< $@
+ $(OBJCOPY) $(OBJCOPY_FLAGS) kernel.elf kernel.bin
apos.bin: init.bin kernel.bin
cat init.bin kernel.bin > apos.bin
diff --git a/scripts/gen-deps b/scripts/gen-deps
index 0dab1ea..674ead6 100755
--- a/scripts/gen-deps
+++ b/scripts/gen-deps
@@ -47,7 +47,6 @@ case "${2}" in
func=genlink
esac
-echo "${3}"
# create all subdirectories
mkdir -p $(echo "${3}" | xargs -n 1 dirname | uniq | sed 's|^|build/|g')