1
0

Makefile 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  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)/arch/microblaze/boot/$(ADK_TARGET_KERNEL)
  9. tools-compile:
  10. $(MAKE) -C ../tools/mtd-utils all
  11. $(MAKE) -C ../tools/xz all
  12. $(MAKE) -C ../tools/squashfs all
  13. ifeq ($(ADK_TARGET_QEMU_MICROBLAZE_MODEL_ML605),y)
  14. MODEL:=petalogix-ml605
  15. DTB:=-dtb target/microblaze/ml605.dtb
  16. endif
  17. ifeq ($(ADK_TARGET_QEMU_MICROBLAZE_MODEL_S3ADSP1800),y)
  18. MODEL:=petalogix-s3adsp1800
  19. DTB:=
  20. endif
  21. ifeq ($(ADK_TARGET_FS),squashfs)
  22. imageinstall: tools-compile $(BUILD_DIR)/root.squashfs
  23. qemu-img create -f raw $(BIN_DIR)/$(ROOTFSSQUASHFS) $(ADK_TARGET_MTD_SIZE)
  24. dd conv=notrunc if=$(BUILD_DIR)/root.squashfs of=$(BIN_DIR)/$(ROOTFSSQUASHFS)
  25. @cp $(KERNEL) $(BIN_DIR)/$(TARGET_KERNEL)
  26. ifneq ($(ADK_HARDWARE_QEMU),)
  27. @echo "Start qemu with following options:"
  28. @echo 'qemu-system-${CPU_ARCH} $(DTB) -M $(MODEL) -nographic -kernel $(BIN_DIR)/$(TARGET_KERNEL) -pflash $(BIN_DIR)/$(ROOTFSSQUASHFS)'
  29. endif
  30. endif
  31. ifeq ($(ADK_TARGET_FS),jffs2)
  32. imageinstall: tools-compile $(BIN_DIR)/$(ROOTFSJFFS2)
  33. @cp $(KERNEL) $(BIN_DIR)/$(TARGET_KERNEL)
  34. ifneq ($(ADK_HARDWARE_QEMU),)
  35. @echo "Start qemu with following options:"
  36. @echo 'qemu-system-${CPU_ARCH} $(DTB) -M $(MODEL) -nographic -kernel $(BIN_DIR)/$(TARGET_KERNEL) -pflash $(BIN_DIR)/$(ROOTFSJFFS2)'
  37. endif
  38. endif
  39. ifeq ($(ADK_TARGET_FS),initramfs)
  40. imageinstall: $(BIN_DIR)/$(INITRAMFS)
  41. @cp $(KERNEL) $(BIN_DIR)/$(TARGET_KERNEL)
  42. @echo 'The kernel file is: $(BIN_DIR)/${TARGET_KERNEL}'
  43. @echo 'The initramfs image is: ${BIN_DIR}/${INITRAMFS}'
  44. ifneq ($(ADK_HARDWARE_QEMU),)
  45. @echo "Start qemu with following command line:"
  46. @echo 'qemu-system-${CPU_ARCH} $(DTB) -M $(MODEL) -nographic -kernel $(BIN_DIR)/$(TARGET_KERNEL) -initrd ${BIN_DIR}/${INITRAMFS}'
  47. endif
  48. endif
  49. ifeq ($(ADK_TARGET_FS),initramfs-piggyback)
  50. imageinstall: createinitramfs
  51. @cp $(KERNEL) $(BIN_DIR)/$(TARGET_KERNEL)
  52. @echo 'The kernel+initramfs file is: $(BIN_DIR)/${TARGET_KERNEL}'
  53. ifneq ($(ADK_HARDWARE_QEMU),)
  54. @echo "Start qemu with following command line:"
  55. @echo 'qemu-system-${CPU_ARCH} $(DTB) -M $(MODEL) -nographic -kernel $(BIN_DIR)/$(TARGET_KERNEL)'
  56. endif
  57. endif