Makefile 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  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 mac99
  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. ifeq ($(ADK_TARGET_QEMU_PPC_BAMBOO),y)
  19. QEMU_ARGS+=-M bamboo
  20. QEMU_ARGS+=-device e1000,netdev=adk0 -netdev user,id=adk0
  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. # image creation and kernel install
  62. kernel-strip:
  63. $(TARGET_CROSS)objcopy $(OSTRIP) -S $(KERNEL) $(BUILD_DIR)/$(TARGET_KERNEL)
  64. kernel-install: kernel-strip
  65. @cp $(BUILD_DIR)/$(TARGET_KERNEL) $(FW_DIR)/${TARGET_KERNEL}
  66. dtb-install:
  67. env $(KERNEL_MAKE_ENV) $(MAKE) $(KERNEL_MAKE_OPTS) \
  68. -j${ADK_MAKE_JOBS} virtex440-ml507.dtb $(MAKE_TRACE)
  69. $(CP) $(LINUX_DIR)/arch/powerpc/boot/virtex440-ml507.dtb \
  70. $(FW_DIR)/ppc.dtb
  71. # filesystem specific targets
  72. ifeq ($(ADK_TARGET_FS),archive)
  73. ifeq ($(ADK_TARGET_QEMU_PPC_VIRTEX_ML507),y)
  74. imageinstall: dtb-install $(FW_DIR)/$(ROOTFSTARBALL) targethelp
  75. else
  76. imageinstall: $(FW_DIR)/$(ROOTFSTARBALL) targethelp
  77. endif
  78. endif
  79. ifeq ($(ADK_TARGET_FS),initramfs)
  80. ifeq ($(ADK_TARGET_QEMU_PPC_VIRTEX_ML507),y)
  81. imageinstall: dtb-install kernel-install $(FW_DIR)/$(INITRAMFS) targethelp
  82. else
  83. imageinstall: kernel-install $(FW_DIR)/$(INITRAMFS) targethelp
  84. endif
  85. endif
  86. ifeq ($(ADK_TARGET_FS),initramfsarchive)
  87. imageinstall: kernel-install $(FW_DIR)/$(ROOTFSUSERTARBALL) targethelp
  88. endif
  89. ifeq ($(ADK_TARGET_FS),initramfspiggyback)
  90. ifeq ($(ADK_TARGET_QEMU_PPC_VIRTEX_ML507),y)
  91. imageinstall: dtb-install createinitramfs targethelp
  92. else
  93. imageinstall: createinitramfs targethelp
  94. endif
  95. endif
  96. ifeq ($(ADK_TARGET_FS),nfsroot)
  97. imageinstall: kernel-install $(FW_DIR)/$(ROOTFSUSERTARBALL) targethelp
  98. endif