Makefile 2.6 KB

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