Makefile 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  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.mk
  5. include $(ADK_TOPDIR)/mk/modules.mk
  6. include $(ADK_TOPDIR)/mk/kernel-build.mk
  7. include $(ADK_TOPDIR)/mk/image.mk
  8. KERNEL:=$(LINUX_DIR)/arch/microblaze/boot/$(ADK_TARGET_KERNEL)
  9. QEMU_ARGS:=${ADK_QEMU_ARGS}
  10. ifeq ($(ADK_TARGET_QEMU_MICROBLAZE_MODEL_ML605),y)
  11. QEMU_ARGS+=-M petalogix-ml605 -dtb target/microblaze/ml605.dtb
  12. endif
  13. ifeq ($(ADK_TARGET_QEMU_MICROBLAZE_MODEL_S3ADSP1800),y)
  14. QEMU_ARGS+=-M petalogix-s3adsp1800
  15. endif
  16. # target helper text
  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_CPU_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_CPU_ARCH} ${QEMU_ARGS} -kernel $(FW_DIR)/$(TARGET_KERNEL)'
  37. endif
  38. endif
  39. ifeq ($(ADK_TARGET_FS),squashfs)
  40. targethelp:
  41. @echo 'The kernel file is: $(FW_DIR)/${TARGET_KERNEL}'
  42. @echo "The RootFS image is: $(FW_DIR)/$(ROOTFSSQUASHFS)"
  43. ifeq ($(ADK_TARGET_QEMU),y)
  44. @echo "Start qemu with following options:"
  45. @echo 'qemu-system-${ADK_TARGET_CPU_ARCH} $(QEMU_ARGS) -nographic -kernel $(FW_DIR)/$(TARGET_KERNEL) -pflash $(FW_DIR)/$(ROOTFSSQUASHFS)'
  46. endif
  47. endif
  48. ifeq ($(ADK_TARGET_FS),jffs2)
  49. targethelp:
  50. @echo 'The kernel file is: $(FW_DIR)/${TARGET_KERNEL}'
  51. @echo "The RootFS image is: $(FW_DIR)/$(ROOTFSSQUASHFS)"
  52. ifeq ($(ADK_TARGET_QEMU),y)
  53. @echo "Start qemu with following options:"
  54. @echo 'qemu-system-${ADK_TARGET_CPU_ARCH} $(QEMU_ARGS) -nographic -kernel $(FW_DIR)/$(TARGET_KERNEL) -pflash $(FW_DIR)/$(ROOTFSSQUASHFS)'
  55. endif
  56. endif
  57. kernel-strip:
  58. @cp $(KERNEL) $(BUILD_DIR)/$(TARGET_KERNEL)
  59. kernel-install: kernel-strip
  60. @cp $(KERNEL) $(FW_DIR)/$(TARGET_KERNEL)
  61. ifeq ($(ADK_TARGET_FS),squashfs)
  62. env PATH=$(HOST_PATH) qemu-img create -f raw $(FW_DIR)/$(ROOTFSSQUASHFS) $(ADK_TARGET_MTD_SIZE) >/dev/null 2>&1
  63. dd conv=notrunc if=$(BUILD_DIR)/root.squashfs of=$(FW_DIR)/$(ROOTFSSQUASHFS) >/dev/null 2>&1
  64. endif
  65. # filesystem specific targets
  66. ifeq ($(ADK_TARGET_FS),initramfs)
  67. imageinstall: kernel-install $(FW_DIR)/$(INITRAMFS) targethelp
  68. endif
  69. ifeq ($(ADK_TARGET_FS),initramfsarchive)
  70. imageinstall: kernel-install $(FW_DIR)/$(ROOTFSUSERTARBALL) targethelp
  71. endif
  72. ifeq ($(ADK_TARGET_FS),initramfspiggyback)
  73. imageinstall: createinitramfs targethelp
  74. endif
  75. ifeq ($(ADK_TARGET_FS),squashfs)
  76. imageinstall: kernel-install $(BUILD_DIR)/root.squashfs targethelp
  77. endif
  78. ifeq ($(ADK_TARGET_FS),jffs2)
  79. imageinstall: kernel-install $(FW_DIR)/$(ROOTFSJFFS2) targethelp
  80. endif