aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorKimplul <kimi.h.kuparinen@gmail.com>2021-12-20 13:29:01 +0200
committerKimplul <kimi.h.kuparinen@gmail.com>2021-12-20 13:29:01 +0200
commit6b2465318b2dc922de282deea96c1621f7f41039 (patch)
treeee12863bb4aab536810bbe13638bf21317b37658 /Makefile
parenta37974009152b4bf6a2d7ed205a48230f939dd72 (diff)
downloadkmi-6b2465318b2dc922de282deea96c1621f7f41039.tar.gz
kmi-6b2465318b2dc922de282deea96c1621f7f41039.zip
Revert "still some issues with vmem"
This reverts commit 69d13626a37e33f31627a1144605a8fb93684d25.
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile27
1 files changed, 12 insertions, 15 deletions
diff --git a/Makefile b/Makefile
index 2a388e8..80fe0e5 100644
--- a/Makefile
+++ b/Makefile
@@ -20,11 +20,10 @@ OBJCOPY ?= objcopy
# This makes sure .bss is loaded into the binary
OBJCOPY_FLAGS ?= -Obinary --set-section-flags .bss=alloc,load,contents
-COMMON_SOURCES != echo common/*.c lib/fdt*.c
-KERNEL_SOURCES != echo kernel/*.c $(COMMON_SOURCES)
-INIT_SOURCES := $(COMMON_SOURCES)
+KERNEL_SOURCES != echo common/*.c lib/*.c
CLEANUP := build deps.mk kernel.* init.* apos.bin
CLEANUP_CMD :=
+INIT_SOURCES :=
include arch/$(ARCH)/source.mk
@@ -45,29 +44,27 @@ KERN_INFO = sed "s/<KERNEL_SIZE>/$$($(KERN_SIZE))/"
KERNEL_LINK := arch/$(ARCH)/conf/kernel-link
INIT_LINK := arch/$(ARCH)/conf/init-link
-KERNEL_OBJECTS != ./scripts/gen-deps --kern "$(KERNEL_SOURCES)"
-INIT_OBJECTS != ./scripts/gen-deps --init "$(INIT_SOURCES)"
-KERNEL_LD != ./scripts/gen-deps --kern-link "$(KERNEL_LINK).S"
-INIT_LD != ./scripts/gen-deps --init-link "$(INIT_LINK).S"
+KERNEL_OBJECTS != ./scripts/gen-deps --compile "$(KERNEL_SOURCES)"
+INIT_OBJECTS != ./scripts/gen-deps --compile "$(INIT_SOURCES)"
+KERNEL_LD != ./scripts/gen-deps --link "$(KERNEL_LINK).S"
+INIT_LD != ./scripts/gen-deps --link "$(INIT_LINK).S"
include deps.mk
-apos.bin: kernel.bin init.bin
- cat init.bin kernel.bin > $@
+init.elf: $(INIT_OBJECTS) $(INIT_LD)
+ $(GENELF) -T $(INIT_LD) $(INIT_OBJECTS) -o $@
kernel.elf: $(KERNEL_OBJECTS) $(KERNEL_LD)
$(GENELF) -T $(KERNEL_LD) $(KERNEL_OBJECTS) -o $@
-$(INIT_LD): kernel.bin
-
-init.elf: $(INIT_OBJECTS) $(INIT_LD)
- $(GENELF) -T $(INIT_LD) $(INIT_OBJECTS) -o $@
+init.bin: init.elf
+ $(CROSS_COMPILE)$(OBJCOPY) $(OBJCOPY_FLAGS) $< $@
kernel.bin: kernel.elf
$(CROSS_COMPILE)$(OBJCOPY) $(OBJCOPY_FLAGS) $< $@
-init.bin: init.elf
- $(CROSS_COMPILE)$(OBJCOPY) $(OBJCOPY_FLAGS) $< $@
+apos.bin: init.bin kernel.bin
+ cat init.bin kernel.bin > apos.bin
clean:
$(RM) -r $(CLEANUP)