Makefile 3.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  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)/arch/microblaze/boot/$(ADK_TARGET_KERNEL)
  7. QEMU_ARGS:=${ADK_QEMU_ARGS}
  8. ifeq ($(ADK_TARGET_QEMU_MICROBLAZE_MODEL_ML605),y)
  9. QEMU_ARGS+=-M petalogix-ml605 -dtb target/microblaze/ml605.dtb
  10. endif
  11. ifeq ($(ADK_TARGET_QEMU_MICROBLAZE_MODEL_S3ADSP1800),y)
  12. QEMU_ARGS+=-M petalogix-s3adsp1800
  13. endif
  14. # target helper text
  15. ifeq ($(ADK_TARGET_FS),archive)
  16. targethelp:
  17. @echo "The RootFS tarball is: $(FW_DIR)/$(ROOTFSTARBALL)"
  18. endif
  19. ifeq ($(ADK_TARGET_FS),initramfs)
  20. targethelp:
  21. @echo 'The kernel file is: $(FW_DIR)/${TARGET_KERNEL}'
  22. @echo 'The initramfs image is: ${FW_DIR}/${INITRAMFS}'
  23. ifeq ($(ADK_TARGET_QEMU),y)
  24. @echo "Start qemu with following command line:"
  25. @echo 'qemu-system-${ADK_TARGET_CPU_ARCH} ${QEMU_ARGS} -kernel $(FW_DIR)/$(TARGET_KERNEL) -initrd ${FW_DIR}/${INITRAMFS}'
  26. endif
  27. endif
  28. ifeq ($(ADK_TARGET_FS),initramfsarchive)
  29. targethelp:
  30. @echo 'The kernel file is: $(FW_DIR)/${TARGET_KERNEL}'
  31. @echo "The RootFS tarball is: $(FW_DIR)/$(ROOTFSUSERTARBALL)"
  32. endif
  33. ifeq ($(ADK_TARGET_FS),initramfspiggyback)
  34. targethelp:
  35. @echo 'The kernel+initramfs file is: $(FW_DIR)/${TARGET_KERNEL}'
  36. ifeq ($(ADK_TARGET_QEMU),y)
  37. @echo "Start qemu with following command line:"
  38. @echo 'qemu-system-${ADK_TARGET_CPU_ARCH} ${QEMU_ARGS} -kernel $(FW_DIR)/$(TARGET_KERNEL)'
  39. endif
  40. endif
  41. ifeq ($(ADK_TARGET_FS),squashfs)
  42. targethelp:
  43. @echo 'The kernel file is: $(FW_DIR)/${TARGET_KERNEL}'
  44. @echo "The RootFS image is: $(FW_DIR)/$(ROOTFSSQUASHFS)"
  45. ifeq ($(ADK_TARGET_QEMU),y)
  46. @echo "Start qemu with following options:"
  47. @echo 'qemu-system-${ADK_TARGET_CPU_ARCH} $(QEMU_ARGS) -nographic -kernel $(FW_DIR)/$(TARGET_KERNEL) -pflash $(FW_DIR)/$(ROOTFSSQUASHFS)'
  48. endif
  49. endif
  50. ifeq ($(ADK_TARGET_FS),jffs2)
  51. targethelp:
  52. @echo 'The kernel file is: $(FW_DIR)/${TARGET_KERNEL}'
  53. @echo "The RootFS image is: $(FW_DIR)/$(ROOTFSSQUASHFS)"
  54. ifeq ($(ADK_TARGET_QEMU),y)
  55. @echo "Start qemu with following options:"
  56. @echo 'qemu-system-${ADK_TARGET_CPU_ARCH} $(QEMU_ARGS) -nographic -kernel $(FW_DIR)/$(TARGET_KERNEL) -pflash $(FW_DIR)/$(ROOTFSSQUASHFS)'
  57. endif
  58. endif
  59. kernel-strip:
  60. @cp $(KERNEL) $(BUILD_DIR)/$(TARGET_KERNEL)
  61. kernel-install: kernel-strip
  62. @cp $(KERNEL) $(FW_DIR)/$(TARGET_KERNEL)
  63. ifeq ($(ADK_TARGET_FS),squashfs)
  64. env PATH=$(HOST_PATH) qemu-img create -f raw $(FW_DIR)/$(ROOTFSSQUASHFS) $(ADK_TARGET_MTD_SIZE)
  65. dd conv=notrunc if=$(BUILD_DIR)/root.squashfs of=$(FW_DIR)/$(ROOTFSSQUASHFS)
  66. endif
  67. # filesystem specific targets
  68. ifeq ($(ADK_TARGET_FS),archive)
  69. imageinstall: $(FW_DIR)/$(ROOTFSTARBALL) targethelp
  70. endif
  71. ifeq ($(ADK_TARGET_FS),initramfs)
  72. imageinstall: kernel-install $(FW_DIR)/$(INITRAMFS) targethelp
  73. endif
  74. ifeq ($(ADK_TARGET_FS),initramfsarchive)
  75. imageinstall: kernel-install $(FW_DIR)/$(ROOTFSUSERTARBALL) targethelp
  76. endif
  77. ifeq ($(ADK_TARGET_FS),initramfspiggyback)
  78. imageinstall: createinitramfs targethelp
  79. endif
  80. ifeq ($(ADK_TARGET_FS),squashfs)
  81. imageinstall: $(BUILD_DIR)/root.squashfs kernel-install targethelp
  82. endif
  83. ifeq ($(ADK_TARGET_FS),jffs2)
  84. imageinstall: kernel-install $(FW_DIR)/$(ROOTFSJFFS2) targethelp
  85. endif