This commit is contained in:
mintsuki 2022-08-23 05:30:19 +02:00
parent 74ebc70c0a
commit 579d163b6d

View file

@ -4,10 +4,10 @@ override KERNEL := kernel.elf
# Convenience macro to reliably declare overridable command variables. # Convenience macro to reliably declare overridable command variables.
define DEFAULT_VAR = define DEFAULT_VAR =
ifeq ($(origin $1), default) ifeq ($(origin $1),default)
override $(1) := $(2) override $(1) := $(2)
endif endif
ifeq ($(origin $1), undefined) ifeq ($(origin $1),undefined)
override $(1) := $(2) override $(1) := $(2)
endif endif
endef endef
@ -64,9 +64,9 @@ 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 directory and extract the object names.
override CFILES := $(shell find ./ -type f -name '*.c') override CFILES := $(shell find . -type f -name '*.c')
override ASFILES := $(shell find ./ -type f -name '*.S') override ASFILES := $(shell find . -type f -name '*.S')
override NASMFILES := $(shell find ./ -type f -name '*.asm') override NASMFILES := $(shell find . -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)