MAKE = make MAKEFLAGS += --no-print-directory -include Makefile.config info: @echo "* Build information *" @echo " ARCH ${ARCH}" @echo " MAKE $(shell ${MAKE} --version | head -n1)" @echo " CC $(shell ${CC} --version | head -n1)" @echo " ${CCFLAGS}" @echo " LD $(shell ${LD} --version | head -n1)" @echo " ${LDFLAGS}" .config: Kconfig @alldefconfig Makefile.config: .config @cp .config Makefile.config @echo -e '\n# toolchain.mk' >> Makefile.config @cat $$(sed -nE "s/CONFIG_ARCH_(.+)=y/\1/p" .config)/toolchain.mk >> Makefile.config .PHONY: all run clean purge all: @${MAKE} ARCH=${ARCH} -C lib all @${MAKE} ARCH=${ARCH} -C ${ARCH} all @${MAKE} ARCH=${ARCH} -C devices all @${MAKE} ARCH=${ARCH} -C src all run: glitch.iso qemu-system-i386 -cdrom glitch.iso -accel kvm clean: @${MAKE} ARCH=${ARCH} -C lib clean @${MAKE} ARCH=${ARCH} -C ${ARCH} clean @${MAKE} ARCH=${ARCH} -C devices clean @${MAKE} ARCH=${ARCH} -C src clean purge: clean rm -f lib/libk.a ${ARCH}/arch.a devices/devs.a src/kernel.a rm -rf glitch.elf glitch.iso isodir lib/libk.a: ${MAKE} ARCH=${ARCH} -C lib libk.a i686/arch.a: ${MAKE} ARCH=${ARCH} -C i686 arch.a devices/devs.a: ${MAKE} ARCH=${ARCH} -C devices devs.a src/kernel.a: ${MAKE} ARCH=${ARCH} -C src kernel.a glitch.elf: ${ARCH}/arch.a src/kernel.a devices/devs.a lib/libk.a @echo ' LD $@' @${LD} ${LDFLAGS} -T ${ARCH}/linker.ld -o $@ $^ 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 @grub-mkrescue -o glitch.iso isodir