1
0

Makefile 2.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  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. ifeq ($(ADK_TARGET_KERNEL_ZIMAGE),y)
  9. KERNEL:=$(LINUX_DIR)/arch/sparc/boot/zImage
  10. endif
  11. ifeq ($(ADK_TARGET_KERNEL_VMLINUX_AOUT),y)
  12. KERNEL:=$(LINUX_DIR)/arch/sparc/boot/vmlinux.aout
  13. endif
  14. QEMU_ARGS:=-M SS-10
  15. QEMU_ARGS+=${ADK_QEMU_ARGS}
  16. ifeq ($(ADK_TARGET_FS),archive)
  17. QEMU_ARGS+=-append "root=/dev/sda1"
  18. endif
  19. # target helper text
  20. ifeq ($(ADK_TARGET_FS),archive)
  21. targethelp:
  22. @echo "The RootFS tarball is: $(FW_DIR)/$(ROOTFSTARBALL)"
  23. ifeq ($(ADK_TARGET_QEMU),y)
  24. @echo 'The kernel file is: $(FW_DIR)/${TARGET_KERNEL}'
  25. @echo "Use following command to create a QEMU Image:"
  26. @echo "./scripts/create.sh qemu-${ADK_TARGET_CPU_ARCH}.img $(FW_DIR)/$(ROOTFSTARBALL)"
  27. @echo "Start qemu with following options:"
  28. @echo 'qemu-system-${ADK_TARGET_CPU_ARCH} ${QEMU_ARGS} -kernel $(FW_DIR)/$(TARGET_KERNEL) qemu-${ADK_TARGET_CPU_ARCH}.img'
  29. endif
  30. endif
  31. ifeq ($(ADK_TARGET_FS),initramfs)
  32. targethelp:
  33. @echo 'The kernel file is: $(FW_DIR)/${TARGET_KERNEL}'
  34. @echo 'The initramfs image is: ${FW_DIR}/${INITRAMFS}'
  35. ifeq ($(ADK_TARGET_QEMU),y)
  36. @echo "Start qemu with following command line:"
  37. @echo 'qemu-system-${ADK_TARGET_CPU_ARCH} ${QEMU_ARGS} -kernel $(FW_DIR)/$(TARGET_KERNEL) -initrd ${FW_DIR}/${INITRAMFS}'
  38. endif
  39. endif
  40. ifeq ($(ADK_TARGET_FS),initramfsarchive)
  41. targethelp:
  42. @echo 'The kernel file is: $(FW_DIR)/${TARGET_KERNEL}'
  43. @echo "The RootFS tarball is: $(FW_DIR)/$(ROOTFSUSERTARBALL)"
  44. endif
  45. ifeq ($(ADK_TARGET_FS),initramfspiggyback)
  46. targethelp:
  47. @echo 'The kernel+initramfs file is: $(FW_DIR)/${TARGET_KERNEL}'
  48. ifeq ($(ADK_TARGET_QEMU),y)
  49. @echo "Start qemu with following command line:"
  50. @echo 'qemu-system-${ADK_TARGET_CPU_ARCH} ${QEMU_ARGS} -kernel $(FW_DIR)/$(TARGET_KERNEL)'
  51. endif
  52. endif
  53. ifeq ($(ADK_TARGET_FS),nfsroot)
  54. targethelp:
  55. @echo 'The kernel file is: $(FW_DIR)/${TARGET_KERNEL}'
  56. @echo 'The nfs root tarball is: ${FW_DIR}/${ROOTFSUSERTARBALL}'
  57. endif
  58. # image creation and kernel install
  59. kernel-strip:
  60. $(TARGET_CROSS)objcopy $(OSTRIP) -S $(KERNEL) $(BUILD_DIR)/$(TARGET_KERNEL)
  61. kernel-install: kernel-strip
  62. @cp $(BUILD_DIR)/$(TARGET_KERNEL) $(FW_DIR)/${TARGET_KERNEL}
  63. # filesystem specific targets
  64. ifeq ($(ADK_TARGET_FS),archive)
  65. imageinstall: $(FW_DIR)/$(ROOTFSTARBALL) targethelp
  66. endif
  67. ifeq ($(ADK_TARGET_FS),initramfs)
  68. imageinstall: kernel-install $(FW_DIR)/$(INITRAMFS) targethelp
  69. endif
  70. ifeq ($(ADK_TARGET_FS),initramfsarchive)
  71. imageinstall: kernel-install $(FW_DIR)/$(ROOTFSUSERTARBALL) targethelp
  72. endif
  73. ifeq ($(ADK_TARGET_FS),initramfspiggyback)
  74. imageinstall: createinitramfs targethelp
  75. endif
  76. ifeq ($(ADK_TARGET_FS),nfsroot)
  77. imageinstall: kernel-install $(FW_DIR)/$(ROOTFSUSERTARBALL) targethelp
  78. endif