Makefile 3.2 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.mk
  5. include $(ADK_TOPDIR)/mk/modules.mk
  6. include $(ADK_TOPDIR)/mk/kernel-build.mk
  7. include $(ADK_TOPDIR)/mk/image.mk
  8. KERNEL:=$(LINUX_DIR)/vmlinux
  9. OSTRIP:=-R .reginfo -R .notes -R .note -R .comment -R .mdebug -R .note.gnu.build-id
  10. QEMU_ARGS:=${ADK_QEMU_ARGS}
  11. ifeq ($(ADK_TARGET_QEMU_PPC_MACPPC),y)
  12. QEMU_ARGS+=-M macppc
  13. QEMU_ARGS+=-device e1000,netdev=adk0 -netdev user,id=adk0
  14. endif
  15. ifeq ($(ADK_TARGET_QEMU_PPC_VIRTEX_ML507),y)
  16. QEMU_ARGS+=-M virtex-ml507 -m 256 -dtb $(FW_DIR)/ppc.dtb
  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. # image creation and kernel install
  53. kernel-strip:
  54. $(TARGET_CROSS)objcopy $(OSTRIP) -S $(KERNEL) $(BUILD_DIR)/$(TARGET_KERNEL)
  55. kernel-install: kernel-strip
  56. @cp $(BUILD_DIR)/$(TARGET_KERNEL) $(FW_DIR)/${TARGET_KERNEL}
  57. dtb-install:
  58. env $(KERNEL_MAKE_ENV) $(MAKE) -C $(LINUX_DIR) $(KERNEL_MAKE_OPTS) \
  59. -j${ADK_MAKE_JOBS} virtex440-ml507.dtb $(MAKE_TRACE)
  60. $(CP) $(LINUX_DIR)/arch/powerpc/boot/virtex440-ml507.dtb \
  61. $(FW_DIR)/ppc.dtb
  62. # filesystem specific targets
  63. ifeq ($(ADK_TARGET_FS),archive)
  64. ifeq ($(ADK_TARGET_QEMU_PPC_VIRTEX_ML507),y)
  65. imageinstall: dtb-install $(FW_DIR)/$(ROOTFSTARBALL) targethelp
  66. else
  67. imageinstall: $(FW_DIR)/$(ROOTFSTARBALL) targethelp
  68. endif
  69. endif
  70. ifeq ($(ADK_TARGET_FS),initramfs)
  71. ifeq ($(ADK_TARGET_QEMU_PPC_VIRTEX_ML507),y)
  72. imageinstall: dtb-install kernel-install $(FW_DIR)/$(INITRAMFS) targethelp
  73. else
  74. imageinstall: kernel-install $(FW_DIR)/$(INITRAMFS) targethelp
  75. endif
  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. ifeq ($(ADK_TARGET_QEMU_PPC_VIRTEX_ML507),y)
  82. imageinstall: dtb-install createinitramfs targethelp
  83. else
  84. imageinstall: createinitramfs targethelp
  85. endif
  86. endif