Makefile 4.0 KB

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