From 79ed6ccff23bc73c4123c7f1fdc706a2b437364b Mon Sep 17 00:00:00 2001 From: g1n Date: Thu, 10 Feb 2022 21:49:58 +0200 Subject: [PATCH] Optimized Makefile a bit more Now kernel binary is not recompiled on every run, 'make' checks if files are changed. Also deleted not needed sections of Makefile. --- src/Makefile | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/src/Makefile b/src/Makefile index 7fd1bcf..60cfeb6 100644 --- a/src/Makefile +++ b/src/Makefile @@ -34,17 +34,16 @@ DIRS = $(BUILDDIR)/arch/$(ARCH) $(BUILDDIR)/libk KERNELFILE = $(BUILDDIR)/orion.bin ISOFILE = $(BUILDDIR)/orion.iso -.PHONY: all makedirs build link run run-grub clean +.PHONY: all clean run run-grub +.SUFFIXES: .o .c .asm -all: makedirs build link +all: $(DIRS) $(ASMOBJS) $(COBJS) $(LIBKOBJS) $(KERNELFILE) -makedirs $(DIRS): - mkdir -p build/arch/$(ARCH) - mkdir -p build/libk +$(DIRS): + mkdir -p $(BUILDDIR)/arch/$(ARCH) + mkdir -p $(BUILDDIR)/libk -build: $(ASMOBJS) $(COBJS) $(LIBKOBJS) - -link: +$(KERNELFILE): $(CC) -T linker.ld -o $(KERNELFILE) $(CFLAGS) -nostdlib $(OBJFILES) -lgcc $(BUILDDIR)/%.o: %.asm