Makefile 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. ################################################################################
  2. #
  3. # Copyright (c) 2014 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. # BeagleBone UEFI Firmware
  13. #
  14. # Abstract:
  15. #
  16. # This module implements UEFI firmware for the TI BeagleBone Black.
  17. #
  18. # Author:
  19. #
  20. # Evan Green 19-Dec-2014
  21. #
  22. # Environment:
  23. #
  24. # Firmware
  25. #
  26. ################################################################################
  27. include $(SRCDIR)/../common
  28. BINARY := bbonefw.elf
  29. BINARYTYPE = staticapp
  30. BINPLACE = bin
  31. LDFLAGS += -Wl,--no-wchar-size-warning -nodefaultlibs -nostartfiles -nostdlib
  32. RAMDISK_O = ramdisk.o
  33. OBJS += clock.o \
  34. debug.o \
  35. fwvol.o \
  36. i2c.o \
  37. intr.o \
  38. main.o \
  39. memmap.o \
  40. bbonefwv.o \
  41. ramdenum.o \
  42. $(RAMDISK_O) \
  43. sd.o \
  44. serial.o \
  45. smbios.o \
  46. timer.o \
  47. video.o \
  48. ARMV7_OBJS = armv7/entry.o \
  49. TEXT_ADDRESS := 0x82000000
  50. TARGETLIBS += $(OBJROOT)/os/uefi/dev/sd/core/sd.a \
  51. $(OBJROOT)/os/uefi/dev/omapuart/omapuart.a \
  52. EXTRA_SRC_DIRS = armv7
  53. ##
  54. ## Only build the directories if the binary hasn't been forced on the command
  55. ## line.
  56. ##
  57. ifeq ($(BINARY), bbonefw.elf)
  58. RAMDISK_O = $(OBJROOT)/os/uefi/core/emptyrd/emptyrd.a
  59. DIRS = acpi \
  60. init \
  61. runtime
  62. endif
  63. include $(SRCROOT)/os/minoca.mk
  64. CFLAGS += -fshort-wchar
  65. ##
  66. ## Define the target that creates the firmware volume object file.
  67. ##
  68. FWVOL_IMAGES = $(RTBASE) runtime/bbonert.ffs acpi/acpi.ffs
  69. bbonefwv.o: bbonefwv
  70. bbonefwv: $(FWVOL_IMAGES)
  71. @echo Generating - $@
  72. @genfv -o $@ $^
  73. ramdisk.o: ramdisk
  74. runtime/bbonert.ffs: runtime
  75. acpi/acpi.ffs: acpi
  76. ##
  77. ## Handle any post build steps to fix up the firmware images.
  78. ##
  79. ifeq ($(BINARY), bbonefw.elf)
  80. postbuild: bbonefw bbonefw.bin
  81. bbonefw: bbonefw.bin
  82. @echo Generating - $@
  83. @mkuboot -c -a arm -f legacy -l $(TEXT_ADDRESS) -e $(TEXT_ADDRESS) -o $@ $^
  84. @cp -p $@ $(BINROOT)/
  85. bbonefw.bin: $(BINARY)
  86. @echo Flattening - $(notdir $<)
  87. @$(OBJCOPY) -O binary $^ $@
  88. endif