-
Notifications
You must be signed in to change notification settings - Fork 22
/
Rules.mk
33 lines (28 loc) · 1.01 KB
/
Rules.mk
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
include $(TOPDIR)/Version.mk
.DEFAULT_GOAL := all
.PHONE: all clean install
SUFFIXES += .efi .efi.signed
%.so: %.o
$(LD) $(LDFLAGS) -o $@ --start-group $^ \
$(LIB_GCC) -lgnuefi -lefi --end-group
@echo '--------------- List unresolved symbols ---------------'
@! $(NM) $@ | grep -iw u
@echo '-------------------------------------------------------'
%.efi: %.so
@$(OBJCOPY) -j .text -j .sdata -j .data \
-j .dynamic -j .dynsym -j .rel* \
-j .rela* -j .reloc -j .eh_frame \
-j .debug_info -j .debug_abbrev -j .debug_aranges \
-j .debug_line -j .debug_str -j .debug_ranges \
-j .note.gnu.build-id \
@$(OBJCOPY) -j .text -j .sdata -j .data -j .data.ident \
-j .dynamic -j .dynsym -j .rel* \
-j .rela* -j .reloc -j .eh_frame \
--target efi-app-$(ARCH) $^ $@
%.efi.signed: %.efi $(SIGNING_CERT) $(SIGNING_KEY)
$(SBSIGN) --cert $(SIGNING_CERT) \
--key $(SIGNING_KEY) $< 2>/dev/null || { \
echo "Failed to sign $<"; \
exit 1; \
}