Makefile 2.8 KB

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