Makefile 3.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  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),archive)
  18. targethelp:
  19. @echo "The RootFS tarball is: $(FW_DIR)/$(ROOTFSTARBALL)"
  20. endif
  21. ifeq ($(ADK_TARGET_FS),initramfs)
  22. targethelp:
  23. @echo 'The kernel file is: $(FW_DIR)/${TARGET_KERNEL}'
  24. @echo 'The initramfs image is: ${FW_DIR}/${INITRAMFS}'
  25. ifeq ($(ADK_TARGET_QEMU),y)
  26. @echo "Start qemu with following command line:"
  27. @echo 'qemu-system-${ADK_TARGET_CPU_ARCH} ${QEMU_ARGS} -kernel $(FW_DIR)/$(TARGET_KERNEL) -initrd ${FW_DIR}/${INITRAMFS}'
  28. endif
  29. endif
  30. ifeq ($(ADK_TARGET_FS),initramfsarchive)
  31. targethelp:
  32. @echo 'The kernel file is: $(FW_DIR)/${TARGET_KERNEL}'
  33. @echo "The RootFS tarball is: $(FW_DIR)/$(ROOTFSUSERTARBALL)"
  34. endif
  35. ifeq ($(ADK_TARGET_FS),initramfspiggyback)
  36. targethelp:
  37. @echo 'The kernel+initramfs file is: $(FW_DIR)/${TARGET_KERNEL}'
  38. ifeq ($(ADK_TARGET_QEMU),y)
  39. @echo "Start qemu with following command line:"
  40. @echo 'qemu-system-${ADK_TARGET_CPU_ARCH} ${QEMU_ARGS} -kernel $(FW_DIR)/$(TARGET_KERNEL)'
  41. endif
  42. endif
  43. ifeq ($(ADK_TARGET_FS),squashfs)
  44. targethelp:
  45. @echo 'The kernel file is: $(FW_DIR)/${TARGET_KERNEL}'
  46. @echo "The RootFS image is: $(FW_DIR)/$(ROOTFSSQUASHFS)"
  47. ifeq ($(ADK_TARGET_QEMU),y)
  48. @echo "Start qemu with following options:"
  49. @echo 'qemu-system-${ADK_TARGET_CPU_ARCH} $(QEMU_ARGS) -nographic -kernel $(FW_DIR)/$(TARGET_KERNEL) -pflash $(FW_DIR)/$(ROOTFSSQUASHFS)'
  50. endif
  51. endif
  52. ifeq ($(ADK_TARGET_FS),jffs2)
  53. targethelp:
  54. @echo 'The kernel file is: $(FW_DIR)/${TARGET_KERNEL}'
  55. @echo "The RootFS image is: $(FW_DIR)/$(ROOTFSSQUASHFS)"
  56. ifeq ($(ADK_TARGET_QEMU),y)
  57. @echo "Start qemu with following options:"
  58. @echo 'qemu-system-${ADK_TARGET_CPU_ARCH} $(QEMU_ARGS) -nographic -kernel $(FW_DIR)/$(TARGET_KERNEL) -pflash $(FW_DIR)/$(ROOTFSSQUASHFS)'
  59. endif
  60. endif
  61. kernel-strip:
  62. @cp $(KERNEL) $(BUILD_DIR)/$(TARGET_KERNEL)
  63. kernel-install: kernel-strip
  64. @cp $(KERNEL) $(FW_DIR)/$(TARGET_KERNEL)
  65. ifeq ($(ADK_TARGET_FS),squashfs)
  66. env PATH=$(HOST_PATH) qemu-img create -f raw $(FW_DIR)/$(ROOTFSSQUASHFS) $(ADK_TARGET_MTD_SIZE)
  67. dd conv=notrunc if=$(BUILD_DIR)/root.squashfs of=$(FW_DIR)/$(ROOTFSSQUASHFS)
  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),squashfs)
  83. imageinstall: $(BUILD_DIR)/root.squashfs kernel-install targethelp
  84. endif
  85. ifeq ($(ADK_TARGET_FS),jffs2)
  86. imageinstall: kernel-install $(FW_DIR)/$(ROOTFSJFFS2) targethelp
  87. endif