Makefile 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188
  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. # Binary Name:
  11. #
  12. # Images
  13. #
  14. # Abstract:
  15. #
  16. # This module builds the final OS images.
  17. #
  18. # Author:
  19. #
  20. # Evan Green 26-Oct-2015
  21. #
  22. # Environment:
  23. #
  24. # Build
  25. #
  26. ################################################################################
  27. include $(SRCROOT)/os/minoca.mk
  28. VPATH += $(BINROOT):
  29. INSTALL_IMAGE := $(BINROOT)/install.img
  30. IMAGES = $(INSTALL_IMAGE)
  31. ifneq ($(DEBUG),rel)
  32. MSETUP_DEBUG := -D
  33. endif
  34. MSETUP := msetup
  35. MSETUP_IMAGE_SIZE := -G512M
  36. MSETUP_TINY_IMAGE_SIZE := -G30M
  37. ##
  38. ## Build x86 images.
  39. ##
  40. ifeq (x86, $(ARCH)$(VARIANT))
  41. IMAGES += $(BINROOT)/pc.img \
  42. $(BINROOT)/pcefi.img \
  43. $(BINROOT)/pctiny.img \
  44. $(INSTALL_IMAGE): $(LAST_UPDATE_FILE)
  45. @echo Building - $(notdir $@)
  46. @mkdir -p $(BINROOT)/apps
  47. @cd $(BINROOT) && $(MSETUP) -ql install-x86 -i.. -d $@ $(MSETUP_IMAGE_SIZE)
  48. $(BINROOT)/pc.img: $(INSTALL_IMAGE)
  49. @echo Building - $(notdir $@)
  50. @cd $(BINROOT) && $(MSETUP) -ql pc -i $< $(MSETUP_DEBUG) -d $@ \
  51. $(MSETUP_IMAGE_SIZE)
  52. $(BINROOT)/pcefi.img: $(INSTALL_IMAGE)
  53. @echo Building - $(notdir $@)
  54. @cd $(BINROOT) && $(MSETUP) -ql pcefi -i $< $(MSETUP_DEBUG) -d $@ \
  55. $(MSETUP_IMAGE_SIZE)
  56. $(BINROOT)/pctiny.img: $(INSTALL_IMAGE)
  57. @echo Building - $(notdir $@)
  58. @cd $(BINROOT) && $(MSETUP) -ql pc-tiny -i $< $(MSETUP_DEBUG) -d $@ \
  59. $(MSETUP_TINY_IMAGE_SIZE)
  60. endif
  61. ##
  62. ## Build x86 Quark images. Debugging is currently disabled on Galileo since the
  63. ## headphones UART is used for the console.
  64. ##
  65. ifeq (x86q, $(ARCH)$(VARIANT))
  66. IMAGES += $(BINROOT)/galileo.img
  67. $(INSTALL_IMAGE): $(LAST_UPDATE_FILE)
  68. @echo Building - $(notdir $@)
  69. @mkdir -p $(BINROOT)/apps
  70. @cd $(BINROOT) && $(MSETUP) -ql install-x86 -i.. -d $@ $(MSETUP_IMAGE_SIZE)
  71. $(BINROOT)/galileo.img: $(INSTALL_IMAGE)
  72. @echo Building - $(notdir $@)
  73. @cd $(BINROOT) && $(MSETUP) -ql galileo -i $< -d $@ $(MSETUP_IMAGE_SIZE)
  74. endif
  75. ##
  76. ## Build ARMv7 images.
  77. ##
  78. ifeq (armv7, $(ARCH))
  79. IMAGES += $(BINROOT)/bbone.img \
  80. $(BINROOT)/integ.img \
  81. $(BINROOT)/integrd.img \
  82. $(BINROOT)/panda.img \
  83. $(BINROOT)/pandausb.img \
  84. $(BINROOT)/rpi2.img \
  85. $(BINROOT)/veyron.img \
  86. $(INSTALL_IMAGE): $(LAST_UPDATE_FILE)
  87. @echo Building - $(notdir $@)
  88. @mkdir -p $(BINROOT)/apps
  89. @cd $(BINROOT) && $(MSETUP) -ql install-armv7 -i.. -d $@ \
  90. $(MSETUP_IMAGE_SIZE)
  91. $(BINROOT)/bbone.img: $(INSTALL_IMAGE)
  92. @echo Building - $(notdir $@)
  93. @cd $(BINROOT) && $(MSETUP) -ql beagleboneblack -i $< $(MSETUP_DEBUG) \
  94. -d $@ $(MSETUP_IMAGE_SIZE)
  95. $(BINROOT)/integ.img: $(BINROOT)/integrd.img
  96. @echo Building - $(notdir $@)
  97. @cp $^ $(OBJROOT)/os/uefi/plat/integcp/ramdisk
  98. @cd $(SRCROOT)/os/uefi/plat/integcp && \
  99. $(MAKE) BINARY=integ.img SRCDIR=$(SRCROOT)/os/uefi/plat/integcp
  100. $(BINROOT)/integrd.img: $(INSTALL_IMAGE)
  101. @echo Building - $(notdir $@)
  102. @cd $(BINROOT) && $(MSETUP) -ql integrd -i $< $(MSETUP_DEBUG) -d $@ \
  103. $(MSETUP_TINY_IMAGE_SIZE)
  104. $(BINROOT)/panda.img: $(INSTALL_IMAGE)
  105. @echo Building - $(notdir $@)
  106. @cd $(BINROOT) && $(MSETUP) -ql panda -i $< $(MSETUP_DEBUG) -d $@ \
  107. $(MSETUP_IMAGE_SIZE)
  108. $(BINROOT)/pandausb.img: $(BINROOT)/pandard.img
  109. @echo Building - $(notdir $@)
  110. @cp $^ $(OBJROOT)/os/uefi/plat/panda/ramdisk
  111. @cd $(SRCROOT)/os/uefi/plat/panda && \
  112. $(MAKE) BINARY=pandafw_usb.elf SRCDIR=$(SRCROOT)/os/uefi/plat/panda
  113. $(BINROOT)/pandard.img: $(INSTALL_IMAGE)
  114. @echo Building - $(notdir $@)
  115. @cd $(BINROOT) && $(MSETUP) -ql panda-usb -i $< $(MSETUP_DEBUG) -d $@ \
  116. $(MSETUP_TINY_IMAGE_SIZE)
  117. $(BINROOT)/rpi2.img: $(INSTALL_IMAGE)
  118. @echo Building - $(notdir $@)
  119. @cd $(BINROOT) && $(MSETUP) -ql raspberrypi2 -i $< $(MSETUP_DEBUG) -d $@ \
  120. $(MSETUP_IMAGE_SIZE)
  121. $(BINROOT)/veyron.img: $(INSTALL_IMAGE)
  122. @echo Building - $(notdir $@)
  123. @cd $(BINROOT) && $(MSETUP) -ql veyron -i $< $(MSETUP_DEBUG) -d $@ \
  124. $(MSETUP_IMAGE_SIZE)
  125. endif
  126. ##
  127. ## Build ARMv6 images.
  128. ##
  129. ifeq (armv6, $(ARCH))
  130. IMAGES += $(BINROOT)/rpi.img \
  131. $(INSTALL_IMAGE): $(LAST_UPDATE_FILE)
  132. @echo Building - $(notdir $@)
  133. @mkdir -p $(BINROOT)/apps
  134. @cd $(BINROOT) && $(MSETUP) -ql install-armv6 -i.. -d $@ \
  135. $(MSETUP_IMAGE_SIZE)
  136. $(BINROOT)/rpi.img: $(INSTALL_IMAGE)
  137. @echo Building - $(notdir $@)
  138. @cd $(BINROOT) && $(MSETUP) -ql raspberrypi -i $< $(MSETUP_DEBUG) -d $@ \
  139. $(MSETUP_IMAGE_SIZE)
  140. endif
  141. all: $(IMAGES)
  142. clean: images-clean
  143. .PHONY: images-clean
  144. images-clean:
  145. rm -f $(IMAGES)