1
0

Makefile 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  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)/vmlinux
  7. OSTRIP:=-R .reginfo -R .notes -R .note -R .comment -R .mdebug -R .note.gnu.build-id
  8. QEMU_ARGS:=${ADK_QEMU_ARGS}
  9. ifeq ($(ADK_TARGET_SYSTEM_QEMU_PPC_MACPPC),y)
  10. QEMU_ARGS+=-M mac99
  11. QEMU_ARGS+=-device e1000,netdev=adk0 -netdev user,id=adk0
  12. endif
  13. ifeq ($(ADK_TARGET_SYSTEM_QEMU_PPC_VIRTEX_ML507),y)
  14. QEMU_ARGS+=-M virtex-ml507 -m 256 -dtb $(FW_DIR)/ppc.dtb
  15. endif
  16. ifeq ($(ADK_TARGET_SYSTEM_QEMU_PPC_BAMBOO),y)
  17. QEMU_ARGS+=-M bamboo
  18. QEMU_ARGS+=-device e1000,netdev=adk0 -netdev user,id=adk0
  19. endif
  20. # target helper text
  21. ifeq ($(ADK_TARGET_FS),archive)
  22. targethelp:
  23. @echo "The RootFS tarball is: $(FW_DIR)/$(ROOTFSTARBALL)"
  24. ifeq ($(ADK_TARGET_QEMU),y)
  25. @echo 'The kernel file is: $(FW_DIR)/${TARGET_KERNEL}'
  26. @echo "Use following command to create a QEMU Image:"
  27. @echo "./scripts/create.sh qemu-${ADK_TARGET_CPU_ARCH}.img $(FW_DIR)/$(ROOTFSTARBALL)"
  28. @echo "Start qemu with following options:"
  29. @echo 'qemu-system-${ADK_TARGET_CPU_ARCH} ${QEMU_ARGS} -kernel $(FW_DIR)/$(TARGET_KERNEL) qemu-${ADK_TARGET_CPU_ARCH}.img'
  30. endif
  31. endif
  32. ifeq ($(ADK_TARGET_FS),initramfs)
  33. targethelp:
  34. @echo 'The kernel file is: $(FW_DIR)/${TARGET_KERNEL}'
  35. @echo 'The initramfs image is: ${FW_DIR}/${INITRAMFS}'
  36. ifeq ($(ADK_TARGET_QEMU),y)
  37. @echo "Start qemu with following command line:"
  38. @echo 'qemu-system-${ADK_TARGET_CPU_ARCH} ${QEMU_ARGS} -kernel $(FW_DIR)/$(TARGET_KERNEL) -initrd ${FW_DIR}/${INITRAMFS}'
  39. endif
  40. endif
  41. ifeq ($(ADK_TARGET_FS),initramfsarchive)
  42. targethelp:
  43. @echo 'The kernel file is: $(FW_DIR)/${TARGET_KERNEL}'
  44. @echo "The RootFS tarball is: $(FW_DIR)/$(ROOTFSUSERTARBALL)"
  45. endif
  46. ifeq ($(ADK_TARGET_FS),initramfspiggyback)
  47. targethelp:
  48. @echo 'The kernel+initramfs file is: $(FW_DIR)/${TARGET_KERNEL}'
  49. ifeq ($(ADK_TARGET_QEMU),y)
  50. @echo "Start qemu with following command line:"
  51. @echo 'qemu-system-${ADK_TARGET_CPU_ARCH} ${QEMU_ARGS} -kernel $(FW_DIR)/$(TARGET_KERNEL)'
  52. endif
  53. endif
  54. ifeq ($(ADK_TARGET_FS),nfsroot)
  55. targethelp:
  56. @echo 'The kernel file is: $(FW_DIR)/${TARGET_KERNEL}'
  57. @echo "The RootFS tarball is: $(FW_DIR)/$(ROOTFSUSERTARBALL)"
  58. endif
  59. # image creation and kernel install
  60. kernel-strip:
  61. $(TARGET_CROSS)objcopy $(OSTRIP) -S $(KERNEL) $(BUILD_DIR)/$(TARGET_KERNEL)
  62. kernel-install: kernel-strip
  63. @cp $(BUILD_DIR)/$(TARGET_KERNEL) $(FW_DIR)/${TARGET_KERNEL}
  64. dtb-install:
  65. env $(KERNEL_MAKE_ENV) $(MAKE) -C "${LINUX_DIR}" $(KERNEL_MAKE_OPTS) \
  66. -j${ADK_MAKE_JOBS} virtex440-ml507.dtb $(MAKE_TRACE)
  67. $(CP) $(LINUX_DIR)/arch/powerpc/boot/virtex440-ml507.dtb \
  68. $(FW_DIR)/ppc.dtb
  69. # filesystem specific targets
  70. ifeq ($(ADK_TARGET_FS),archive)
  71. ifeq ($(ADK_TARGET_SYSTEM_QEMU_PPC_VIRTEX_ML507),y)
  72. imageinstall: dtb-install $(FW_DIR)/$(ROOTFSTARBALL) targethelp
  73. else
  74. imageinstall: $(FW_DIR)/$(ROOTFSTARBALL) targethelp
  75. endif
  76. endif
  77. ifeq ($(ADK_TARGET_FS),initramfs)
  78. ifeq ($(ADK_TARGET_SYSTEM_QEMU_PPC_VIRTEX_ML507),y)
  79. imageinstall: dtb-install kernel-install $(FW_DIR)/$(INITRAMFS) targethelp
  80. else
  81. imageinstall: kernel-install $(FW_DIR)/$(INITRAMFS) targethelp
  82. endif
  83. endif
  84. ifeq ($(ADK_TARGET_FS),initramfsarchive)
  85. imageinstall: kernel-install $(FW_DIR)/$(ROOTFSUSERTARBALL) targethelp
  86. endif
  87. ifeq ($(ADK_TARGET_FS),initramfspiggyback)
  88. ifeq ($(ADK_TARGET_SYSTEM_QEMU_PPC_VIRTEX_ML507),y)
  89. imageinstall: dtb-install createinitramfs targethelp
  90. else
  91. imageinstall: createinitramfs targethelp
  92. endif
  93. endif
  94. ifeq ($(ADK_TARGET_FS),nfsroot)
  95. imageinstall: kernel-install $(FW_DIR)/$(ROOTFSUSERTARBALL) targethelp
  96. endif