Makefile 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  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. ifeq ($(ADK_TARGET_KERNEL_ZIMAGE),y)
  9. KERNEL:=$(LINUX_DIR)/arch/sparc/boot/zImage
  10. else
  11. KERNEL:=$(LINUX_DIR)/vmlinux
  12. endif
  13. QEMU_ARGS:=-M SS-10
  14. QEMU_ARGS+=${ADK_QEMU_ARGS}
  15. ifeq ($(ADK_TARGET_FS),archive)
  16. QEMU_ARGS+=-append "root=/dev/sda1"
  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. ifeq ($(ADK_TARGET_FS),nfsroot)
  53. targethelp:
  54. @echo 'The kernel file is: $(FW_DIR)/${TARGET_KERNEL}'
  55. @echo 'The nfs root tarball is: ${FW_DIR}/${ROOTFSUSERTARBALL}'
  56. endif
  57. # image creation and kernel install
  58. kernel-strip:
  59. cp $(KERNEL) $(BUILD_DIR)/$(TARGET_KERNEL)
  60. $(TARGET_CROSS)objcopy $(OSTRIP) -S $(KERNEL) $(BUILD_DIR)/$(TARGET_KERNEL)
  61. kernel-install: kernel-strip
  62. ifeq ($(ADK_TARGET_SYSTEM_SUN_VOYAGER),y)
  63. PATH='$(HOST_PATH)' elftoaout -o $(FW_DIR)/$(TARGET_KERNEL) $(KERNEL)
  64. else
  65. @cp $(BUILD_DIR)/$(TARGET_KERNEL) $(FW_DIR)/$(TARGET_KERNEL)
  66. endif
  67. # filesystem specific targets
  68. ifeq ($(ADK_TARGET_FS),archive)
  69. imageinstall: $(FW_DIR)/$(ROOTFSTARBALL) targethelp
  70. endif
  71. ifeq ($(ADK_TARGET_FS),initramfs)
  72. imageinstall: kernel-install $(FW_DIR)/$(INITRAMFS) targethelp
  73. endif
  74. ifeq ($(ADK_TARGET_FS),initramfsarchive)
  75. imageinstall: kernel-install $(FW_DIR)/$(ROOTFSUSERTARBALL) targethelp
  76. endif
  77. ifeq ($(ADK_TARGET_FS),initramfspiggyback)
  78. imageinstall: createinitramfs targethelp
  79. endif
  80. ifeq ($(ADK_TARGET_FS),nfsroot)
  81. imageinstall: kernel-install $(FW_DIR)/$(ROOTFSUSERTARBALL) targethelp
  82. endif