From cbcbf6e7d614ecf94dd7e1b9033f8d599f48662e Mon Sep 17 00:00:00 2001 From: Alexey Gavrilov Date: Thu, 22 Feb 2024 14:18:39 +0700 Subject: Implement support of cpuid instruction + include folder + some updates --- makefile | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'makefile') diff --git a/makefile b/makefile index ab744ff..c9e0857 100644 --- a/makefile +++ b/makefile @@ -2,9 +2,9 @@ CC = i686-elf-g++ LD = ld ASM = nasm # test -O2 flag -CFLAGS = -c -m32 -Wall -ffreestanding -nostdinc -nostdlib -lgcc +CFLAGS = -c -m32 -Wall -ffreestanding -nostdinc -nostdlib AFLAGS = -f elf32 -LDFLAGS = -m elf_i386 +LDFLAGS = -m elf_i386 -L$(GCC_PATH) -lgcc QEMUFLAGS = CFILES = $(shell find ./ -type f \( -name \*.cpp -o -name \*.c \)) @@ -12,6 +12,7 @@ AFILES = $(shell find ./ -type f \( -iname \*.s -o -name \*.asm \)) LDFILE = $(shell find ./ -type f -name *.ld) SOURCE_FILES = $(CFILES) $(AFILES) OBJ_FILES = $(addprefix $(BDIR)/, $(addsuffix .o, $(basename $(SOURCE_FILES)))) +INCLUDE = ./include ifeq ($(DEBUG), true) CFLAGS := -g3 $(CFLAGS) @@ -28,12 +29,12 @@ build: startbuild $(SOURCE_FILES) echo $(AFLAGS) echo $(CFLAGS) @echo "Link object files..." - $(LD) $(LDFLAGS) -o $(OS_BINARY) -T $(LDFILE) $(OBJ_FILES) + $(LD) -o $(OS_BINARY) -T $(LDFILE) $(OBJ_FILES) $(LDFLAGS) @echo "Project was built" $(CFILES): mkdir -p $(BDIR)/$(@D) - $(CC) $(CFLAGS) -o $(BDIR)/$(addsuffix .o, $(basename $@)) $@ + $(CC) $(CFLAGS) -I $(INCLUDE) -o $(BDIR)/$(addsuffix .o, $(basename $@)) $@ $(AFILES): mkdir -p $(BDIR)/$(@D) @@ -54,6 +55,6 @@ clean: rm -rf ./iso/os/kernel.bin run: - qemu-system-i386 $(QEMUFLAGS) -cdrom ./$(BDIR)/kernel.iso + qemu-system-x86_64 $(QEMUFLAGS) -cdrom ./$(BDIR)/kernel.iso all: clean build install run -- cgit v1.2.3