From d42b629d983de336ddd3c22782caa2791ab78897 Mon Sep 17 00:00:00 2001 From: Robin Krahl Date: Sun, 5 Mar 2017 21:43:19 +0100 Subject: initial commit --- Makefile | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 Makefile (limited to 'Makefile') diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..a1586e1 --- /dev/null +++ b/Makefile @@ -0,0 +1,47 @@ +include config.mk + +.PHONY: all clean distclean emulate install + +all: $(kernel) + +clean: + @echo " (RM) iso" + $(QUIET)$(RM) -r iso + @echo " (RM) $(kernel_iso)" + $(QUIET)$(RM) $(kernel_iso) + @echo " (RM) $(objects)" + $(QUIET)$(RM) $(objects) + @echo " (RM) $(dependencies)" + $(QUIET)$(RM) $(dependencies) + +emulate: $(kernel_iso) + @echo " (QEMU) $^" + $(QUIET)$(QEMU) -cdrom $^ + +distclean: clean + @echo " (RM) $(kernel)" + $(QUIET)$(RM) $(kernel) + +install: $(kernel) + @echo " (CP) $^" + $(QUIET)$(CP) $< $(INSTALL_DIR) + +%.o: %.c + @echo " (CC) $@" + $(QUIET)$(CC) -c $(CPPFLAGS) $(CFLAGS) $< -o $@ + +%.o: %.s + @echo " (AS) $@" + $(QUIET)$(AS) $(ASFLAGS) $< -o $@ + +$(kernel): $(memmap) $(objects) + @echo " (LD) $@" + $(QUIET) $(LD) $(LDFLAGS) -T $< -o $@ $(objects) + +$(kernel_iso): $(kernel) misc/grub.cfg + mkdir -p iso/boot/grub + cp $^ iso/boot + cp misc/grub.cfg iso/boot/grub + grub-mkrescue --output=$@ iso + +-include $(dependencies) -- cgit v1.2.3