forked from utshina/uefi-simple
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
27 lines (20 loc) · 634 Bytes
/
Makefile
File metadata and controls
27 lines (20 loc) · 634 Bytes
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
CC = x86_64-w64-mingw32-gcc
CFLAGS = -shared -nostdlib -mno-red-zone -fno-stack-protector -Wall \
-e EfiMain
all: main.efi
%.efi: %.dll
objcopy --target=efi-app-x86_64 $< $@
%.dll: %.c
$(CC) $(CFLAGS) $< -o $@
qemu: main.efi OVMF.fd image/EFI/BOOT/BOOTX64.EFI
qemu-system-x86_64 -nographic -bios OVMF.fd -hda fat:image
image/EFI/BOOT/BOOTX64.EFI:
mkdir -p image/EFI/BOOT
ln -sf ../../../main.efi image/EFI/BOOT/BOOTX64.EFI
OVMF.fd:
wget http://downloads.sourceforge.net/project/edk2/OVMF/OVMF-X64-r15214.zip
unzip OVMF-X64-r15214.zip OVMF.fd
rm OVMF-X64-r15214.zip
clean:
rm -f main.efi OVMF.fd
rm -rf image