Makefile 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. ################################################################################
  2. #
  3. # Copyright (c) 2015 Minoca Corp. All Rights Reserved
  4. #
  5. # Module Name:
  6. #
  7. # Raspberry Pi 2 UEFI Firmware
  8. #
  9. # Abstract:
  10. #
  11. # This module implements UEFI firmware for the Raspberry Pi 2.
  12. #
  13. # Author:
  14. #
  15. # Chris Stevens 19-Mar-2015
  16. #
  17. # Environment:
  18. #
  19. # Firmware
  20. #
  21. ################################################################################
  22. include $(SRCDIR)/../common
  23. BINARY := rpi2fw.elf
  24. BINARYTYPE = staticapp
  25. BINPLACE = bin
  26. VPATH += $(BINROOT):
  27. LDFLAGS += -Wl,--no-wchar-size-warning -nodefaultlibs -nostartfiles -nostdlib
  28. RAMDISK = emptyrd
  29. RAMDISK_O = ramdisk.o
  30. OBJS += debug.o \
  31. fwvol.o \
  32. intr.o \
  33. main.o \
  34. memmap.o \
  35. rpi2fwv.o \
  36. ramdenum.o \
  37. $(RAMDISK_O) \
  38. smbios.o \
  39. smp.o \
  40. timer.o \
  41. ARMV7_OBJS = armv7/entry.o \
  42. armv7/smpa.o \
  43. armv7/timera.o \
  44. TEXT_ADDRESS = 0x00008000
  45. TARGETLIBS += $(OBJROOT)/os/uefi/dev/pl11/pl11.a \
  46. $(OBJROOT)/os/uefi/dev/sd/core/sd.a \
  47. $(OBJROOT)/os/uefi/dev/bcm2709/bcm2709.a \
  48. EXTRA_SRC_DIRS = armv7
  49. ##
  50. ## Only build the directories if the binary hasn't been forced on the command
  51. ## line.
  52. ##
  53. ifeq ($(BINARY), rpi2fw.elf)
  54. RAMDISK_O = emptyrd.o
  55. DIRS = acpi \
  56. blobs \
  57. runtime
  58. endif
  59. include $(SRCROOT)/os/minoca.mk
  60. CFLAGS += -fshort-wchar
  61. ##
  62. ## Define the target that creates the firmware volume object file.
  63. ##
  64. FWVOL_IMAGES = $(RTBASE) runtime/rpi2rt.ffs acpi/acpi.ffs
  65. rpi2fwv.o: rpi2fwv
  66. @echo Objectifying - $(notdir $<)
  67. @$(OBJCOPY) -B $(BFD_ARCH) -I binary -O $(OBJ_FORMAT) $< $@
  68. rpi2fwv: $(FWVOL_IMAGES)
  69. @echo Generating - $@
  70. @genfv -o $@ $^
  71. $(RAMDISK_O): $(RAMDISK)
  72. @echo Objectifying - $(notdir $<)
  73. @cp $^ ramdisk
  74. @$(OBJCOPY) -I binary -O $(OBJ_FORMAT) -B $(BFD_ARCH) ramdisk $@
  75. emptyrd:
  76. @echo Minoca > $@
  77. runtime/rpi2rt.ffs: runtime
  78. acpi/acpi.ffs: acpi
  79. postbuild: rpi2fw
  80. rpi2fw: $(BINARY)
  81. @echo Flattening - $(notdir $<)
  82. @$(OBJCOPY) -O binary $^ $@
  83. @cp -p $@ $(BINROOT)/