Makefile 2.5 KB

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