1
0

Makefile 3.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  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. OSTRIP:=-R .reginfo -R .notes -R .note -R .comment -R .mdebug
  7. OSTRIP+=-R .note.gnu.build-id -K sun4u_init -K _end -K _start
  8. KERNEL:=$(LINUX_DIR)/vmlinux
  9. ifeq ($(ADK_TARGET_KERNEL_ZIMAGE),y)
  10. KERNEL:=$(LINUX_DIR)/arch/sparc/boot/zImage
  11. endif
  12. ifeq ($(ADK_TARGET_KERNEL_VMLINUX_AOUT),y)
  13. KERNEL:=$(LINUX_DIR)/arch/sparc/boot/image
  14. endif
  15. QEMU_ARGS:=-M SS-10
  16. QEMU_ARGS+=${ADK_QEMU_ARGS}
  17. ifeq ($(ADK_TARGET_FS),archive)
  18. QEMU_ARGS+=-append "root=/dev/sda1"
  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) qemu-${ADK_TARGET_CPU_ARCH}.img'
  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. ifeq ($(ADK_TARGET_FS),nfsroot)
  55. targethelp:
  56. @echo 'The kernel file is: $(FW_DIR)/${TARGET_KERNEL}'
  57. @echo 'The nfs root tarball is: ${FW_DIR}/${ROOTFSUSERTARBALL}'
  58. endif
  59. # image creation and kernel install
  60. kernel-strip:
  61. cp $(KERNEL) $(BUILD_DIR)/$(TARGET_KERNEL)
  62. $(TARGET_CROSS)objcopy $(OSTRIP) -S $(KERNEL) $(BUILD_DIR)/$(TARGET_KERNEL)
  63. kernel-install: kernel-strip
  64. ifeq ($(ADK_TARGET_KERNEL_VMLINUX_AOUT),y)
  65. PATH='$(HOST_PATH)' elftoaout -o $(FW_DIR)/$(TARGET_KERNEL) $(BUILD_DIR)/$(TARGET_KERNEL)
  66. else
  67. cp $(BUILD_DIR)/$(TARGET_KERNEL) $(FW_DIR)/$(TARGET_KERNEL)
  68. endif
  69. # filesystem specific targets
  70. ifeq ($(ADK_TARGET_FS),archive)
  71. imageinstall: $(FW_DIR)/$(ROOTFSTARBALL) 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
  82. ifeq ($(ADK_TARGET_FS),nfsroot)
  83. imageinstall: kernel-install $(FW_DIR)/$(ROOTFSUSERTARBALL) targethelp
  84. endif