diff options
| author | Kimplul <kimi.h.kuparinen@gmail.com> | 2022-05-05 23:04:21 +0000 |
|---|---|---|
| committer | Kimplul <kimi.h.kuparinen@gmail.com> | 2022-05-05 23:04:21 +0000 |
| commit | 346c0c9f4916bfe42108f79478bfddadc0f14cae (patch) | |
| tree | d9270d320cfcff2b3ef59c461dd7800058bb1458 | |
| parent | a3c239e78ac9e2f6238287c89222671b23624b7f (diff) | |
| download | kmi-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-- | .gitignore | 2 | ||||
| -rw-r--r-- | Makefile | 10 | ||||
| -rwxr-xr-x | scripts/gen-deps | 1 |
3 files changed, 6 insertions, 7 deletions
@@ -4,6 +4,6 @@ *.elf *.ld include/apos/gen/* -include/arch/*/gen/* +arch/*/include/gen/* deps.mk *.img @@ -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') |
