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.
This commit is contained in:
g1n 2022-02-10 21:49:58 +02:00
parent d083a9ef7c
commit 79ed6ccff2
Signed by: g1n
GPG Key ID: 8D352193D65D4E2C
1 changed files with 7 additions and 8 deletions

View File

@ -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