summaryrefslogtreecommitdiff
path: root/sys-boot/udk/files
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2019-05-04 12:02:00 +0100
committerV3n3RiX <venerix@redcorelinux.org>2019-05-04 12:02:00 +0100
commiteab5731cdf11d4ae8cdf111461d46fd96c5bdd37 (patch)
treece35c6d01b5ff5de95c3a20fef853b9a6518ad2e /sys-boot/udk/files
parentb7ebc951da8800f711142f69d9d958bde67a112d (diff)
gentoo resync : 04.05.2019
Diffstat (limited to 'sys-boot/udk/files')
-rw-r--r--sys-boot/udk/files/2018-makefile.template41
1 files changed, 41 insertions, 0 deletions
diff --git a/sys-boot/udk/files/2018-makefile.template b/sys-boot/udk/files/2018-makefile.template
new file mode 100644
index 000000000000..049a94facd81
--- /dev/null
+++ b/sys-boot/udk/files/2018-makefile.template
@@ -0,0 +1,41 @@
+TOP := $(abspath $(dir $(lastword $(MAKEFILE_LIST))))
+BASE_NAME = «MODULE»
+EXEC = «MODULE».efi
+SRC = $(shell find $(TOP) -type f -name '*.c')
+OBJ = $(SRC:.c=.o)
+INC_DIR = /usr/include/«PACKAGE_NAME»
+LIB_DIR = «LIB_DIR»
+DEST_DIR_DEBUG = .
+«STATIC_LIBS»
+
+EFI_LDS = «EFI_LDS»
+«MODULE_TYPE»
+«VARIABLES»
+
+comma:= ,
+empty:=
+space:= $(empty) $(empty)
+
+all: $(EXEC)
+
+%.efi: $(OBJ)
+ $(DLINK) -o $(@:.efi=.dll) $(DLINK_FLAGS) \
+ -Wl,--script,$(EFI_LDS) -Wl,--defsym=PECOFF_HEADER_SIZE=«PECOFF_HEADER_SIZE» \
+ -Wl,$(subst $(space),$(comma),--start-group $(STATIC_LIBRARY_FILES)$^ --end-group)
+ $(OBJCOPY) $(OBJCOPY_FLAGS) $(@:.efi=.dll)
+ $(CP) $(@:.efi=.dll) $(@:.efi=.debug)
+ $(OBJCOPY) --strip-unneeded -R .eh_frame $(@:.efi=.dll)
+ $(OBJCOPY) --add-gnu-debuglink=$(@:.efi=.debug) $(@:.efi=.dll)
+ $(GENFW) -e $(MODULE_TYPE) -o $@ $(@:.efi=.dll) $(GENFW_FLAGS)
+ $(RM) $(@:.efi=.dll)
+
+%.o: %.c
+ $(CC) $(CC_FLAGS) -I$(INC_DIR) -iquote$(TOP) -c -o $@ $^
+
+clean:
+ $(RM) *.o
+
+mrproper: clean
+ $(RM) $(EXEC) $(EXEC:.efi=.debug)
+
+.PHONY: all clean mrproper