1
0

Makefile 3.7 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. ifeq ($(ADK_TARGET_SYSTEM_QEMU_PPC_MPC8544DS),y)
  21. QEMU_ARGS+=-M mpc8544ds
  22. QEMU_ARGS+=-device e1000,netdev=adk0 -netdev user,id=adk0
  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. ifeq ($(ADK_TARGET_SYSTEM_APPLE_MACMINI),y)
  63. @echo 'Use <alt-gr>-<win>-o-f to get into OpenFirmware on bootup, then type:'
  64. @echo ' 0 > boot enet:10.0.0.1,yaboot'
  65. @echo 'In yaboot type:'
  66. @echo ' boot: enet:'
  67. endif
  68. endif
  69. # image creation and kernel install
  70. kernel-strip:
  71. $(TARGET_CROSS)objcopy $(OSTRIP) -S $(KERNEL) $(BUILD_DIR)/$(TARGET_KERNEL)
  72. kernel-install: kernel-strip
  73. @cp $(BUILD_DIR)/$(TARGET_KERNEL) $(FW_DIR)/${TARGET_KERNEL}
  74. dtb-install:
  75. ifeq ($(ADK_TARGET_SYSTEM_QEMU_PPC_VIRTEX_ML507),y)
  76. env $(KERNEL_MAKE_ENV) $(MAKE) -C "${LINUX_DIR}" $(KERNEL_MAKE_OPTS) \
  77. -j${ADK_MAKE_JOBS} virtex440-ml507.dtb $(MAKE_TRACE)
  78. $(CP) $(LINUX_DIR)/arch/powerpc/boot/virtex440-ml507.dtb \
  79. $(FW_DIR)/ppc.dtb
  80. endif
  81. # filesystem specific targets
  82. ifeq ($(ADK_TARGET_FS),archive)
  83. imageinstall: dtb-install $(FW_DIR)/$(ROOTFSTARBALL) targethelp
  84. endif
  85. ifeq ($(ADK_TARGET_FS),initramfs)
  86. imageinstall: dtb-install kernel-install $(FW_DIR)/$(INITRAMFS) targethelp
  87. endif
  88. ifeq ($(ADK_TARGET_FS),initramfsarchive)
  89. imageinstall: kernel-install $(FW_DIR)/$(ROOTFSUSERTARBALL) targethelp
  90. endif
  91. ifeq ($(ADK_TARGET_FS),initramfspiggyback)
  92. imageinstall: dtb-install createinitramfs targethelp
  93. endif
  94. ifeq ($(ADK_TARGET_FS),nfsroot)
  95. imageinstall: kernel-install $(FW_DIR)/$(ROOTFSUSERTARBALL) targethelp
  96. endif