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