Makefile 3.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  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. QEMU_ARGS:=${ADK_QEMU_ARGS}
  7. ifeq ($(ADK_TARGET_CPU_XTENSA_DC233C),y)
  8. QEMU_ARGS+=-M lx60
  9. QEMU_ARGS+=-cpu dc233c -m 128
  10. KERNEL:=$(LINUX_DIR)/arch/xtensa/boot/Image.elf
  11. endif
  12. ifeq ($(ADK_TARGET_CPU_XTENSA_DC232B),y)
  13. QEMU_ARGS+=-M kc705
  14. QEMU_ARGS+=-cpu dc232b
  15. KERNEL:=$(LINUX_DIR)/arch/xtensa/boot/uImage
  16. endif
  17. ifeq ($(ADK_TARGET_CPU_XTENSA_DE212),y)
  18. QEMU_ARGS+=-M kc705-nommu
  19. QEMU_ARGS+=-cpu de212 -m 256
  20. KERNEL:=$(LINUX_DIR)/arch/xtensa/boot/Image.elf
  21. endif
  22. ifeq ($(ADK_TARGET_CPU_XTENSA_KC705_BE),y)
  23. KERNEL:=$(LINUX_DIR)/arch/xtensa/boot/uImage
  24. endif
  25. # target helper text
  26. ifeq ($(ADK_TARGET_FS),archive)
  27. targethelp:
  28. @echo "The RootFS tarball is: $(FW_DIR)/$(ROOTFSTARBALL)"
  29. ifeq ($(ADK_TARGET_QEMU),y)
  30. @echo 'The kernel file is: $(FW_DIR)/${TARGET_KERNEL}'
  31. @echo "Use following command to create a QEMU Image:"
  32. @echo "./scripts/create.sh qemu-${ADK_TARGET_CPU_ARCH}.img $(FW_DIR)/$(ROOTFSTARBALL)"
  33. @echo "Start qemu with following options:"
  34. @echo 'qemu-system-${ADK_TARGET_CPU_ARCH} ${QEMU_ARGS} -kernel $(FW_DIR)/$(TARGET_KERNEL) qemu-${ADK_TARGET_CPU_ARCH}.img'
  35. endif
  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. ifeq ($(ADK_TARGET_QEMU),y)
  42. @echo "Start qemu with following command line:"
  43. @echo 'qemu-system-${ADK_TARGET_CPU_ARCH} ${QEMU_ARGS} -kernel $(FW_DIR)/$(TARGET_KERNEL) -initrd ${FW_DIR}/${INITRAMFS}'
  44. endif
  45. endif
  46. ifeq ($(ADK_TARGET_FS),initramfsarchive)
  47. targethelp:
  48. @echo 'The kernel file is: $(FW_DIR)/${TARGET_KERNEL}'
  49. @echo "The RootFS tarball is: $(FW_DIR)/$(ROOTFSUSERTARBALL)"
  50. endif
  51. ifeq ($(ADK_TARGET_FS),initramfspiggyback)
  52. targethelp:
  53. @echo 'The kernel+initramfs file is: $(FW_DIR)/${TARGET_KERNEL}'
  54. ifeq ($(ADK_TARGET_QEMU),y)
  55. @echo "Start qemu with following command line:"
  56. @echo 'qemu-system-${ADK_TARGET_CPU_ARCH} ${QEMU_ARGS} -kernel $(FW_DIR)/$(TARGET_KERNEL)'
  57. endif
  58. endif
  59. ifeq ($(ADK_TARGET_FS),nfsroot)
  60. targethelp:
  61. @echo 'The kernel file is: $(FW_DIR)/${TARGET_KERNEL}'
  62. @echo "The RootFS tarball is: $(FW_DIR)/$(ROOTFSUSERTARBALL)"
  63. endif
  64. kernel-strip:
  65. @cp $(KERNEL) $(BUILD_DIR)/$(TARGET_KERNEL)
  66. kernel-install: kernel-strip
  67. @cp $(BUILD_DIR)/$(TARGET_KERNEL) $(FW_DIR)/$(TARGET_KERNEL)
  68. # filesystem specific targets
  69. ifeq ($(ADK_TARGET_FS),archive)
  70. imageinstall: $(FW_DIR)/$(ROOTFSTARBALL) targethelp
  71. endif
  72. ifeq ($(ADK_TARGET_FS),initramfs)
  73. imageinstall: kernel-install $(FW_DIR)/$(INITRAMFS) targethelp
  74. endif
  75. ifeq ($(ADK_TARGET_FS),initramfsarchive)
  76. imageinstall: kernel-install $(FW_DIR)/$(ROOTFSUSERTARBALL) targethelp
  77. endif
  78. ifeq ($(ADK_TARGET_FS),initramfspiggyback)
  79. imageinstall: createinitramfs targethelp
  80. endif
  81. ifeq ($(ADK_TARGET_FS),nfsroot)
  82. imageinstall: kernel-install $(FW_DIR)/$(ROOTFSUSERTARBALL) targethelp
  83. endif