Makefile 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  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)/arch/x86/boot/bzImage
  9. QEMU_ARCH:=x86_64
  10. QEMU_ARGS:=-M pc
  11. QEMU_ARGS+=${ADK_QEMU_ARGS}
  12. QEMU_ARGS+=-net user -net nic,model=e1000
  13. ifeq ($(ADK_TARGET_QEMU_WITH_BOOTLOADER),y)
  14. ifeq ($(ADK_TARGET_QEMU_WITHOUT_GRAPHIC),y)
  15. CREATE:=./scripts/create.sh -g -t
  16. else
  17. CREATE:=./scripts/create.sh -g
  18. endif
  19. else
  20. CREATE:=./scripts/create.sh
  21. endif
  22. # target helper text
  23. ifeq ($(ADK_TARGET_FS),archive)
  24. targethelp:
  25. @echo "The RootFS tarball is: $(FW_DIR)/$(ROOTFSTARBALL)"
  26. ifeq ($(ADK_TARGET_QEMU),y)
  27. @echo 'The kernel file is: $(FW_DIR)/${TARGET_KERNEL}'
  28. @echo "Use following command to create a QEMU Image:"
  29. @echo "./scripts/create.sh qemu-${ADK_TARGET_CPU_ARCH}.img $(FW_DIR)/$(ROOTFSTARBALL)"
  30. @echo "Start qemu with following options:"
  31. ifeq ($(ADK_TARGET_QEMU_WITH_BOOTLOADER),y)
  32. @echo 'qemu-system-${QEMU_ARCH} ${QEMU_ARGS} qemu-${ADK_TARGET_CPU_ARCH}.img'
  33. else
  34. @echo 'qemu-system-${QEMU_ARCH} ${QEMU_ARGS} -kernel $(FW_DIR)/$(TARGET_KERNEL) qemu-${ADK_TARGET_CPU_ARCH}.img'
  35. endif
  36. endif
  37. ifeq ($(ADK_HARDWARE_VBOX),y)
  38. @cp $(KERNEL) $(FW_DIR)/$(TARGET_KERNEL)
  39. @echo "Use following command to create a VirtualBox Image:"
  40. @echo "./scripts/create.sh -T vdi vbox-${ADK_TARGET_CPU_ARCH}.img $(FW_DIR)/$(ROOTFSTARBALL)"
  41. endif
  42. endif
  43. ifeq ($(ADK_TARGET_FS),initramfs)
  44. targethelp:
  45. @echo 'The kernel file is: $(FW_DIR)/${TARGET_KERNEL}'
  46. @echo 'The initramfs image is: ${FW_DIR}/${INITRAMFS}'
  47. ifeq ($(ADK_TARGET_QEMU),y)
  48. @echo "Start qemu with following command line:"
  49. @echo 'qemu-system-${QEMU_ARCH} ${QEMU_ARGS} -kernel $(FW_DIR)/$(TARGET_KERNEL) -initrd ${FW_DIR}/${INITRAMFS}'
  50. endif
  51. endif
  52. ifeq ($(ADK_TARGET_FS),initramfs-archive)
  53. targethelp:
  54. @echo 'The kernel file is: $(FW_DIR)/${TARGET_KERNEL}'
  55. @echo "The RootFS tarball is: $(FW_DIR)/$(ROOTFSUSERTARBALL)"
  56. endif
  57. ifeq ($(ADK_TARGET_FS),initramfs-piggyback)
  58. targethelp:
  59. @echo 'The kernel+initramfs file is: $(FW_DIR)/${TARGET_KERNEL}'
  60. ifeq ($(ADK_TARGET_QEMU),y)
  61. @echo "Start qemu with following command line:"
  62. @echo 'qemu-system-${QEMU_ARCH} ${QEMU_ARGS} -kernel $(FW_DIR)/$(TARGET_KERNEL)'
  63. endif
  64. endif
  65. ifeq ($(ADK_TARGET_FS),nfsroot)
  66. targethelp:
  67. @echo 'The kernel file is: $(FW_DIR)/${TARGET_KERNEL}'
  68. @echo 'The nfs root tarball is: ${FW_DIR}/${ROOTFSUSERTARBALL}'
  69. endif
  70. ifeq ($(ADK_TARGET_FS),usb)
  71. targethelp:
  72. @echo 'The root tarball is: ${FW_DIR}/${ROOTFSTARBALL}'
  73. @echo "To install everything to USB use scripts/install.sh"
  74. endif
  75. ifeq ($(ADK_TARGET_FS),iso)
  76. targethelp:
  77. @echo 'ISO image is at $<'
  78. endif
  79. # image creation and kernel install
  80. kernel-strip:
  81. @cp $(KERNEL) $(BUILD_DIR)/$(TARGET_KERNEL)
  82. kernel-install: kernel-strip
  83. @cp $(BUILD_DIR)/$(TARGET_KERNEL) $(FW_DIR)/${TARGET_KERNEL}
  84. # filesystem specific targets
  85. ifeq ($(ADK_TARGET_FS),archive)
  86. imageinstall: $(FW_DIR)/$(ROOTFSTARBALL) targethelp
  87. endif
  88. ifeq ($(ADK_TARGET_FS),initramfs)
  89. imageinstall: kernel-install $(FW_DIR)/$(INITRAMFS) targethelp
  90. endif
  91. ifeq ($(ADK_TARGET_FS),initramfs-archive)
  92. imageinstall: kernel-install $(FW_DIR)/$(ROOTFSUSERTARBALL) targethelp
  93. endif
  94. ifeq ($(ADK_TARGET_FS),initramfs-piggyback)
  95. imageinstall: createinitramfs targethelp
  96. endif
  97. ifeq (${ADK_TARGET_FS},iso)
  98. imageinstall: ${FW_DIR}/${ROOTFSISO} targethelp
  99. endif
  100. ifeq ($(ADK_TARGET_FS),nfsroot)
  101. imageinstall: kernel-install $(FW_DIR)/$(ROOTFSUSERTARBALL) targethelp
  102. endif
  103. ifeq ($(ADK_TARGET_FS),usb)
  104. imageinstall: $(FW_DIR)/$(ROOTFSTARBALL) targethelp
  105. endif