Makefile 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. ################################################################################
  2. #
  3. # Copyright (c) 2014 Minoca Corp. All Rights Reserved
  4. #
  5. # Module Name:
  6. #
  7. # Runtime Core
  8. #
  9. # Abstract:
  10. #
  11. # This module implements the UEFI core runtime support, which only
  12. # supports setting the virtual address map. It is implemented as a
  13. # separate runtime binary to avoid the paradox of ExitBootServices
  14. # and SetVirtualAddressMap trying to tear down or change themselves.
  15. #
  16. # Author:
  17. #
  18. # Evan Green 10-Mar-2014
  19. #
  20. # Environment:
  21. #
  22. # Firmware
  23. #
  24. ################################################################################
  25. BINARY = rtbase.elf
  26. BINARYTYPE = staticapp
  27. BINPLACE = bin
  28. INCLUDES += $(SRCROOT)/os/uefi/include;..;
  29. OBJS = ../crc32.o \
  30. runtime.o \
  31. VPATH += $(BINROOT):
  32. ENTRY = EfiRuntimeDriverEntry
  33. LDFLAGS += -pie -nodefaultlibs -nostartfiles -nostdlib
  34. ifeq ($(ARCH), armv7)
  35. LINKER_SCRIPT = $(SRCROOT)/os/uefi/include/link_arm.x
  36. endif
  37. ifeq ($(ARCH), armv6)
  38. LINKER_SCRIPT = $(SRCROOT)/os/uefi/include/link_arm.x
  39. endif
  40. TARGETLIBS = $(OBJROOT)/os/uefi/archlib/uefiarch.a \
  41. ##
  42. ## On architectures that produce ELF binaries, convert it to a PE image.
  43. ##
  44. postbuild: rtbase.ffs
  45. rtbase.ffs: rtbase
  46. @genffs -s -i $< -r EFI_SECTION_PE32 \
  47. -i $< -r EFI_SECTION_USER_INTERFACE -t EFI_FV_FILETYPE_DRIVER -o $@
  48. rtbase: $(BINARY)
  49. @elfconv -o $@ -t efiruntimedriver $<
  50. include $(SRCROOT)/os/minoca.mk
  51. CFLAGS += -fshort-wchar