3 ARCH=$(shell $(CC) -dumpmachine | sed "s/\(-\).*$$//")
4 LIBDIR=$(shell echo $$(cd /usr/lib/$$(gcc -print-multi-os-directory); pwd))
9 -I/usr/include/efi/$(ARCH)
12 -DVERSION=$(VERSION) \
24 -DEFI_FUNCTION_WRAPPER
27 LDFLAGS = -T $(LIBDIR)/gnuefi/elf_$(ARCH)_efi.lds \
33 $(LIBDIR)/gnuefi/crt0-efi-$(ARCH).o \
34 $(shell $(CC) -print-libgcc-file-name)
37 $(CC) $(CPPFLAGS) $(CFLAGS) -c $< -o $@
39 gummiboot.efi: gummiboot.so
40 objcopy -j .text -j .sdata -j .data -j .dynamic \
41 -j .dynsym -j .rel -j .rela -j .reloc -j .eh_frame \
42 --target=efi-app-$(ARCH) $< $@
44 gummiboot.so: gummiboot.o
45 $(LD) $(LDFLAGS) gummiboot.o -o $@ -lefi -lgnuefi
47 gummiboot.o: gummiboot.c Makefile
50 rm -f gummiboot.o gummiboot.so gummiboot.efi
53 @# UUID=677B-ECF2 /boot2 vfat noauto,x-systemd.automount,x-gvfs-hide 1 3
54 cp -v gummiboot.efi /boot/EFI/gummiboot/
55 @# unmount to sync EFI partition to disk
58 echo 3 > /proc/sys/vm/drop_caches
59 @# run QEMU with UEFI firmware
60 qemu-kvm -m 512 -L /usr/lib/qemu-bios -snapshot /dev/sda