Makefile 2.8 KB

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