From c4d94bbc755f1443075ee8505cbfc5b0eccbff62 Mon Sep 17 00:00:00 2001 From: mintsuki Date: Sat, 18 Mar 2023 20:44:40 +0100 Subject: [PATCH] Update --- .gitignore | 8 ++------ kernel/.gitignore | 4 ++++ kernel/GNUmakefile | 14 ++++++++------ 3 files changed, 14 insertions(+), 12 deletions(-) create mode 100644 kernel/.gitignore diff --git a/.gitignore b/.gitignore index ebec950..44547c3 100644 --- a/.gitignore +++ b/.gitignore @@ -1,8 +1,4 @@ -limine -ovmf-x64 -kernel/limine.h -*.elf +/limine +/ovmf-x64 *.iso *.hdd -*.o -*.d diff --git a/kernel/.gitignore b/kernel/.gitignore new file mode 100644 index 0000000..69552a9 --- /dev/null +++ b/kernel/.gitignore @@ -0,0 +1,4 @@ +/limine.h +*.elf +*.o +*.d diff --git a/kernel/GNUmakefile b/kernel/GNUmakefile index 615c09c..9eb1198 100644 --- a/kernel/GNUmakefile +++ b/kernel/GNUmakefile @@ -23,10 +23,10 @@ $(eval $(call DEFAULT_VAR,CC,cc)) # Same thing for "ld" (the linker). $(eval $(call DEFAULT_VAR,LD,ld)) -# User controllable CFLAGS. +# User controllable C flags. $(eval $(call DEFAULT_VAR,CFLAGS,-g -O2 -pipe -Wall -Wextra)) -# User controllable preprocessor flags. We set none by default. +# User controllable C preprocessor flags. We set none by default. $(eval $(call DEFAULT_VAR,CPPFLAGS,)) # User controllable nasm flags. @@ -54,6 +54,7 @@ override CFLAGS += \ -mno-red-zone \ -mcmodel=kernel +# Internal C preprocessor flags that should not be changed by the user. override CPPFLAGS := \ -I. \ $(CPPFLAGS) \ @@ -76,10 +77,11 @@ endif override NASMFLAGS += \ -f elf64 -# Use find to glob all *.c, *.S, and *.asm files in the directory and extract the object names. -override CFILES := $(shell find . -type f -name '*.c') -override ASFILES := $(shell find . -type f -name '*.S') -override NASMFILES := $(shell find . -type f -name '*.asm') +# Use "find" to glob all *.c, *.S, and *.asm files in the tree and obtain the +# object and header dependency file names. +override CFILES := $(shell find -L . -type f -name '*.c') +override ASFILES := $(shell find -L . -type f -name '*.S') +override NASMFILES := $(shell find -L . -type f -name '*.asm') override OBJ := $(CFILES:.c=.o) $(ASFILES:.S=.o) $(NASMFILES:.asm=.o) override HEADER_DEPS := $(CFILES:.c=.d) $(ASFILES:.S=.d)