From 53ca88735db910c746d6190cca39fcd70d66b650 Mon Sep 17 00:00:00 2001 From: Ada Christine Date: Wed, 17 Mar 2021 12:38:27 +0000 Subject: initial commit --- kernel/Makefile | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 kernel/Makefile (limited to 'kernel/Makefile') diff --git a/kernel/Makefile b/kernel/Makefile new file mode 100644 index 0000000..36cca4c --- /dev/null +++ b/kernel/Makefile @@ -0,0 +1,40 @@ +include ../defaults.mk + +TARGET := kernel.os +.DEFAULT: $(TARGET) + +# EFI API for temporary things + +EFIAPIDIR := /usr/local/include/efi + +CPPFLAGS += -I../api -I$(EFIAPIDIR) -I$(EFIAPIDIR)/$(ARCH) -I$(EFIAPIDIR)/protocol +CFLAGS += -Wno-unused-const-variable -Wno-unused-function -fvisibility=hidden -g + +LIBDIRS += -L$(dir $(shell $(CC) -print-libgcc-file-name)) +LDSCRIPT := kernel.ld +LDFLAGS += -z max-page-size=4096 --export-dynamic +LOADLIBES := -lgcc + +SOBJS := +GOBJS := entry_efi.o +IOBJS := + +$(SOBJS): CFLAGS += -fPIC +# __attribute__((interrupt)) requires -mgeneral-regs-only +$(IOBJS): CFLAGS += -mgeneral-regs-only +$(IOBJS) $(GOBJS): CFLAGS += -mcmodel=kernel + +OBJS := $(SOBJS) $(GOBJS) $(IOBJS) +DEPS := $(patsubst %.o,%.d,$(OBJS)) + +$(TARGET): $(LDSCRIPT) $(MAKEFILE_LIST) +$(TARGET): $(OBJS) + +CLEANLIST := $(wildcard $(OBJS) $(TARGET)) +DCLEANLIST := $(wildcard $(DEPS)) + +include ../rules.mk +-include $(DEPS) + +.DEFAULT: $(TARGET) + -- cgit v1.3.1-1-g115d