Makefile 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  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. KERNEL:=$(LINUX_DIR)/vmlinux
  9. QEMU_ARGS:=-monitor null
  10. QEMU_ARGS+=${ADK_QEMU_ARGS}
  11. # target helper text
  12. ifeq ($(ADK_TARGET_FS),archive)
  13. targethelp:
  14. @echo "The RootFS tarball is: $(FW_DIR)/$(ROOTFSTARBALL)"
  15. ifeq ($(ADK_TARGET_QEMU),y)
  16. @echo 'The kernel file is: $(FW_DIR)/${TARGET_KERNEL}'
  17. @echo "Use following command to create a QEMU Image:"
  18. @echo "./scripts/create.sh qemu-${ADK_TARGET_CPU_ARCH}.img $(FW_DIR)/$(ROOTFSTARBALL)"
  19. @echo "Start qemu with following options:"
  20. @echo 'qemu-system-${ADK_TARGET_CPU_ARCH} ${QEMU_ARGS} -kernel $(FW_DIR)/$(TARGET_KERNEL) qemu-${ADK_TARGET_CPU_ARCH}.img'
  21. endif
  22. endif
  23. ifeq ($(ADK_TARGET_FS),initramfs)
  24. targethelp:
  25. @echo 'The kernel file is: $(FW_DIR)/${TARGET_KERNEL}'
  26. @echo 'The initramfs image is: ${FW_DIR}/${INITRAMFS}'
  27. ifeq ($(ADK_TARGET_QEMU),y)
  28. @echo "Start qemu with following command line:"
  29. @echo 'qemu-system-${ADK_TARGET_CPU_ARCH} ${QEMU_ARGS} -kernel $(FW_DIR)/$(TARGET_KERNEL) -initrd ${FW_DIR}/${INITRAMFS}'
  30. endif
  31. endif
  32. ifeq ($(ADK_TARGET_FS),initramfsarchive)
  33. targethelp:
  34. @echo 'The kernel file is: $(FW_DIR)/${TARGET_KERNEL}'
  35. @echo "The RootFS tarball is: $(FW_DIR)/$(ROOTFSUSERTARBALL)"
  36. endif
  37. ifeq ($(ADK_TARGET_FS),initramfspiggyback)
  38. targethelp:
  39. @echo 'The kernel+initramfs file is: $(FW_DIR)/${TARGET_KERNEL}'
  40. ifeq ($(ADK_TARGET_QEMU),y)
  41. @echo "Start qemu with following command line:"
  42. @echo 'qemu-system-${ADK_TARGET_CPU_ARCH} ${QEMU_ARGS} -kernel $(FW_DIR)/$(TARGET_KERNEL)'
  43. endif
  44. endif
  45. # image creation and kernel install
  46. kernel-strip:
  47. $(TARGET_CROSS)objcopy $(OSTRIP) -S $(KERNEL) $(BUILD_DIR)/$(TARGET_KERNEL)
  48. kernel-install: kernel-strip
  49. @cp $(BUILD_DIR)/$(TARGET_KERNEL) $(FW_DIR)/${TARGET_KERNEL}
  50. # filesystem specific targets
  51. ifeq ($(ADK_TARGET_FS),archive)
  52. imageinstall: $(FW_DIR)/$(ROOTFSTARBALL) targethelp
  53. endif
  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