Modify existing Makefile to allow compilation of UEFI app.

Added targets for the main files - BOOTX64.EFI, data.c and entry.c
Also minor formatting changes, but whatever.
This commit is contained in:
Curle 2019-07-17 15:45:24 +01:00
parent ab9be9fd4f
commit 352db828e7

View File

@ -33,7 +33,7 @@ $(KERNEL_ARCH_OBJS) \
kernel/utils.o \ kernel/utils.o \
kernel/serial.o \ kernel/serial.o \
kernel/interrupts.o \ kernel/interrupts.o \
kernel/descriptor_tables.o\ kernel/descriptor_tables.o \
kernel/kernel.o kernel/kernel.o
OBJS=\ OBJS=\
@ -47,7 +47,7 @@ $(LIBS) \
.PHONY: all clean install install-headers install-kernel .PHONY: all clean install install-headers install-kernel
.SUFFIXES: .o .c .s .SUFFIXES: .o .c .s
all: red.kernel all: BOOTX64.EFI
red.kernel: $(OBJS) $(ARCHDIR)/linker.ld red.kernel: $(OBJS) $(ARCHDIR)/linker.ld
$(CC) -T $(ARCHDIR)/linker.ld -o $@ $(CFLAGS) $(LINK_LIST) $(CC) -T $(ARCHDIR)/linker.ld -o $@ $(CFLAGS) $(LINK_LIST)
@ -88,4 +88,13 @@ gen-iso:
-o red.iso \ -o red.iso \
iso iso
BOOTX64.EFI: arch/uefi/entry.o efi/lib/data.o
$(EFI-CC) -nostdlib -Wl,-dll -shared -Wl,--subsystem,10 -e efi_main -o BOOTX64.EFI arch/uefi/entry.o data.o -lgcc
arch/uefi/entry.o:
$(EFI-CC) -ffreestanding -Iinclude/efi/ -Iinclude/efi/x86_64 -Iinclude/efi/protocol -c -o arch/uefi/entry.o arch/uefi/entry.c
efi/lib/data.o:
$(EFI-CC) -ffreestanding -Iinclude/efi/ -Iinclude/efi/x86_64 -Iinclude/efi/protocol -c -o data.o efi/lib/data.c
-include $(OBJS:.o=.d) -include $(OBJS:.o=.d)