From d6f70b77023f9682bf2c65428068a6897dd16ce3 Mon Sep 17 00:00:00 2001 From: Ralph Ronnquist Date: Sat, 23 Jul 2022 08:41:19 +1000 Subject: [PATCH] added compilation variant --- gnuefi.mk | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 gnuefi.mk diff --git a/gnuefi.mk b/gnuefi.mk new file mode 100644 index 0000000..db4e2ae --- /dev/null +++ b/gnuefi.mk @@ -0,0 +1,33 @@ +## Makefile to build for efi using gnu-efi + +TYPING = ItemKeyFun.c integeritem.c stringitem.c +VECTOR = Vector.c HashVector.c +EFIMM = Heap.c +INCDIR = -Ityping -Ivector -Iefimm + + +OBJS = $(addprefix typing/,${TYPING:.c=.o}) +OBJS += $(addprefix vector/,${VECTOR:.c=.o}) +OBJS += $(addprefix efimm/,${EFIMM:.c=.o}) + +$(info ${OBJS}) + +default: librrqmisc.a + +GNUEFI = /home/ralph/src/gnu-efi +INCDIR += -I${GNUEFI}/inc -I${GNUEFI}/inc/protocol -I${GNUEFI}/inc/x86_64 +CFLAGS += -Wno-error=pragmas -mno-red-zone -mno-avx -fpic -g -O2 -Wall -Wextra -Werror +CFLAGS += -fshort-wchar -fno-strict-aliasing -ffreestanding -fno-stack-protector -fno-stack-check +CFLAGS += -fno-stack-check -fno-merge-all-constants +CFLAGS += -fmax-errors=1 +CPPFLAGS += -DCONFIG_x86_64 -DGNU_EFI_USE_MS_ABI +CPPFLAGS += -maccumulate-outgoing-args --std=c11 +CPPFLAGS += -D__KERNEL__ -I/usr/src/sys/build/include + +%.o: %.c + $(CC) $(INCDIR) $(CFLAGS) $(CPPFLAGS) -c $< -o $@ + +librrqmisc.a: $(patsubst %,librrqmisc.a(%),${OBJS}) + +clean: + rm -f none {efimm,typing,vector}/*.o -- 2.39.2