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:
parent
ab9be9fd4f
commit
352db828e7
29
makefile
29
makefile
|
@ -28,26 +28,26 @@ CPPFLAGS:=$(CPPFLAGS) $(KERNEL_ARCH_CPPFLAGS)
|
|||
LDFLAGS:=$(LDFLAGS) $(KERNEL_ARCH_LDFLAGS)
|
||||
LIBS:=$(LIBS) $(KERNEL_ARCH_LIBS)
|
||||
|
||||
KERNEL_OBJS= \
|
||||
$(KERNEL_ARCH_OBJS) \
|
||||
kernel/utils.o \
|
||||
kernel/serial.o \
|
||||
kernel/interrupts.o \
|
||||
kernel/descriptor_tables.o\
|
||||
KERNEL_OBJS= \
|
||||
$(KERNEL_ARCH_OBJS) \
|
||||
kernel/utils.o \
|
||||
kernel/serial.o \
|
||||
kernel/interrupts.o \
|
||||
kernel/descriptor_tables.o \
|
||||
kernel/kernel.o
|
||||
|
||||
OBJS=\
|
||||
$(KERNEL_OBJS)
|
||||
|
||||
LINK_LIST=\
|
||||
$(LDFLAGS) \
|
||||
$(KERNEL_OBJS) \
|
||||
$(LIBS) \
|
||||
$(LDFLAGS) \
|
||||
$(KERNEL_OBJS) \
|
||||
$(LIBS) \
|
||||
|
||||
.PHONY: all clean install install-headers install-kernel
|
||||
.SUFFIXES: .o .c .s
|
||||
|
||||
all: red.kernel
|
||||
all: BOOTX64.EFI
|
||||
|
||||
red.kernel: $(OBJS) $(ARCHDIR)/linker.ld
|
||||
$(CC) -T $(ARCHDIR)/linker.ld -o $@ $(CFLAGS) $(LINK_LIST)
|
||||
|
@ -88,4 +88,13 @@ gen-iso:
|
|||
-o red.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)
|
||||
|
|
Loading…
Reference in New Issue
Block a user