summaryrefslogtreecommitdiff
path: root/shim/Makefile
diff options
context:
space:
mode:
authorAda Christine <adachristine18@gmail.com>2021-12-16 12:06:04 +0000
committerAda Christine <adachristine18@gmail.com>2021-12-16 12:06:04 +0000
commitec1233b4fcd61a8d1eccbf030cede36e9848e06c (patch)
tree13ffdc3b3948275e8c764ccf10368d555ff4d5e1 /shim/Makefile
parenta7f79219706c357c6c15978cea5e654042b14acb (diff)
reworking loader
Diffstat (limited to 'shim/Makefile')
-rw-r--r--shim/Makefile36
1 files changed, 36 insertions, 0 deletions
diff --git a/shim/Makefile b/shim/Makefile
new file mode 100644
index 0000000..51ec96c
--- /dev/null
+++ b/shim/Makefile
@@ -0,0 +1,36 @@
+include ../defaults.mk
+
+VPATH := ../lib
+
+TARGET := efi.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 -fshort-wchar -mgeneral-regs-only
+
+LIBDIRS += -L$(dir $(shell $(CC) -print-libgcc-file-name))
+LDSCRIPT := shim.ld
+LDFLAGS += -z max-page-size=4096 --export-dynamic
+LOADLIBES := -lgcc
+
+OBJS := entry.o memcmp.o memcpy.o memmove.o memset.o
+$(OBJS): CFLAGS += -fPIC -fPIE
+
+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)
+