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)/$(ADK_TARGET_KERNEL)
  7. OSTRIP:=-R .reginfo -R .notes -R .note -R .comment -R .mdebug -R .note.gnu.build-id
  8. QEMU_ARGS:=-M malta
  9. QEMU_ARGS+=${ADK_QEMU_ARGS}
  10. QEMU_ARGS+=-device e1000,netdev=adk0 -netdev user,id=adk0
  11. ifeq ($(ADK_TARGET_CPU_MIPS64_MIPS64R6),y)
  12. QEMU_ARGS+=-cpu I6400
  13. endif
  14. # target helper text
  15. ifeq ($(ADK_TARGET_FS),nfsroot)
  16. targethelp:
  17. @echo 'The kernel file is: $(FW_DIR)/${TARGET_KERNEL}'
  18. @echo 'The nfs root tarball is: ${FW_DIR}/${ROOTFSUSERTARBALL}'
  19. ifeq ($(ADK_TARGET_SYSTEM_LEMOTE_YEELONG),y)
  20. @echo 'Boot your Lemote Yeelong and type following commands in PMON:'
  21. @echo 'PMON> ifaddr rtl0 <ip-address-client>'
  22. @echo 'PMON> load tftp://<ip-address-server>/${TARGET_KERNEL}'
  23. @echo 'PMON> g'
  24. endif
  25. endif
  26. ifeq ($(ADK_TARGET_FS),usb)
  27. targethelp:
  28. @echo 'The root tarball is: ${FW_DIR}/${ROOTFSTARBALL}'
  29. ifeq ($(ADK_TARGET_SYSTEM_LEMOTE_YEELONG),y)
  30. @echo "Startup the netbook and type del to enter PMON:"
  31. @echo "PMON> load /dev/fs/ext2@usb0/boot/kernel"
  32. @echo "PMON> g"
  33. endif
  34. endif
  35. ifeq ($(ADK_TARGET_FS),archive)
  36. targethelp:
  37. @echo "The RootFS tarball is: $(FW_DIR)/$(ROOTFSTARBALL)"
  38. ifeq ($(ADK_TARGET_QEMU),y)
  39. @echo 'The kernel file is: $(FW_DIR)/${TARGET_KERNEL}'
  40. @echo "Use following command to create a QEMU Image:"
  41. @echo "./scripts/create.sh qemu-${ADK_TARGET_CPU_ARCH}.img $(FW_DIR)/$(ROOTFSTARBALL)"
  42. @echo "Start qemu with following options:"
  43. @echo 'qemu-system-${ADK_TARGET_CPU_ARCH} ${QEMU_ARGS} -kernel $(FW_DIR)/$(TARGET_KERNEL) qemu-${ADK_TARGET_CPU_ARCH}.img'
  44. endif
  45. ifeq ($(ADK_TARGET_SYSTEM_LEMOTE_YEELONG),y)
  46. @echo "Startup the Lemote Yeelong and type del to enter PMON:"
  47. @echo "PMON> load /dev/fs/ext2@wd0a/boot/kernel"
  48. @echo "PMON> g root=/dev/sda1"
  49. endif
  50. endif
  51. ifeq ($(ADK_TARGET_FS),initramfsarchive)
  52. targethelp:
  53. @echo 'The kernel file is: $(FW_DIR)/${TARGET_KERNEL}'
  54. @echo "The RootFS tarball is: $(FW_DIR)/$(ROOTFSUSERTARBALL)"
  55. endif
  56. ifeq ($(ADK_TARGET_FS),initramfs)
  57. targethelp:
  58. @echo 'The kernel file is: $(FW_DIR)/${TARGET_KERNEL}'
  59. @echo 'The initramfs image is: ${FW_DIR}/${INITRAMFS}'
  60. ifeq ($(ADK_TARGET_QEMU),y)
  61. @echo "Start qemu with following command line:"
  62. @echo 'qemu-system-${ADK_TARGET_CPU_ARCH} ${QEMU_ARGS} -kernel $(FW_DIR)/$(TARGET_KERNEL) -initrd ${FW_DIR}/${INITRAMFS}'
  63. endif
  64. endif
  65. ifeq ($(ADK_TARGET_FS),initramfspiggyback)
  66. targethelp:
  67. @echo 'The kernel+initramfs file is: $(FW_DIR)/${TARGET_KERNEL}'
  68. ifeq ($(ADK_TARGET_QEMU),y)
  69. @echo "Start qemu with following command line:"
  70. @echo 'qemu-system-${ADK_TARGET_CPU_ARCH} ${QEMU_ARGS} -kernel $(FW_DIR)/$(TARGET_KERNEL)'
  71. endif
  72. endif
  73. # image creation and kernel install
  74. kernel-strip:
  75. $(TARGET_CROSS)objcopy $(OSTRIP) -S $(KERNEL) $(BUILD_DIR)/$(TARGET_KERNEL)
  76. kernel-install: kernel-strip
  77. @cp $(BUILD_DIR)/$(TARGET_KERNEL) $(FW_DIR)/${TARGET_KERNEL}
  78. # filesystem specific targets
  79. ifeq ($(ADK_TARGET_FS),nfsroot)
  80. imageinstall: kernel-install $(FW_DIR)/$(ROOTFSUSERTARBALL) targethelp
  81. endif
  82. ifeq ($(ADK_TARGET_FS),archive)
  83. imageinstall: $(FW_DIR)/$(ROOTFSTARBALL) targethelp
  84. endif
  85. ifeq ($(ADK_TARGET_FS),initramfsarchive)
  86. imageinstall: kernel-install $(FW_DIR)/$(ROOTFSUSERTARBALL) targethelp
  87. endif
  88. ifeq ($(ADK_TARGET_FS),initramfs)
  89. imageinstall: kernel-install $(FW_DIR)/$(INITRAMFS) targethelp
  90. endif
  91. ifeq ($(ADK_TARGET_FS),initramfspiggyback)
  92. imageinstall: createinitramfs targethelp
  93. endif
  94. ifeq ($(ADK_TARGET_FS),usb)
  95. imageinstall: $(FW_DIR)/$(ROOTFSTARBALL) targethelp
  96. endif