Makefile 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  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. ifeq ($(ADK_TARGET_KERNEL_UIMAGE),y)
  7. KERNEL:=$(LINUX_DIR)/arch/arc/boot/uImage
  8. else
  9. KERNEL:=$(LINUX_DIR)/$(ADK_TARGET_KERNEL)
  10. endif
  11. QEMU_ARGS:=-monitor none -serial stdio
  12. QEMU_ARGS+=${ADK_QEMU_ARGS}
  13. ifeq ($(ADK_TARGET_CPU_ARC_ARC700),y)
  14. QEMU_ARGS+=-cpu arc700
  15. endif
  16. ifeq ($(ADK_TARGET_CPU_ARC_ARCHS),y)
  17. QEMU_ARGS+=-cpu archs
  18. endif
  19. # target helper text
  20. ifeq ($(ADK_TARGET_FS),archive)
  21. targethelp:
  22. @echo "The RootFS tarball is: $(FW_DIR)/$(ROOTFSTARBALL)"
  23. endif
  24. ifeq ($(ADK_TARGET_FS),initramfs)
  25. targethelp:
  26. @echo 'The kernel file is: $(FW_DIR)/${TARGET_KERNEL}'
  27. @echo 'The initramfs image is: ${FW_DIR}/${INITRAMFS}'
  28. endif
  29. ifeq ($(ADK_TARGET_FS),initramfsarchive)
  30. targethelp:
  31. @echo 'The kernel file is: $(FW_DIR)/${TARGET_KERNEL}'
  32. @echo "The RootFS tarball is: $(FW_DIR)/$(ROOTFSUSERTARBALL)"
  33. endif
  34. ifeq ($(ADK_TARGET_FS),initramfspiggyback)
  35. targethelp:
  36. @echo 'The kernel+initramfs file is: $(FW_DIR)/${TARGET_KERNEL}'
  37. ifeq ($(ADK_TARGET_QEMU),y)
  38. @echo "Start qemu with following command line:"
  39. @echo 'qemu-system-${ADK_TARGET_CPU_ARCH} ${QEMU_ARGS} -kernel $(FW_DIR)/$(TARGET_KERNEL)'
  40. endif
  41. ifeq ($(ADK_TARGET_SYSTEM_SYNOPSYS_NSIM),y)
  42. ifeq ($(ADK_TARGET_LITTLE_ENDIAN),y)
  43. ifeq ($(ADK_TARGET_CPU_ARC_ARC700),y)
  44. @echo './scripts/nsim.sh arcv1 $(FW_DIR)/${TARGET_KERNEL}'
  45. endif
  46. ifeq ($(ADK_TARGET_CPU_ARC_ARCHS),y)
  47. @echo './scripts/nsim.sh arcv2 $(FW_DIR)/${TARGET_KERNEL}'
  48. endif
  49. endif
  50. ifeq ($(ADK_TARGET_BIG_ENDIAN),y)
  51. ifeq ($(ADK_TARGET_CPU_ARC_ARC700),y)
  52. @echo './scripts/nsim.sh arcv1-be $(FW_DIR)/${TARGET_KERNEL}'
  53. endif
  54. ifeq ($(ADK_TARGET_CPU_ARC_ARCHS),y)
  55. @echo './scripts/nsim.sh arcv2-be $(FW_DIR)/${TARGET_KERNEL}'
  56. endif
  57. endif
  58. endif
  59. endif
  60. ifeq ($(ADK_TARGET_FS),nfsroot)
  61. targethelp:
  62. @echo 'The kernel file is: $(FW_DIR)/${TARGET_KERNEL}'
  63. @echo "The RootFS tarball is: $(FW_DIR)/$(ROOTFSUSERTARBALL)"
  64. endif
  65. kernel-strip:
  66. @cp $(KERNEL) $(BUILD_DIR)/$(TARGET_KERNEL)
  67. kernel-install: kernel-strip
  68. @cp $(BUILD_DIR)/$(TARGET_KERNEL) $(FW_DIR)/$(TARGET_KERNEL)
  69. # filesystem specific targets
  70. ifeq ($(ADK_TARGET_FS),archive)
  71. imageinstall: $(FW_DIR)/$(ROOTFSTARBALL) targethelp
  72. endif
  73. ifeq ($(ADK_TARGET_FS),initramfs)
  74. imageinstall: kernel-install $(FW_DIR)/$(INITRAMFS) targethelp
  75. endif
  76. ifeq ($(ADK_TARGET_FS),initramfsarchive)
  77. imageinstall: kernel-install $(FW_DIR)/$(ROOTFSUSERTARBALL) targethelp
  78. endif
  79. ifeq ($(ADK_TARGET_FS),initramfspiggyback)
  80. imageinstall: createinitramfs targethelp
  81. endif
  82. ifeq ($(ADK_TARGET_FS),nfsroot)
  83. imageinstall: kernel-install $(FW_DIR)/$(ROOTFSUSERTARBALL) targethelp
  84. endif