Makefile 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  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),yaffs)
  27. targethelp:
  28. @echo 'The root tarball is: ${FW_DIR}/${ROOTFSTARBALL}'
  29. @echo 'Format your NAND with Routerboot, boot via NFS and'
  30. @echo 'then install kernel and filesystem via:'
  31. @echo 'adkinstall ${ROOTFSTARBALL}'
  32. endif
  33. ifeq ($(ADK_TARGET_FS),usb)
  34. targethelp:
  35. @echo 'The root tarball is: ${FW_DIR}/${ROOTFSTARBALL}'
  36. ifeq ($(ADK_TARGET_SYSTEM_LEMOTE_YEELONG),y)
  37. @echo "Startup the netbook and type del to enter PMON:"
  38. @echo "PMON> load /dev/fs/ext2@usb0/boot/kernel"
  39. @echo "PMON> g"
  40. endif
  41. endif
  42. ifeq ($(ADK_TARGET_FS),archive)
  43. targethelp:
  44. @echo "The RootFS tarball is: $(FW_DIR)/$(ROOTFSTARBALL)"
  45. ifeq ($(ADK_TARGET_QEMU),y)
  46. @echo 'The kernel file is: $(FW_DIR)/${TARGET_KERNEL}'
  47. @echo "Use following command to create a QEMU Image:"
  48. @echo "./scripts/create.sh qemu-${ADK_TARGET_CPU_ARCH}.img $(FW_DIR)/$(ROOTFSTARBALL)"
  49. @echo "Start qemu with following options:"
  50. @echo 'qemu-system-${ADK_TARGET_CPU_ARCH} ${QEMU_ARGS} -kernel $(FW_DIR)/$(TARGET_KERNEL) qemu-${ADK_TARGET_CPU_ARCH}.img'
  51. endif
  52. ifeq ($(ADK_TARGET_SYSTEM_LEMOTE_YEELONG),y)
  53. @echo "Startup the Lemote Yeelong and type del to enter PMON:"
  54. @echo "PMON> load /dev/fs/ext2@wd0a/boot/kernel"
  55. @echo "PMON> g root=/dev/sda1"
  56. endif
  57. endif
  58. ifeq ($(ADK_TARGET_FS),initramfsarchive)
  59. targethelp:
  60. @echo 'The kernel file is: $(FW_DIR)/${TARGET_KERNEL}'
  61. @echo "The RootFS tarball is: $(FW_DIR)/$(ROOTFSUSERTARBALL)"
  62. endif
  63. ifeq ($(ADK_TARGET_FS),initramfs)
  64. targethelp:
  65. @echo 'The kernel file is: $(FW_DIR)/${TARGET_KERNEL}'
  66. @echo 'The initramfs image is: ${FW_DIR}/${INITRAMFS}'
  67. ifeq ($(ADK_TARGET_QEMU),y)
  68. @echo "Start qemu with following command line:"
  69. @echo 'qemu-system-${ADK_TARGET_CPU_ARCH} ${QEMU_ARGS} -kernel $(FW_DIR)/$(TARGET_KERNEL) -initrd ${FW_DIR}/${INITRAMFS}'
  70. endif
  71. endif
  72. ifeq ($(ADK_TARGET_FS),initramfspiggyback)
  73. targethelp:
  74. @echo 'The kernel+initramfs file is: $(FW_DIR)/${TARGET_KERNEL}'
  75. ifeq ($(ADK_TARGET_QEMU),y)
  76. @echo "Start qemu with following command line:"
  77. @echo 'qemu-system-${ADK_TARGET_CPU_ARCH} ${QEMU_ARGS} -kernel $(FW_DIR)/$(TARGET_KERNEL)'
  78. endif
  79. endif
  80. # image creation and kernel install
  81. kernel-strip:
  82. $(TARGET_CROSS)objcopy $(OSTRIP) -S $(KERNEL) $(BUILD_DIR)/$(TARGET_KERNEL)
  83. kernel-install: kernel-strip
  84. @cp $(BUILD_DIR)/$(TARGET_KERNEL) $(FW_DIR)/${TARGET_KERNEL}
  85. # filesystem specific targets
  86. ifeq ($(ADK_TARGET_FS),nfsroot)
  87. imageinstall: kernel-install $(FW_DIR)/$(ROOTFSUSERTARBALL) targethelp
  88. endif
  89. ifeq ($(ADK_TARGET_FS),archive)
  90. imageinstall: $(FW_DIR)/$(ROOTFSTARBALL) targethelp
  91. endif
  92. ifeq ($(ADK_TARGET_FS),initramfsarchive)
  93. imageinstall: kernel-install $(FW_DIR)/$(ROOTFSUSERTARBALL) targethelp
  94. endif
  95. ifeq ($(ADK_TARGET_FS),initramfs)
  96. imageinstall: kernel-install $(FW_DIR)/$(INITRAMFS) targethelp
  97. endif
  98. ifeq ($(ADK_TARGET_FS),initramfspiggyback)
  99. imageinstall: createinitramfs targethelp
  100. endif
  101. ifeq ($(ADK_TARGET_FS),usb)
  102. imageinstall: $(FW_DIR)/$(ROOTFSTARBALL) targethelp
  103. endif