MAKE = make MAKEFLAGS += --no-print-directory include Makefile.config .PHONY: all run clean test FORCE all: glitch.elf run: glitch.iso @qemu-system-i386 -cdrom glitch.iso -accel kvm -d cpu_reset -display gtk,zoom-to-fit=on 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 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}" test: grep -r 'asm' devices lib src make -C lib test FORCE: .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 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 glitch.elf: ${ARCH}/arch.a src/kernel.a devices/devs.a lib/libk.a @echo ' LD $@' @${LD} ${LDFLAGS} -T ${ARCH}/linker.ld -o $@ $^ @echo -n ' B2b ' @b2sum $@ | cut -d ' ' -f1 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 @${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