Makefile 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  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+=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_HARDWARE_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_HARDWARE_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_HARDWARE_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. kernel-install:
  72. @cp $(KERNEL) $(FW_DIR)/$(TARGET_KERNEL)
  73. dtb-install:
  74. env $(KERNEL_MAKE_ENV) $(MAKE) -C $(LINUX_DIR) $(KERNEL_MAKE_OPTS) \
  75. -j${ADK_MAKE_JOBS} imx6q-cubox-i.dtb imx6dl-cubox-i.dtb $(MAKE_TRACE)
  76. $(CP) $(LINUX_DIR)/arch/arm/boot/dts/imx6*-cubox-i.dtb \
  77. $(FW_DIR)
  78. # filesystem specific targets
  79. ifeq ($(ADK_TARGET_FS),archive)
  80. ifeq ($(ADK_TARGET_SYSTEM_CUBOX_I),y)
  81. imageinstall: dtb-install $(FW_DIR)/$(ROOTFSTARBALL) targethelp
  82. else
  83. imageinstall: $(FW_DIR)/$(ROOTFSTARBALL) targethelp
  84. endif
  85. endif
  86. ifeq ($(ADK_TARGET_FS),initramfs)
  87. imageinstall: kernel-install $(FW_DIR)/$(INITRAMFS) targethelp
  88. endif
  89. ifeq ($(ADK_TARGET_FS),initramfs-archive)
  90. imageinstall: kernel-install $(FW_DIR)/$(ROOTFSUSERTARBALL) targethelp
  91. endif
  92. ifeq ($(ADK_TARGET_FS),initramfs-piggyback)
  93. imageinstall: createinitramfs targethelp
  94. endif
  95. ifeq ($(ADK_TARGET_FS),nfsroot)
  96. imageinstall: kernel-install $(FW_DIR)/$(ROOTFSUSERTARBALL) targethelp
  97. endif
  98. ifeq ($(ADK_TARGET_FS),usb)
  99. imageinstall: $(FW_DIR)/$(ROOTFSTARBALL) targethelp
  100. endif