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