Makefile 2.5 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 $(TOPDIR)/rules.mk
  4. include $(TOPDIR)/mk/kernel.mk
  5. include $(TOPDIR)/mk/modules.mk
  6. include $(TOPDIR)/mk/kernel-build.mk
  7. include $(TOPDIR)/mk/image.mk
  8. KERNEL:=$(LINUX_DIR)/vmlinux
  9. OSTRIP:=-R .reginfo -R .notes -R .note -R .comment -R .mdebug -R .note.gnu.build-id
  10. QEMU_ARGS:=-M mac99
  11. QEMU_ARGS+=${ADK_QEMU_ARGS}
  12. QEMU_ARGS+=-device e1000,netdev=adk0 -netdev user,id=adk0
  13. # target helper text
  14. ifeq ($(ADK_TARGET_FS),archive)
  15. targethelp:
  16. @echo "The RootFS tarball is: $(FW_DIR)/$(ROOTFSTARBALL)"
  17. ifeq ($(ADK_TARGET_QEMU),y)
  18. @echo 'The kernel file is: $(FW_DIR)/${TARGET_KERNEL}'
  19. @echo "Use following command to create a QEMU Image:"
  20. @echo "./scripts/create.sh qemu-${ADK_TARGET_CPU_ARCH}.img $(FW_DIR)/$(ROOTFSTARBALL)"
  21. @echo "Start qemu with following options:"
  22. @echo 'qemu-system-${ADK_TARGET_CPU_ARCH} ${QEMU_ARGS} -kernel $(FW_DIR)/$(TARGET_KERNEL) qemu-${ADK_TARGET_CPU_ARCH}.img'
  23. endif
  24. endif
  25. ifeq ($(ADK_TARGET_FS),initramfs)
  26. targethelp:
  27. @echo 'The kernel file is: $(FW_DIR)/${TARGET_KERNEL}'
  28. @echo 'The initramfs image is: ${FW_DIR}/${INITRAMFS}'
  29. ifeq ($(ADK_TARGET_QEMU),y)
  30. @echo "Start qemu with following command line:"
  31. @echo 'qemu-system-${ADK_TARGET_CPU_ARCH} ${QEMU_ARGS} -kernel $(FW_DIR)/$(TARGET_KERNEL) -initrd ${FW_DIR}/${INITRAMFS}'
  32. endif
  33. endif
  34. ifeq ($(ADK_TARGET_FS),initramfsarchive)
  35. targethelp:
  36. @echo 'The kernel file is: $(FW_DIR)/${TARGET_KERNEL}'
  37. @echo "The RootFS tarball is: $(FW_DIR)/$(ROOTFSUSERTARBALL)"
  38. endif
  39. ifeq ($(ADK_TARGET_FS),initramfspiggyback)
  40. targethelp:
  41. @echo 'The kernel+initramfs file is: $(FW_DIR)/${TARGET_KERNEL}'
  42. ifeq ($(ADK_TARGET_QEMU),y)
  43. @echo "Start qemu with following command line:"
  44. @echo 'qemu-system-${ADK_TARGET_CPU_ARCH} ${QEMU_ARGS} -kernel $(FW_DIR)/$(TARGET_KERNEL)'
  45. endif
  46. endif
  47. # image creation and kernel install
  48. kernel-strip:
  49. $(TARGET_CROSS)objcopy $(OSTRIP) -S $(KERNEL) $(BUILD_DIR)/$(TARGET_KERNEL)
  50. kernel-install: kernel-strip
  51. @cp $(BUILD_DIR)/$(TARGET_KERNEL) $(FW_DIR)/${TARGET_KERNEL}
  52. # filesystem specific targets
  53. ifeq ($(ADK_TARGET_FS),archive)
  54. imageinstall: $(FW_DIR)/$(ROOTFSTARBALL) targethelp
  55. endif
  56. ifeq ($(ADK_TARGET_FS),initramfs)
  57. imageinstall: kernel-install $(FW_DIR)/$(INITRAMFS) targethelp
  58. endif
  59. ifeq ($(ADK_TARGET_FS),initramfsarchive)
  60. imageinstall: kernel-install $(FW_DIR)/$(ROOTFSUSERTARBALL) targethelp
  61. endif
  62. ifeq ($(ADK_TARGET_FS),initramfspiggyback)
  63. imageinstall: createinitramfs targethelp
  64. endif