Mercurial > hg > Members > taiki > EFIKernel
changeset 1:10316df81650
start to write efi source of "bootx64.c".
author | one |
---|---|
date | Thu, 13 Dec 2012 03:46:48 +0900 |
parents | e091e06fdd2d |
children | 0fefb1d94991 |
files | Makefile bootx64.c |
diffstat | 2 files changed, 41 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/Makefile Fri Nov 16 15:57:56 2012 +0900 +++ b/Makefile Thu Dec 13 03:46:48 2012 +0900 @@ -1,6 +1,34 @@ -include Makefile.def +ARCH =$(shell uname -m |sed s,i[3456789]86,ia32,) +LIB_PATH = /usr/lib64 +EFI_INCLUDE = /usr/include/efi +EFI_INCLUDES = -nostdinc -I$(EFI_INCLUDE) -I$(EFI_INCLUDE)/$(ARCH) -I$(EFI_INCLUDE)/protocol + +EFI_PATH = /usr/lib64/gnuefi +EFI_CRT_OBJS = $(EFI_PATH)/crt0-efi-$(ARCH).o +EFI_LDS = $(EFI_PATH)/elf_$(ARCH)_efi.lds + +CFLAGS = -fno-stack-protector -fpic -fshort-wchar -mno-red-zone $(EFI_INCLUDES) +ifeq ($(ARCH),x86_64) + CFLAGS += -DEFI_FUNCTION_WRAPPER +endif + +LDFLAGS = -nostdlib -znocombreloc -T $(EFI_LDS) -shared -Bsymbolic -L$(EFI_PATH) -L$(LIB_PATH) \ + $(EFI_CRT_OBJS) -lefi -lgnuefi -TARGET = BOOTX86.EFI +TARGET = bootx64.efi +OBJS = bootx64.o +SOURCES = bootx64.c + +all: $(TARGET) + +bootx64.so: $(OBJS) + $(LD) -o $@ $(LDFLAGS) $^ $(EFI_LIBS) -$(TARGET): bootx86.c - $(CC) bootx86.c +%.efi: %.so + objcopy -j .text -j .sdata -j .data \ + -j .dynamic -j .dynsym -j .rel \ + -j .rela -j .reloc -j .eh_frame \ + --target=efi-app-$(ARCH) $^ $@ + +clean: + rm -rf $(TARGET) *.o *.so