Makefile 2.2 KB

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