Makefile 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. ################################################################################
  2. #
  3. # Copyright (c) 2014 Minoca Corp. All Rights Reserved
  4. #
  5. # Module Name:
  6. #
  7. # BeagleBone UEFI Firmware
  8. #
  9. # Abstract:
  10. #
  11. # This module implements UEFI firmware for the TI BeagleBone Black.
  12. #
  13. # Author:
  14. #
  15. # Evan Green 19-Dec-2014
  16. #
  17. # Environment:
  18. #
  19. # Firmware
  20. #
  21. ################################################################################
  22. include $(SRCDIR)/../common
  23. BINARY := bbonefw.elf
  24. BINARYTYPE = staticapp
  25. BINPLACE = bin
  26. LDFLAGS += -Wl,--no-wchar-size-warning -nodefaultlibs -nostartfiles -nostdlib
  27. RAMDISK = emptyrd
  28. RAMDISK_O = ramdisk.o
  29. OBJS += clock.o \
  30. debug.o \
  31. fwvol.o \
  32. i2c.o \
  33. intr.o \
  34. main.o \
  35. memmap.o \
  36. bbonefwv.o \
  37. ramdenum.o \
  38. $(RAMDISK_O) \
  39. sd.o \
  40. serial.o \
  41. smbios.o \
  42. timer.o \
  43. video.o \
  44. ARMV7_OBJS = armv7/entry.o \
  45. TEXT_ADDRESS = 0x82000000
  46. TARGETLIBS += $(OBJROOT)/os/uefi/dev/sd/core/sd.a \
  47. $(OBJROOT)/os/uefi/dev/omapuart/omapuart.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), bbonefw.elf)
  54. RAMDISK_O = emptyrd.o
  55. DIRS = acpi \
  56. init \
  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/bbonert.ffs acpi/acpi.ffs
  65. bbonefwv.o: bbonefwv
  66. @echo Objectifying - $(notdir $<)
  67. @$(OBJCOPY) -B $(BFD_ARCH) -I binary -O $(OBJ_FORMAT) $< $@
  68. bbonefwv: $(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/bbonert.ffs: runtime
  78. acpi/acpi.ffs: acpi
  79. ##
  80. ## Handle any post build steps to fix up the firmware images.
  81. ##
  82. ifeq ($(BINARY), bbonefw.elf)
  83. postbuild: bbonefw bbonefw.bin
  84. bbonefw: bbonefw.bin
  85. @echo Generating - $@
  86. @mkuboot -c -a arm -f legacy -l $(TEXT_ADDRESS) -e $(TEXT_ADDRESS) -o $@ $^
  87. @cp -p $@ $(BINROOT)/
  88. bbonefw.bin: $(BINARY)
  89. @echo Flattening - $(notdir $<)
  90. @$(OBJCOPY) -O binary $^ $@
  91. endif