diff options
Diffstat (limited to 'kc/core/Makefile')
| -rw-r--r-- | kc/core/Makefile | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/kc/core/Makefile b/kc/core/Makefile new file mode 100644 index 0000000..2893b42 --- /dev/null +++ b/kc/core/Makefile @@ -0,0 +1,39 @@ +include ../../defaults.mk + +VPATH := ../../lib ../ + +TARGET := kernel.os +.DEFAULT: $(TARGET) + +CPPFLAGS += -I../../api +CFLAGS += -Wno-unused-const-variable -Wno-unused-function -fvisibility=hidden -g + +LIBDIRS += -L$(dir $(shell $(CC) -print-libgcc-file-name)) +LDSCRIPT := ../component.ld +LDFLAGS += -z max-page-size=4096 --export-dynamic -pic --no-dynamic-linker +LOADLIBES := -lgcc + +SOBJS := +GOBJS := entry_x86_64.o reloc_x86_64.o kprint.o serial.o port.o \ + kc_main.o memory.o memset.o memcpy.o memmove.o memcmp.o cpu.o \ + exceptions.o panic.o +IOBJS := + +# __attribute__((interrupt)) requires -mgeneral-regs-only +$(IOBJS): CFLAGS += -mgeneral-regs-only +$(IOBJS) $(GOBJS): CFLAGS += -mcmodel=small -fPIC + +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) + |
