Makefile 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  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 $(ADK_TOPDIR)/rules.mk
  4. include $(ADK_TOPDIR)/mk/kernel-build.mk
  5. include $(ADK_TOPDIR)/mk/image.mk
  6. KERNEL:=$(LINUX_DIR)/$(ADK_TARGET_KERNEL)
  7. ifeq ($(ADK_TARGET_KERNEL_UIMAGE),y)
  8. KERNEL:=$(LINUX_DIR)/arch/arc/boot/uImage
  9. endif
  10. ifeq ($(ADK_TARGET_KERNEL_LOADER),y)
  11. KERNEL:=$(LINUX_DIR)/arch/arc/boot/loader
  12. endif
  13. QEMU_ARGS:=-monitor none -serial stdio
  14. QEMU_ARGS+=-netdev user,id=eth0 -device virtio-net-device,netdev=eth0
  15. QEMU_ARGS+=${ADK_QEMU_ARGS}
  16. ifeq ($(ADK_TARGET_CPU_ARC_ARC700),y)
  17. QEMU:=qemu-system-arc
  18. QEMU_ARGS+=-cpu arc700
  19. endif
  20. ifeq ($(ADK_TARGET_CPU_ARC_ARCHS),y)
  21. QEMU:=qemu-system-arc
  22. QEMU_ARGS+=-cpu archs
  23. endif
  24. ifeq ($(ADK_TARGET_CPU_ARC_ARC32),y)
  25. QEMU:=qemu-system-arc
  26. QEMU_ARGS+=-cpu hs5x -M virt,ram_start=0
  27. endif
  28. ifeq ($(ADK_TARGET_CPU_ARC_ARC64),y)
  29. QEMU:=qemu-system-arc64
  30. QEMU_ARGS+=-cpu hs6x -M virt,ram_start=0
  31. endif
  32. # target helper text
  33. ifeq ($(ADK_TARGET_FS),archive)
  34. targethelp:
  35. @echo "The RootFS tarball is: $(FW_DIR)/$(ROOTFSTARBALL)"
  36. endif
  37. ifeq ($(ADK_TARGET_FS),initramfs)
  38. targethelp:
  39. @echo 'The kernel file is: $(FW_DIR)/${TARGET_KERNEL}'
  40. @echo 'The initramfs image is: ${FW_DIR}/${INITRAMFS}'
  41. endif
  42. ifeq ($(ADK_TARGET_FS),initramfsarchive)
  43. targethelp:
  44. @echo 'The kernel file is: $(FW_DIR)/${TARGET_KERNEL}'
  45. @echo "The RootFS tarball is: $(FW_DIR)/$(ROOTFSUSERTARBALL)"
  46. endif
  47. ifeq ($(ADK_TARGET_FS),initramfspiggyback)
  48. targethelp:
  49. @echo 'The kernel+initramfs file is: $(FW_DIR)/${TARGET_KERNEL}'
  50. ifeq ($(ADK_TARGET_QEMU),y)
  51. @echo "Start qemu with following command line:"
  52. @echo '${QEMU} ${QEMU_ARGS} -kernel $(FW_DIR)/$(TARGET_KERNEL)'
  53. endif
  54. ifeq ($(ADK_TARGET_SYSTEM_SYNOPSYS_NSIM),y)
  55. ifeq ($(ADK_TARGET_LITTLE_ENDIAN),y)
  56. ifeq ($(ADK_TARGET_CPU_ARC_ARC700),y)
  57. @echo './scripts/nsim.sh arcv1 $(FW_DIR)/${TARGET_KERNEL}'
  58. endif
  59. ifeq ($(ADK_TARGET_CPU_ARC_ARCHS),y)
  60. @echo './scripts/nsim.sh arcv2 $(FW_DIR)/${TARGET_KERNEL}'
  61. endif
  62. endif
  63. ifeq ($(ADK_TARGET_BIG_ENDIAN),y)
  64. ifeq ($(ADK_TARGET_CPU_ARC_ARC700),y)
  65. @echo './scripts/nsim.sh arcv1-be $(FW_DIR)/${TARGET_KERNEL}'
  66. endif
  67. ifeq ($(ADK_TARGET_CPU_ARC_ARCHS),y)
  68. @echo './scripts/nsim.sh arcv2-be $(FW_DIR)/${TARGET_KERNEL}'
  69. endif
  70. endif
  71. endif
  72. endif
  73. ifeq ($(ADK_TARGET_FS),nfsroot)
  74. targethelp:
  75. @echo 'The kernel file is: $(FW_DIR)/${TARGET_KERNEL}'
  76. @echo "The RootFS tarball is: $(FW_DIR)/$(ROOTFSUSERTARBALL)"
  77. endif
  78. kernel-strip:
  79. @cp $(KERNEL) $(BUILD_DIR)/$(TARGET_KERNEL)
  80. kernel-install: kernel-strip
  81. @cp $(BUILD_DIR)/$(TARGET_KERNEL) $(FW_DIR)/$(TARGET_KERNEL)
  82. # filesystem specific targets
  83. ifeq ($(ADK_TARGET_FS),archive)
  84. imageinstall: $(FW_DIR)/$(ROOTFSTARBALL) targethelp
  85. endif
  86. ifeq ($(ADK_TARGET_FS),initramfs)
  87. imageinstall: kernel-install $(FW_DIR)/$(INITRAMFS) targethelp
  88. endif
  89. ifeq ($(ADK_TARGET_FS),initramfsarchive)
  90. imageinstall: kernel-install $(FW_DIR)/$(ROOTFSUSERTARBALL) targethelp
  91. endif
  92. ifeq ($(ADK_TARGET_FS),initramfspiggyback)
  93. imageinstall: createinitramfs targethelp
  94. endif
  95. ifeq ($(ADK_TARGET_FS),nfsroot)
  96. imageinstall: kernel-install $(FW_DIR)/$(ROOTFSUSERTARBALL) targethelp
  97. endif