Makefile 3.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  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)/vmlinux
  7. QEMU_ARGS:=${ADK_QEMU_ARGS}
  8. ifeq ($(ADK_TARGET_SYSTEM_QEMU_M68K_VIRT),y)
  9. QEMU_ARGS+=-M virt -m 512M -netdev user,id=eth0 -device virtio-net-device,netdev=eth0
  10. ifeq ($(ADK_TARGET_FS),archive)
  11. QEMU_ARGS+=-append "rootwait root=/dev/vda1 ro" -drive file=qemu-m68k.img,format=raw,id=hd0 -device virtio-blk-device,drive=hd0
  12. endif
  13. endif
  14. ifeq ($(ADK_TARGET_SYSTEM_QEMU_M68K_Q800),y)
  15. QEMU_ARGS+=-M q800
  16. endif
  17. ifeq ($(ADK_TARGET_SYSTEM_QEMU_M68K_MCF5208),y)
  18. QEMU_ARGS+=-M mcf5208evb -cpu m5208
  19. endif
  20. # target helper text
  21. ifeq ($(ADK_TARGET_FS),archive)
  22. targethelp:
  23. @echo "The RootFS tarball is: $(FW_DIR)/$(ROOTFSTARBALL)"
  24. ifeq ($(ADK_TARGET_QEMU),y)
  25. @echo 'The kernel file is: $(FW_DIR)/${TARGET_KERNEL}'
  26. @echo "Use following command to create a QEMU Image:"
  27. @echo "./scripts/create.sh qemu-${ADK_TARGET_CPU_ARCH}.img $(FW_DIR)/$(ROOTFSUSERTARBALL)"
  28. @echo "Start qemu with following options:"
  29. ifeq ($(ADK_TARGET_SYSTEM_QEMU_M68K_VIRT),y)
  30. @echo 'qemu-system-${ADK_TARGET_CPU_ARCH} ${QEMU_ARGS} -kernel $(FW_DIR)/$(TARGET_KERNEL)'
  31. else
  32. @echo 'qemu-system-${ADK_TARGET_CPU_ARCH} ${QEMU_ARGS} -kernel $(FW_DIR)/$(TARGET_KERNEL) qemu-${ADK_TARGET_CPU_ARCH}.img'
  33. endif
  34. endif
  35. endif
  36. ifeq ($(ADK_TARGET_FS),initramfs)
  37. targethelp:
  38. @echo 'The kernel file is: $(FW_DIR)/${TARGET_KERNEL}'
  39. @echo 'The initramfs image is: ${FW_DIR}/${INITRAMFS}'
  40. ifeq ($(ADK_TARGET_QEMU),y)
  41. @echo "Start qemu with following command line:"
  42. @echo 'qemu-system-${ADK_TARGET_CPU_ARCH} ${QEMU_ARGS} -kernel $(FW_DIR)/$(TARGET_KERNEL) -initrd ${FW_DIR}/${INITRAMFS}'
  43. endif
  44. ifeq ($(ADK_TARGET_SYSTEM_ARANYM_M68K),y)
  45. @sed -e "s#@@KERNEL@@#$(FW_DIR)/$(TARGET_KERNEL)#" \
  46. -e "s#@@INITRAMFS@@#${FW_DIR}/${INITRAMFS}#" \
  47. $(ADK_TOPDIR)/target/m68k/aranym.cfg.in \
  48. > $(ADK_TOPDIR)/target/m68k/aranym.cfg
  49. @echo 'Start aranym with: aranym-mmu -l -c target/m68k/aranym.cfg'
  50. @echo 'Ungrab mouse with middle mouse click'
  51. endif
  52. endif
  53. ifeq ($(ADK_TARGET_FS),initramfsarchive)
  54. targethelp:
  55. @echo 'The kernel file is: $(FW_DIR)/${TARGET_KERNEL}'
  56. @echo "The RootFS tarball is: $(FW_DIR)/$(ROOTFSUSERTARBALL)"
  57. endif
  58. ifeq ($(ADK_TARGET_FS),initramfspiggyback)
  59. targethelp:
  60. @echo 'The kernel+initramfs file is: $(FW_DIR)/${TARGET_KERNEL}'
  61. ifeq ($(ADK_TARGET_QEMU),y)
  62. @echo "Start qemu with following command line:"
  63. @echo 'qemu-system-${ADK_TARGET_CPU_ARCH} ${QEMU_ARGS} -kernel $(FW_DIR)/$(TARGET_KERNEL)'
  64. endif
  65. endif
  66. kernel-strip:
  67. kernel-install: kernel-strip
  68. @cp $(KERNEL) $(FW_DIR)/$(TARGET_KERNEL)
  69. # filesystem specific targets
  70. ifeq ($(ADK_TARGET_FS),archive)
  71. imageinstall: kernel-install $(FW_DIR)/$(ROOTFSUSERTARBALL) 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