Makefile 3.8 KB

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