Makefile 2.2 KB

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