Makefile 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. # This file is part of the OpenADK project. OpenADK is copyrighted
  2. # material, please see the LICENCE file in the top-level directory.
  3. include $(TOPDIR)/rules.mk
  4. include $(TOPDIR)/mk/kernel.mk
  5. include $(TOPDIR)/mk/modules.mk
  6. include $(TOPDIR)/mk/kernel-build.mk
  7. include $(TOPDIR)/mk/image.mk
  8. KERNEL:=$(LINUX_DIR)/$(ADK_TARGET_KERNEL)
  9. ifeq ($(ADK_TARGET_KERNEL_ZIMAGE),y)
  10. KERNEL:=$(LINUX_DIR)/arch/arm/boot/zImage
  11. endif
  12. ifeq ($(ADK_TARGET_KERNEL_UIMAGE),y)
  13. KERNEL:=$(LINUX_DIR)/arch/arm/boot/uImage
  14. endif
  15. QEMU_ARGS:=${ADK_QEMU_ARGS}
  16. ifeq ($(ADK_TARGET_QEMU_ARM_MODEL_SPITZ),y)
  17. QEMU_ARGS+=-M spitz
  18. endif
  19. ifeq ($(ADK_TARGET_QEMU_ARM_MODEL_VERSATILEPB),y)
  20. QEMU_ARGS+=-M versatilepb -net user -net nic,model=smc91c111
  21. endif
  22. ifeq ($(ADK_TARGET_QEMU_ARM_MODEL_VEXPRESS_A9),y)
  23. QEMU_ARGS+=-M vexpress-a9 -cpu cortex-a9 -net user -net nic,model=lan9118
  24. endif
  25. ifeq ($(ADK_TARGET_QEMU_WITH_VIRTIO),y)
  26. QEMU_ARGS+=-drive file=qemu-${CPU_ARCH}.img,if=virtio,index=0 -net nic,model=virtio -net user
  27. endif
  28. # target helper text
  29. ifeq ($(ADK_TARGET_FS),archive)
  30. targethelp:
  31. @echo "The RootFS tarball is: $(FW_DIR)/$(ROOTFSTARBALL)"
  32. ifeq ($(ADK_TARGET_QEMU),y)
  33. @echo 'The kernel file is: $(FW_DIR)/${TARGET_KERNEL}'
  34. @echo "Use following command to create a QEMU Image:"
  35. @echo "./scripts/create.sh qemu-${CPU_ARCH}.img $(FW_DIR)/$(ROOTFSTARBALL)"
  36. @echo "Start qemu with following options:"
  37. @echo 'qemu-system-${CPU_ARCH} ${QEMU_ARGS} -kernel $(FW_DIR)/$(TARGET_KERNEL) qemu-${CPU_ARCH}.img'
  38. endif
  39. ifeq ($(ADK_TARGET_SYSTEM_RASPBERRY_PI),y)
  40. @echo "Use following command to install it on SD card:"
  41. @echo "sudo ./scripts/install-rpi.sh /dev/sdX $(FW_DIR)/$(ROOTFSTARBALL)"
  42. endif
  43. ifeq ($(ADK_TARGET_SYSTEM_CUBOX_I),y)
  44. @echo "Use following command to install it on SD card:"
  45. @echo "sudo ./scripts/install-cubox.sh /dev/sdX $(FW_DIR)/$(ROOTFSTARBALL) $(FW_DIR)"
  46. endif
  47. endif
  48. ifeq ($(ADK_TARGET_FS),initramfs)
  49. targethelp:
  50. @echo 'The kernel file is: $(FW_DIR)/${TARGET_KERNEL}'
  51. @echo 'The initramfs image is: ${FW_DIR}/${INITRAMFS}'
  52. ifeq ($(ADK_TARGET_QEMU),y)
  53. @echo "Start qemu with following command line:"
  54. @echo 'qemu-system-${CPU_ARCH} ${QEMU_ARGS} -kernel $(FW_DIR)/$(TARGET_KERNEL) -initrd ${FW_DIR}/${INITRAMFS}'
  55. endif
  56. endif
  57. ifeq ($(ADK_TARGET_FS),initramfs-archive)
  58. targethelp:
  59. @echo 'The kernel file is: $(FW_DIR)/${TARGET_KERNEL}'
  60. @echo "The RootFS tarball is: $(FW_DIR)/$(ROOTFSUSERTARBALL)"
  61. endif
  62. ifeq ($(ADK_TARGET_FS),initramfs-piggyback)
  63. targethelp:
  64. @echo 'The kernel+initramfs file is: $(FW_DIR)/${TARGET_KERNEL}'
  65. ifeq ($(ADK_TARGET_QEMU),y)
  66. @echo "Start qemu with following command line:"
  67. @echo 'qemu-system-${CPU_ARCH} ${QEMU_ARGS} -kernel $(FW_DIR)/$(TARGET_KERNEL)'
  68. endif
  69. endif
  70. kernel-strip:
  71. @cp $(KERNEL) $(BUILD_DIR)/$(TARGET_KERNEL)
  72. kernel-install: kernel-strip
  73. @cp $(BUILD_DIR) $(FW_DIR)/$(TARGET_KERNEL)
  74. dtb-install:
  75. env $(KERNEL_MAKE_ENV) $(MAKE) -C $(LINUX_DIR) $(KERNEL_MAKE_OPTS) \
  76. -j${ADK_MAKE_JOBS} imx6q-cubox-i.dtb imx6dl-cubox-i.dtb $(MAKE_TRACE)
  77. $(CP) $(LINUX_DIR)/arch/arm/boot/dts/imx6*-cubox-i.dtb \
  78. $(FW_DIR)
  79. # filesystem specific targets
  80. ifeq ($(ADK_TARGET_FS),archive)
  81. ifeq ($(ADK_TARGET_SYSTEM_CUBOX_I),y)
  82. imageinstall: dtb-install $(FW_DIR)/$(ROOTFSTARBALL) targethelp
  83. else
  84. imageinstall: $(FW_DIR)/$(ROOTFSTARBALL) targethelp
  85. endif
  86. endif
  87. ifeq ($(ADK_TARGET_FS),initramfs)
  88. imageinstall: kernel-install $(FW_DIR)/$(INITRAMFS) targethelp
  89. endif
  90. ifeq ($(ADK_TARGET_FS),initramfs-archive)
  91. imageinstall: kernel-install $(FW_DIR)/$(ROOTFSUSERTARBALL) targethelp
  92. endif
  93. ifeq ($(ADK_TARGET_FS),initramfs-piggyback)
  94. imageinstall: createinitramfs targethelp
  95. endif
  96. ifeq ($(ADK_TARGET_FS),nfsroot)
  97. imageinstall: kernel-install $(FW_DIR)/$(ROOTFSUSERTARBALL) targethelp
  98. endif
  99. ifeq ($(ADK_TARGET_FS),usb)
  100. imageinstall: $(FW_DIR)/$(ROOTFSTARBALL) targethelp
  101. endif