forked from aa15032261/apple_set_os-loader
-
Notifications
You must be signed in to change notification settings - Fork 7
/
Makefile
28 lines (20 loc) · 974 Bytes
/
Makefile
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
ARCH = x86_64
TARGET = bootx64.efi bootx64_silent.efi
FORMAT = efi-app-$(ARCH)
OBJS = ./lib/int_event.o ./lib/int_graphics.o ./lib/int_mem.o ./lib/int_dpath.o ./lib/int_print.o ./lib/pci_db.o
INC = /usr/include/efi
CFLAGS = -I$(INC) -I$(INC)/$(ARCH) \
-DGNU_EFI_USE_MS_ABI -fPIC -fshort-wchar -ffreestanding \
-fno-stack-protector -maccumulate-outgoing-args \
-Wall -D$(ARCH) -Werror -m64 -mno-red-zone
LDFLAGS = -T /usr/lib/elf_$(ARCH)_efi.lds -Bsymbolic -shared -nostdlib -znocombreloc \
/usr/lib/crt0-efi-$(ARCH).o
all: $(TARGET)
bootx64.so: $(OBJS) bootx64.o
$(LD) $(LDFLAGS) -o $@ $^ $(shell $(CC) $(CFLAGS) -print-libgcc-file-name) /usr/lib/libgnuefi.a
bootx64_silent.so: $(OBJS) bootx64_silent.o
$(LD) $(LDFLAGS) -o $@ $^ $(shell $(CC) $(CFLAGS) -print-libgcc-file-name) /usr/lib/libgnuefi.a
%.efi: %.so
objcopy -j .text -j .sdata -j .data -j .dynamic -j .dynsym -j .rel -j .rela -j .reloc -S --target=$(FORMAT) $^ $@
clean:
rm -f *.so *.o