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:
parent
d083a9ef7c
commit
79ed6ccff2
15
src/Makefile
15
src/Makefile
|
@ -34,17 +34,16 @@ DIRS = $(BUILDDIR)/arch/$(ARCH) $(BUILDDIR)/libk
|
||||||
KERNELFILE = $(BUILDDIR)/orion.bin
|
KERNELFILE = $(BUILDDIR)/orion.bin
|
||||||
ISOFILE = $(BUILDDIR)/orion.iso
|
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):
|
$(DIRS):
|
||||||
mkdir -p build/arch/$(ARCH)
|
mkdir -p $(BUILDDIR)/arch/$(ARCH)
|
||||||
mkdir -p build/libk
|
mkdir -p $(BUILDDIR)/libk
|
||||||
|
|
||||||
build: $(ASMOBJS) $(COBJS) $(LIBKOBJS)
|
$(KERNELFILE):
|
||||||
|
|
||||||
link:
|
|
||||||
$(CC) -T linker.ld -o $(KERNELFILE) $(CFLAGS) -nostdlib $(OBJFILES) -lgcc
|
$(CC) -T linker.ld -o $(KERNELFILE) $(CFLAGS) -nostdlib $(OBJFILES) -lgcc
|
||||||
|
|
||||||
$(BUILDDIR)/%.o: %.asm
|
$(BUILDDIR)/%.o: %.asm
|
||||||
|
|
Loading…
Reference in New Issue