Makefile 3.8 KB

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