This commit is contained in:
rami 2024-05-21 21:13:07 -05:00
parent dacdc0ae8d
commit fc1bde4e60
13 changed files with 2 additions and 7 deletions

View File

@ -1,5 +1,5 @@
CC = i686-elf-gcc
INCLUDE = -I./
INCLUDE = -I./include -I./lib
CFLAGS = -Wall -Wextra -Werror -ffreestanding $(INCLUDE)
LDFLAGS = -T kernel.ld -ffreestanding -O3 -nostdlib -lgcc
@ -11,11 +11,6 @@ KERNELOBJ := $(addprefix $(BUILDDIR)/, \
$(patsubst %.c,%.o,\
$(patsubst %.asm,%.o,$(KERNELSRC)))))
LIBSRC := $(shell find ./lib -name '*.c')
LIBOBJ := $(addprefix $(BUILDDIR)/, \
$(notdir \
$(patsubst %.c,%.o,$(LIBSRC))))
KERNELIMG := $(BUILDDIR)/kernel.bin
QEMUFLAGS = -d int -s \
@ -31,7 +26,7 @@ qemu: kernel
kernel: $(KERNELIMG)
$(KERNELIMG): $(KERNELOBJ) $(LIBOBJ)
$(KERNELIMG): $(KERNELOBJ)
$(CC) $^ -o $@ $(LDFLAGS)
$(BUILDDIR)/%.o: %.c
$(CC) $(CFLAGS) -c $^ -o $@

View File