aboutsummaryrefslogtreecommitdiff
path: root/Makefile
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 /Makefile
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.
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile10
1 files changed, 5 insertions, 5 deletions
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