Makefile 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  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. OSTRIP:=-R .reginfo -R .notes -R .note -R .comment -R .mdebug -R .note.gnu.build-id
  8. ifeq ($(ADK_TARGET_KERNEL_UIMAGEBIN),y)
  9. KERNEL:=$(LINUX_DIR)/arch/h8300/boot/uImage.bin
  10. OSTRIP:=
  11. endif
  12. ifeq ($(ADK_TARGET_KERNEL_ZIMAGE),y)
  13. KERNEL:=$(LINUX_DIR)/arch/h8300/boot/zImage
  14. OSTRIP:=
  15. endif
  16. ifeq ($(ADK_TARGET_KERNEL_VMLINUX_SREC),y)
  17. KERNEL:=$(LINUX_DIR)/arch/h8300/boot/vmlinux.srec
  18. endif
  19. # target helper text
  20. ifeq ($(ADK_TARGET_FS),archive)
  21. targethelp:
  22. @echo "The RootFS tarball is: $(FW_DIR)/$(ROOTFSTARBALL)"
  23. endif
  24. ifeq ($(ADK_TARGET_FS),initramfs)
  25. targethelp:
  26. @echo 'The kernel file is: $(FW_DIR)/${TARGET_KERNEL}'
  27. @echo 'The initramfs image is: ${FW_DIR}/${INITRAMFS}'
  28. endif
  29. ifeq ($(ADK_TARGET_FS),initramfsarchive)
  30. targethelp:
  31. @echo 'The kernel file is: $(FW_DIR)/${TARGET_KERNEL}'
  32. @echo "The RootFS tarball is: $(FW_DIR)/$(ROOTFSUSERTARBALL)"
  33. endif
  34. ifeq ($(ADK_TARGET_FS),initramfspiggyback)
  35. targethelp:
  36. @echo 'The kernel+initramfs file is: $(FW_DIR)/${TARGET_KERNEL}'
  37. ifeq ($(ADK_TARGET_SIM),y)
  38. @echo "Run the simulator via:"
  39. @echo '$(TARGET_CROSS)gdb $(FW_DIR)/$(TARGET_KERNEL)'
  40. @echo 'gdb> target sim'
  41. @echo 'gdb> sim intmode 1'
  42. @echo 'gdb> sim sci net 12345'
  43. @echo 'gdb> load'
  44. @echo 'start telnet localhost 12345 in a second shell'
  45. @echo 'gdb> run earlyprintk=h8300-sim console=ttySC0'
  46. endif
  47. endif
  48. ifeq ($(ADK_TARGET_FS),nfsroot)
  49. targethelp:
  50. @echo 'The kernel file is: $(FW_DIR)/${TARGET_KERNEL}'
  51. @echo "The RootFS tarball is: $(FW_DIR)/$(ROOTFSUSERTARBALL)"
  52. endif
  53. kernel-strip:
  54. ifneq ($(OSTRIP),)
  55. $(TARGET_CROSS)objcopy $(OSTRIP) -S $(KERNEL) $(BUILD_DIR)/$(TARGET_KERNEL)
  56. else
  57. @cp $(KERNEL) $(BUILD_DIR)/$(TARGET_KERNEL)
  58. endif
  59. kernel-install: kernel-strip
  60. @cp $(BUILD_DIR)/$(TARGET_KERNEL) $(FW_DIR)/$(TARGET_KERNEL)
  61. # filesystem specific targets
  62. ifeq ($(ADK_TARGET_FS),archive)
  63. imageinstall: $(FW_DIR)/$(ROOTFSTARBALL) targethelp
  64. endif
  65. ifeq ($(ADK_TARGET_FS),initramfs)
  66. imageinstall: kernel-install $(FW_DIR)/$(INITRAMFS) targethelp
  67. endif
  68. ifeq ($(ADK_TARGET_FS),initramfsarchive)
  69. imageinstall: kernel-install $(FW_DIR)/$(ROOTFSUSERTARBALL) targethelp
  70. endif
  71. ifeq ($(ADK_TARGET_FS),initramfspiggyback)
  72. imageinstall: createinitramfs targethelp
  73. endif
  74. ifeq ($(ADK_TARGET_FS),nfsroot)
  75. imageinstall: kernel-install $(FW_DIR)/$(ROOTFSUSERTARBALL) targethelp
  76. endif