This commit is contained in:
mintsuki 2023-03-18 20:44:40 +01:00
parent 6682ab1f29
commit c4d94bbc75
3 changed files with 14 additions and 12 deletions

8
.gitignore vendored
View file

@ -1,8 +1,4 @@
limine /limine
ovmf-x64 /ovmf-x64
kernel/limine.h
*.elf
*.iso *.iso
*.hdd *.hdd
*.o
*.d

4
kernel/.gitignore vendored Normal file
View file

@ -0,0 +1,4 @@
/limine.h
*.elf
*.o
*.d

View file

@ -23,10 +23,10 @@ $(eval $(call DEFAULT_VAR,CC,cc))
# Same thing for "ld" (the linker). # Same thing for "ld" (the linker).
$(eval $(call DEFAULT_VAR,LD,ld)) $(eval $(call DEFAULT_VAR,LD,ld))
# User controllable CFLAGS. # User controllable C flags.
$(eval $(call DEFAULT_VAR,CFLAGS,-g -O2 -pipe -Wall -Wextra)) $(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,)) $(eval $(call DEFAULT_VAR,CPPFLAGS,))
# User controllable nasm flags. # User controllable nasm flags.
@ -54,6 +54,7 @@ override CFLAGS += \
-mno-red-zone \ -mno-red-zone \
-mcmodel=kernel -mcmodel=kernel
# Internal C preprocessor flags that should not be changed by the user.
override CPPFLAGS := \ override CPPFLAGS := \
-I. \ -I. \
$(CPPFLAGS) \ $(CPPFLAGS) \
@ -76,10 +77,11 @@ endif
override NASMFLAGS += \ override NASMFLAGS += \
-f elf64 -f elf64
# Use find to glob all *.c, *.S, and *.asm files in the directory and extract the object names. # Use "find" to glob all *.c, *.S, and *.asm files in the tree and obtain the
override CFILES := $(shell find . -type f -name '*.c') # object and header dependency file names.
override ASFILES := $(shell find . -type f -name '*.S') override CFILES := $(shell find -L . -type f -name '*.c')
override NASMFILES := $(shell find . -type f -name '*.asm') 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 OBJ := $(CFILES:.c=.o) $(ASFILES:.S=.o) $(NASMFILES:.asm=.o)
override HEADER_DEPS := $(CFILES:.c=.d) $(ASFILES:.S=.d) override HEADER_DEPS := $(CFILES:.c=.d) $(ASFILES:.S=.d)