1
0

Makefile 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  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. LOADADDR:=0x20008000
  16. ifeq ($(ADK_TARGET_QEMU_ARM_MODEL_SPITZ),y)
  17. MACH:=spitz
  18. endif
  19. ifeq ($(ADK_TARGET_QEMU_ARM_MODEL_VERSATILEPB),y)
  20. MACH:=versatilepb
  21. NET:=-net user -net nic,model=smc91c111
  22. endif
  23. ifeq ($(ADK_TARGET_QEMU_ARM_MODEL_VEXPRESS_A9),y)
  24. MACH:=vexpress-a9
  25. NET:=-cpu cortex-a9 -net user -net nic,model=lan9118
  26. endif
  27. dtb-install:
  28. env $(KERNEL_MAKE_ENV) $(MAKE) -C $(LINUX_DIR) $(KERNEL_MAKE_OPTS) \
  29. -j${ADK_MAKE_JOBS} imx6q-cubox-i.dtb imx6dl-cubox-i.dtb $(MAKE_TRACE)
  30. $(CP) $(LINUX_DIR)/arch/arm/boot/dts/imx6*-cubox-i.dtb \
  31. $(FW_DIR)
  32. kernel-install:
  33. gzip -9 < $(LINUX_DIR)/arch/arm/boot/Image > ${BUILD_DIR}/Image.gz
  34. PATH='${TARGET_PATH}' mkimage -A arm -O linux -T kernel -C gzip \
  35. -a ${LOADADDR} -e ${LOADADDR} -d ${BUILD_DIR}/Image.gz \
  36. -n foxg20 $(KERNEL) $(MAKE_TRACE)
  37. ifeq ($(ADK_TARGET_FS),nfsroot)
  38. imageinstall: kernel-install ${FW_DIR}/${ROOTFSUSERTARBALL}
  39. @cp $(KERNEL) $(FW_DIR)/$(TARGET_KERNEL)
  40. @echo 'Type dhcp via u-boot prompt to load kernel'
  41. @echo 'After that type bootm to load the kernel'
  42. endif
  43. ifeq ($(ADK_TARGET_FS),archive)
  44. ifeq ($(ADK_TARGET_SYSTEM_CUBOX_I),y)
  45. imageinstall: dtb-install $(FW_DIR)/$(ROOTFSTARBALL)
  46. else
  47. imageinstall: $(FW_DIR)/$(ROOTFSTARBALL)
  48. endif
  49. @echo "The RootFS tarball is: $(FW_DIR)/$(ROOTFSTARBALL)"
  50. ifeq ($(ADK_TARGET_SYSTEM_RASPBERRY_PI),y)
  51. @echo "Use following command to install it on SD card:"
  52. @echo "sudo ./scripts/install-rpi.sh /dev/sdX $(FW_DIR)/$(ROOTFSTARBALL)"
  53. endif
  54. ifeq ($(ADK_TARGET_SYSTEM_CUBOX_I),y)
  55. @echo "Use following command to install it on SD card:"
  56. @echo "sudo ./scripts/install-cubox.sh /dev/sdX $(FW_DIR)/$(ROOTFSTARBALL) $(FW_DIR)"
  57. endif
  58. ifeq ($(ADK_TARGET_SYSTEM_QEMU_ARM)$(ADK_TARGET_SYSTEM_QEMU_ARMHF),y)
  59. @cp $(KERNEL) $(FW_DIR)/$(TARGET_KERNEL)
  60. @echo 'The kernel file is: $(FW_DIR)/${TARGET_KERNEL}'
  61. @echo "Use following command to create a QEMU Image:"
  62. @echo "./scripts/create.sh qemu-${CPU_ARCH}.img $(FW_DIR)/$(ROOTFSTARBALL)"
  63. @echo "Start qemu with following options:"
  64. @echo 'qemu-system-arm -M $(MACH) -nographic $(NET) -kernel $(FW_DIR)/$(TARGET_KERNEL) -hda qemu-${CPU_ARCH}.img'
  65. endif
  66. endif
  67. ifeq ($(ADK_TARGET_FS),initramfsarchive)
  68. imageinstall: $(FW_DIR)/$(ROOTFSUSERTARBALL)
  69. @cp $(KERNEL) $(FW_DIR)/$(TARGET_KERNEL)
  70. @echo 'The kernel file is: $(FW_DIR)/${TARGET_KERNEL}'
  71. @echo "The RootFS tarball is: $(FW_DIR)/$(ROOTFSUSERTARBALL)"
  72. endif
  73. ifeq ($(ADK_TARGET_FS),initramfs)
  74. imageinstall: $(FW_DIR)/$(INITRAMFS)
  75. @cp $(KERNEL) $(FW_DIR)/$(TARGET_KERNEL)
  76. @echo 'The kernel file is: $(FW_DIR)/${TARGET_KERNEL}'
  77. @echo 'The initramfs image is: ${FW_DIR}/${INITRAMFS}'
  78. ifeq ($(ADK_TARGET_SYSTEM_QEMU_ARM)$(ADK_TARGET_SYSTEM_QEMU_ARMHF),y)
  79. ifeq ($(ADK_TARGET_QEMU_WITH_VIRTIO),y)
  80. @echo 'qemu-system-arm -nographic -kernel $(FW_DIR)/$(TARGET_KERNEL) -drive file=qemu-${CPU_ARCH}.img,if=virtio,index=0 -net nic,model=virtio -net user'
  81. else
  82. @echo "Start qemu with following command line:"
  83. @echo 'qemu-system-arm -M $(MACH) -nographic $(NET) -kernel $(FW_DIR)/$(TARGET_KERNEL) -initrd ${FW_DIR}/${INITRAMFS}'
  84. endif
  85. endif
  86. endif
  87. ifeq ($(ADK_TARGET_FS),initramfs-piggyback)
  88. imageinstall: createinitramfs
  89. @cp $(KERNEL) $(FW_DIR)/$(TARGET_KERNEL)
  90. @echo 'The kernel+initramfs file is: $(FW_DIR)/${TARGET_KERNEL}'
  91. ifeq ($(ADK_TARGET_SYSTEM_QEMU_ARM)$(ADK_TARGET_SYSTEM_QEMU_ARMHF),y)
  92. @echo "Start qemu with following command line:"
  93. @echo 'qemu-system-arm -M $(MACH) -nographic $(NET) -kernel $(FW_DIR)/$(TARGET_KERNEL)'
  94. endif
  95. endif