From e88462459cd1f3fb51cedefdce0fc30b79d15f5e Mon Sep 17 00:00:00 2001 From: Amelia Coutard Date: Mon, 27 Feb 2023 01:39:56 +0100 Subject: [PATCH] Edited Makefile a bit to make it cleaner --- Makefile | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index 4501196..12e0e94 100644 --- a/Makefile +++ b/Makefile @@ -16,8 +16,8 @@ CXXFLAGS := $(CXXFLAGS) -Wall -Wextra -Werror -std=c++20 \ LDFLAGS ?= -O2 LDFLAGS := $(LDFLAGS) -Wall -Wextra -Werror -std=c++20 -ffreestanding -TO_ISO := -TO_CLEAN := +TO_ISO := isodir/boot/grub/grub.cfg +TO_CLEAN := isodir amycros.iso include **/module.mk @@ -25,9 +25,11 @@ build: amycros.iso qemu: build qemu-system-x86_64 -cdrom amycros.iso -serial stdio -cpu qemu64,pdpe1gb -no-reboot $(QEMUFLAGS) clean: - -rm -rf $(TO_CLEAN) isodir amycros.iso + -rm -rf $(TO_CLEAN) -amycros.iso: $(TO_ISO) grub.cfg - mkdir -p isodir/boot/grub - install -m 644 grub.cfg isodir/boot/grub/grub.cfg +amycros.iso: $(TO_ISO) grub-mkrescue -o "$@" isodir + +isodir/boot/grub/grub.cfg: grub.cfg + mkdir -p "$(@D)" + install -m 644 "$<" "$@" -- 2.47.0