Makefile 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  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. ifeq ($(ADK_TARGET_SYSTEM_NUMATO_MIMASV2),y)
  7. KERNEL:=$(LINUX_DIR)/vmlinux
  8. else
  9. KERNEL:=$(LINUX_DIR)/arch/sh/boot/zImage
  10. endif
  11. QEMU_ARGS:=-M r2d
  12. QEMU_ARGS+=${ADK_QEMU_ARGS}
  13. QEMU_ARGS+=-monitor null
  14. QEMU_ARGS+=-net user -net nic,model=rtl8139
  15. ifeq ($(ADK_TARGET_QEMU_WITH_GRAPHIC),)
  16. QEMU_ARGS+=-serial null -serial stdio
  17. endif
  18. # target helper text
  19. ifeq ($(ADK_TARGET_FS),archive)
  20. targethelp:
  21. @echo "The RootFS tarball is: $(FW_DIR)/$(ROOTFSTARBALL)"
  22. ifeq ($(ADK_TARGET_QEMU),y)
  23. @echo 'The kernel file is: $(FW_DIR)/${TARGET_KERNEL}'
  24. @echo "Use following command to create a QEMU Image:"
  25. @echo "./scripts/create.sh qemu-${ADK_TARGET_CPU_ARCH}.img $(FW_DIR)/$(ROOTFSTARBALL)"
  26. @echo "Start qemu with following options:"
  27. @echo 'qemu-system-${ADK_TARGET_CPU_ARCH} ${QEMU_ARGS} -kernel $(FW_DIR)/$(TARGET_KERNEL) qemu-${ADK_TARGET_CPU_ARCH}.img'
  28. endif
  29. endif
  30. ifeq ($(ADK_TARGET_FS),initramfs)
  31. targethelp:
  32. @echo 'The kernel file is: $(FW_DIR)/${TARGET_KERNEL}'
  33. @echo 'The initramfs image is: ${FW_DIR}/${INITRAMFS}'
  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) -initrd ${FW_DIR}/${INITRAMFS}'
  37. endif
  38. endif
  39. ifeq ($(ADK_TARGET_FS),initramfsarchive)
  40. targethelp:
  41. @echo 'The kernel file is: $(FW_DIR)/${TARGET_KERNEL}'
  42. @echo "The RootFS tarball is: $(FW_DIR)/$(ROOTFSUSERTARBALL)"
  43. endif
  44. ifeq ($(ADK_TARGET_FS),initramfspiggyback)
  45. targethelp:
  46. @echo 'The kernel+initramfs file is: $(FW_DIR)/${TARGET_KERNEL}'
  47. ifeq ($(ADK_TARGET_QEMU),y)
  48. @echo "Start qemu with following command line:"
  49. @echo 'qemu-system-${ADK_TARGET_CPU_ARCH} ${QEMU_ARGS} -kernel $(FW_DIR)/$(TARGET_KERNEL)'
  50. endif
  51. endif
  52. # image creation and kernel install
  53. kernel-strip:
  54. @cp $(KERNEL) $(BUILD_DIR)/$(TARGET_KERNEL)
  55. kernel-install: kernel-strip
  56. @cp $(BUILD_DIR)/$(TARGET_KERNEL) $(FW_DIR)/${TARGET_KERNEL}
  57. # filesystem specific targets
  58. ifeq ($(ADK_TARGET_FS),archive)
  59. imageinstall: $(FW_DIR)/$(ROOTFSTARBALL) targethelp
  60. endif
  61. ifeq ($(ADK_TARGET_FS),initramfs)
  62. imageinstall: kernel-install $(FW_DIR)/$(INITRAMFS) targethelp
  63. endif
  64. ifeq ($(ADK_TARGET_FS),initramfsarchive)
  65. imageinstall: kernel-install $(FW_DIR)/$(ROOTFSUSERTARBALL) targethelp
  66. endif
  67. ifeq ($(ADK_TARGET_FS),initramfspiggyback)
  68. imageinstall: createinitramfs targethelp
  69. endif