Makefile 2.0 KB

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