Makefile 3.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  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. ifeq ($(ADK_TARGET_SYSTEM_FOXBOARD_LX832),y)
  7. KERNEL:=$(LINUX_DIR)/arch/cris/boot/zImage
  8. else
  9. KERNEL:=$(LINUX_DIR)/arch/cris/boot/Image
  10. QEMU_ARGS:=-M axis-dev88 -nographic -monitor none
  11. endif
  12. # target helper text
  13. ifeq ($(ADK_TARGET_FS),archive)
  14. targethelp:
  15. @echo "The RootFS tarball is: $(FW_DIR)/$(ROOTFSTARBALL)"
  16. endif
  17. ifeq ($(ADK_TARGET_FS),initramfs)
  18. targethelp:
  19. @echo 'The kernel file is: $(FW_DIR)/${TARGET_KERNEL}'
  20. @echo 'The initramfs image is: ${FW_DIR}/${INITRAMFS}'
  21. ifeq ($(ADK_TARGET_QEMU),y)
  22. @echo "Start qemu with following command line:"
  23. @echo 'qemu-system-${ADK_TARGET_ARCH} ${QEMU_ARGS} -kernel $(FW_DIR)/$(TARGET_KERNEL) -initrd ${FW_DIR}/${INITRAMFS}'
  24. endif
  25. endif
  26. ifeq ($(ADK_TARGET_FS),initramfsarchive)
  27. targethelp:
  28. @echo 'The kernel file is: $(FW_DIR)/${TARGET_KERNEL}'
  29. @echo "The RootFS tarball is: $(FW_DIR)/$(ROOTFSUSERTARBALL)"
  30. endif
  31. ifeq ($(ADK_TARGET_FS),initramfspiggyback)
  32. targethelp:
  33. @echo 'The kernel+initramfs file is: $(FW_DIR)/${TARGET_KERNEL}'
  34. ifeq ($(ADK_TARGET_QEMU),y)
  35. @echo "Start qemu with following command line:"
  36. @echo 'qemu-system-${ADK_TARGET_ARCH} ${QEMU_ARGS} -kernel $(FW_DIR)/$(TARGET_KERNEL)'
  37. endif
  38. endif
  39. ifeq ($(ADK_TARGET_FS),nfsroot)
  40. targethelp:
  41. @echo 'The kernel file is: $(FW_DIR)/${TARGET_KERNEL}'
  42. @echo "The RootFS tarball is: $(FW_DIR)/$(ROOTFSUSERTARBALL)"
  43. @echo "Use following command to flash the kernel:"
  44. @echo "cd $(STAGING_HOST_DIR)/usr/bin && sudo ./boot_linux -F -i $(FW_DIR)/${TARGET_KERNEL}"
  45. @echo Do not forget to set network boot jumper, before you start the foxboard
  46. endif
  47. ifeq ($(ADK_TARGET_FS),squashfs)
  48. targethelp:
  49. @echo "The image is: $(FW_DIR)/$(ROOTFSSQUASHFS)"
  50. @echo "Use following command to flash the image:"
  51. @echo "cd $(STAGING_HOST_DIR)/usr/bin && sudo ./boot_linux -F -i $(FW_DIR)/${ROOTFSSQUASHFS}"
  52. @echo Do not forget to set network boot jumper, before you start the foxboard
  53. endif
  54. ifeq ($(ADK_TARGET_FS),jffs2)
  55. targethelp:
  56. @echo "The image is: $(FW_DIR)/$(ROOTFSJFFS2)"
  57. endif
  58. kernel-strip:
  59. @cp $(KERNEL) $(BUILD_DIR)/$(TARGET_KERNEL)
  60. kernel-install: kernel-strip
  61. ifeq ($(ADK_TARGET_FS),squashfs)
  62. $(STAGING_HOST_DIR)/usr/bin/mkfimage $(KERNEL) $(KERNEL).fimage
  63. cat $(KERNEL).fimage $(BUILD_DIR)/root.squashfs > \
  64. $(BUILD_DIR)/$(ROOTFSSQUASHFS)
  65. dd if=$(BUILD_DIR)/$(ROOTFSSQUASHFS) of=$(FW_DIR)/$(ROOTFSSQUASHFS) bs=4194304 conv=sync
  66. else
  67. $(STAGING_HOST_DIR)/usr/bin/mkfimage $(BUILD_DIR)/$(TARGET_KERNEL) $(FW_DIR)/$(TARGET_KERNEL)
  68. endif
  69. # filesystem specific targets
  70. ifeq ($(ADK_TARGET_FS),archive)
  71. imageinstall: $(FW_DIR)/$(ROOTFSTARBALL) targethelp
  72. endif
  73. ifeq ($(ADK_TARGET_FS),initramfs)
  74. imageinstall: kernel-install $(FW_DIR)/$(INITRAMFS) targethelp
  75. endif
  76. ifeq ($(ADK_TARGET_FS),initramfsarchive)
  77. imageinstall: kernel-install $(FW_DIR)/$(ROOTFSUSERTARBALL) targethelp
  78. endif
  79. ifeq ($(ADK_TARGET_FS),initramfspiggyback)
  80. imageinstall: createinitramfs targethelp
  81. endif
  82. ifeq ($(ADK_TARGET_FS),nfsroot)
  83. imageinstall: kernel-install $(FW_DIR)/$(ROOTFSUSERTARBALL) targethelp
  84. endif
  85. ifeq ($(ADK_TARGET_FS),squashfs)
  86. imageinstall: $(BUILD_DIR)/root.squashfs kernel-install targethelp
  87. endif
  88. ifeq ($(ADK_TARGET_FS),jffs2)
  89. imageinstall: kernel-install $(FW_DIR)/$(ROOTFSJFFS2) targethelp
  90. endif