Makefile 3.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  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. ifeq ($(ADK_TARGET_KERNEL_ZIMAGE),y)
  9. KERNEL:=$(LINUX_DIR)/arch/arm/boot/zImage
  10. else
  11. KERNEL:=$(LINUX_DIR)/$(ADK_TARGET_KERNEL)
  12. endif
  13. LOADADDR:=0x20008000
  14. ifeq ($(ADK_TARGET_QEMU_ARM_MODEL_SPITZ),y)
  15. MACH:=spitz
  16. endif
  17. ifeq ($(ADK_TARGET_QEMU_ARM_MODEL_VERSATILEPB),y)
  18. MACH:=versatilepb
  19. NET:=-net user -net nic,model=smc91c111
  20. endif
  21. ifeq ($(ADK_TARGET_QEMU_ARM_MODEL_VEXPRESS_A9),y)
  22. MACH:=vexpress-a9
  23. NET:=-cpu cortex-a9 -net user -net nic,model=lan9118
  24. endif
  25. kernel-install:
  26. gzip -9 < $(LINUX_DIR)/arch/arm/boot/Image > ${BUILD_DIR}/Image.gz
  27. PATH='${TARGET_PATH}' mkimage -A arm -O linux -T kernel -C gzip \
  28. -a ${LOADADDR} -e ${LOADADDR} -d ${BUILD_DIR}/Image.gz \
  29. -n foxg20 $(KERNEL) $(MAKE_TRACE)
  30. ifeq ($(ADK_TARGET_FS),nfsroot)
  31. imageinstall: kernel-install ${FW_DIR}/${ROOTFSUSERTARBALL}
  32. @cp $(KERNEL) $(FW_DIR)/$(TARGET_KERNEL)
  33. @echo 'Type dhcp via u-boot prompt to load kernel'
  34. @echo 'After that type bootm to load the kernel'
  35. endif
  36. ifeq ($(ADK_TARGET_FS),mmc)
  37. imageinstall: kernel-install $(FW_DIR)/$(ROOTFSTARBALL)
  38. @echo "The RootFS tarball is:"
  39. @echo "$(FW_DIR)/$(ROOTFSTARBALL)"
  40. @echo 'Before booting from MicroSD card you need to set following u-boot environment variable:'
  41. @echo "setenv bootcmd 'mmc init; sleep 1; fatload mmc 0 0x22000000 kernel; bootm 0x22000000'"
  42. @echo "saveenv"
  43. @echo
  44. @echo "Boot the board via network and use adkinstall."
  45. @echo "If you just want to update, use adkupdate."
  46. endif
  47. ifeq ($(ADK_TARGET_FS),archive)
  48. ifeq ($(ADK_TARGET_SYSTEM_ACMESYSTEMS_FOXG20),y)
  49. imageinstall: kernel-install $(FW_DIR)/$(ROOTFSTARBALL)
  50. else
  51. imageinstall: $(FW_DIR)/$(ROOTFSTARBALL)
  52. endif
  53. @echo "The RootFS tarball is: $(FW_DIR)/$(ROOTFSTARBALL)"
  54. ifeq ($(ADK_TARGET_SYSTEM_RASPBERRY_PI),y)
  55. @echo "Use following command to install it on SD card:"
  56. @echo "sudo ./scripts/install-rpi.sh /dev/sdb $(FW_DIR)/$(ROOTFSTARBALL)"
  57. endif
  58. ifeq ($(ADK_TARGET_SYSTEM_QEMU_ARM),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 +g 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),initramfs)
  68. imageinstall: $(FW_DIR)/$(INITRAMFS)
  69. @cp $(KERNEL) $(FW_DIR)/$(TARGET_KERNEL)
  70. @echo 'The kernel file is: $(FW_DIR)/${TARGET_KERNEL}'
  71. @echo 'The initramfs image is: ${FW_DIR}/${INITRAMFS}'
  72. ifeq ($(ADK_TARGET_SYSTEM_QEMU_ARM),y)
  73. ifeq ($(ADK_TARGET_QEMU_WITH_VIRTIO),y)
  74. @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'
  75. else
  76. @echo "Start qemu with following command line:"
  77. @echo 'qemu-system-arm -M $(MACH) -nographic $(NET) -kernel $(FW_DIR)/$(TARGET_KERNEL) -initrd ${FW_DIR}/${INITRAMFS}'
  78. endif
  79. endif
  80. endif
  81. ifeq ($(ADK_TARGET_FS),initramfs-piggyback)
  82. imageinstall: createinitramfs
  83. @cp $(KERNEL) $(FW_DIR)/$(TARGET_KERNEL)
  84. @echo 'The kernel+initramfs file is: $(FW_DIR)/${TARGET_KERNEL}'
  85. ifeq ($(ADK_TARGET_SYSTEM_QEMU_ARM),y)
  86. @echo "Start qemu with following command line:"
  87. @echo 'qemu-system-arm -M $(MACH) -nographic $(NET) -kernel $(FW_DIR)/$(TARGET_KERNEL)'
  88. endif
  89. endif