Makefile 4.4 KB

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