diff options
author | aqua <aqua@iserlohn-fortress.net> | 2023-02-05 10:16:20 +0200 |
---|---|---|
committer | aqua <aqua@iserlohn-fortress.net> | 2023-02-05 10:16:20 +0200 |
commit | a5de90c48a1800c865285945aadd019fa07c7ad8 (patch) | |
tree | a2e476f4950aa142019617779f8e0bce4a01305c /Makefile.all | |
parent | blake2: use makefiles instead of meson.build (diff) | |
download | kernel-a5de90c48a1800c865285945aadd019fa07c7ad8.tar.xz |
Split Makefile
- Makefile: configure, doc and test targets
- Makefile.all: info, build and run targets
- rules.mk: add base test targets
Diffstat (limited to 'Makefile.all')
-rw-r--r-- | Makefile.all | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/Makefile.all b/Makefile.all new file mode 100644 index 0000000..efd7386 --- /dev/null +++ b/Makefile.all @@ -0,0 +1,59 @@ +# ===================================================================== +# spdx-license-identifier: ISC +# glitch kernel binary and image generation +# ===================================================================== + +include Makefile.config + +LDFLAGS += -T ${ARCH}/linker.ld + +all: glitch.elf + @echo "built $^" + +.PHONY: run info +run: glitch.iso + @${QEMU} -cdrom $^ -d cpu_reset -display gtk,zoom-to-fit=on + +info: + @echo "- target:" + @echo " ARCH: ${ARCH}" + @echo " CC: ${CC}" + @echo " CCID: ${CCID}" + @echo " CFLAGS: ${CFLAGS}" + @echo " CXX: ${CXX}" + @echo " CXXID: ${CXXID}" + @echo " CXXFLAGS: ${CXXFLAGS}" + @echo " LD: ${LD}" + @echo " LDID: ${LDID}" + @echo " LDFLAGS: ${LDFLAGS}" + @echo "- test:" + @echo " CXX: ${TEST_CXX}" + @echo " CXXFLAGS: ${TEST_CXXFLAGS}" + @echo " QEMU: ${QEMU}" + +# build targets +glitch.elf: ${ARCH}/arch.a src/kernel.a devices/devs.a lib/libk.a + +glitch.iso: glitch.elf grub/grub.cfg + @grub-file --is-x86-multiboot2 glitch.elf + @mkdir -p isodir/boot/grub + @mkdir -p isodir/boot/glitch + @grub-script-check grub/grub.cfg + @cp grub/grub.cfg isodir/boot/grub/grub.cfg + @cp glitch.elf isodir/boot/glitch/glitch.elf + @i686-elf-strip isodir/boot/glitch/glitch.elf + @rm -f isodir/boot/glitch/checksums + @sha512sum isodir/boot/glitch/* > isodir/boot/glitch/checksums + @sed -i s/isodir// isodir/boot/glitch/checksums + @grub-mkrescue -o glitch.iso isodir + +lib/libk.a: FORCE + @${MAKE} -C lib libk.a +i686/arch.a: FORCE + @${MAKE} -C ${ARCH} arch.a +devices/devs.a: FORCE + @${MAKE} -C devices devs.a +src/kernel.a: FORCE + @${MAKE} -C src kernel.a + +include rules.mk |