1
0

Makefile 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  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:=-M sun4u
  8. QEMU_ARGS+=${ADK_QEMU_ARGS}
  9. ifeq ($(ADK_TARGET_QEMU_WITH_BLOCK),y)
  10. QEMU_ARGS+=-drive file=qemu-${ADK_TARGET_CPU_ARCH}.img,format=raw
  11. endif
  12. ifeq ($(ADK_TARGET_QEMU_WITH_VIRTIO),y)
  13. QEMU_ARGS+=-net nic,model=virtio -net user
  14. ifeq ($(ADK_TARGET_FS),archive)
  15. QEMU_ARGS+=-drive file=qemu-${ADK_TARGET_CPU_ARCH}.img,if=virtio
  16. endif
  17. else
  18. QEMU_ARGS+=-net nic,model=e1000 -net user
  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)/$(ROOTFSTARBALL)"
  28. @echo "Start qemu with following options:"
  29. @echo 'qemu-system-${ADK_TARGET_CPU_ARCH} ${QEMU_ARGS} -kernel $(FW_DIR)/$(TARGET_KERNEL)'
  30. endif
  31. endif
  32. ifeq ($(ADK_TARGET_FS),initramfs)
  33. targethelp:
  34. @echo 'The kernel file is: $(FW_DIR)/${TARGET_KERNEL}'
  35. @echo 'The initramfs image is: ${FW_DIR}/${INITRAMFS}'
  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) -initrd ${FW_DIR}/${INITRAMFS}'
  39. endif
  40. endif
  41. ifeq ($(ADK_TARGET_FS),initramfsarchive)
  42. targethelp:
  43. @echo 'The kernel file is: $(FW_DIR)/${TARGET_KERNEL}'
  44. @echo "The RootFS tarball is: $(FW_DIR)/$(ROOTFSUSERTARBALL)"
  45. endif
  46. ifeq ($(ADK_TARGET_FS),initramfspiggyback)
  47. targethelp:
  48. @echo 'The kernel+initramfs file is: $(FW_DIR)/${TARGET_KERNEL}'
  49. ifeq ($(ADK_TARGET_QEMU),y)
  50. @echo "Start qemu with following command line:"
  51. @echo 'qemu-system-${ADK_TARGET_CPU_ARCH} ${QEMU_ARGS} -kernel $(FW_DIR)/$(TARGET_KERNEL)'
  52. endif
  53. endif
  54. # image creation and kernel install
  55. kernel-strip:
  56. $(TARGET_CROSS)objcopy $(OSTRIP) -S $(KERNEL) $(BUILD_DIR)/$(TARGET_KERNEL)
  57. kernel-install: kernel-strip
  58. @cp $(BUILD_DIR)/$(TARGET_KERNEL) $(FW_DIR)/${TARGET_KERNEL}
  59. # filesystem specific targets
  60. ifeq ($(ADK_TARGET_FS),archive)
  61. imageinstall: $(FW_DIR)/$(ROOTFSTARBALL) targethelp
  62. endif
  63. ifeq ($(ADK_TARGET_FS),initramfs)
  64. imageinstall: kernel-install $(FW_DIR)/$(INITRAMFS) targethelp
  65. endif
  66. ifeq ($(ADK_TARGET_FS),initramfsarchive)
  67. imageinstall: kernel-install $(FW_DIR)/$(ROOTFSUSERTARBALL) targethelp
  68. endif
  69. ifeq ($(ADK_TARGET_FS),initramfspiggyback)
  70. imageinstall: createinitramfs targethelp
  71. endif