1
0

Makefile 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  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_ARGS:=-M pc
  10. QEMU_ARGS+=${ADK_QEMU_ARGS}
  11. ifeq ($(ADK_TARGET_SYSTEM_QEMU_X86_64_32),y)
  12. QEMU_ARCH:=x86_84
  13. else
  14. QEMU_ARCH:=i386
  15. endif
  16. ifeq ($(ADK_TARGET_QEMU_WITH_BOOTLOADER),y)
  17. ifeq ($(ADK_TARGET_QEMU_WITHOUT_GRAPHIC),y)
  18. CREATE:=./scripts/create.sh -g -t
  19. else
  20. CREATE:=./scripts/create.sh -g
  21. endif
  22. else
  23. CREATE:=./scripts/create.sh
  24. endif
  25. ifeq ($(ADK_TARGET_FS),genext2fs)
  26. imageinstall: $(FW_DIR)/$(ROOTFSTARBALL)
  27. @echo "The RootFS tarball is: $(FW_DIR)/$(ROOTFSTARBALL)"
  28. @echo "To install everything to CompactFlash use scripts/genext2.sh"
  29. endif
  30. ifeq ($(ADK_TARGET_FS),cf)
  31. imageinstall: $(FW_DIR)/$(ROOTFSTARBALL)
  32. @echo "The RootFS tarball is: $(FW_DIR)/$(ROOTFSTARBALL)"
  33. @echo "To install everything to CompactFlash use scripts/install.sh"
  34. endif
  35. ifeq ($(ADK_TARGET_FS),nfsroot)
  36. imageinstall: $(FW_DIR)/$(ROOTFSUSERTARBALL)
  37. @cp $(KERNEL) $(FW_DIR)/$(TARGET_KERNEL)
  38. @echo 'The linux kernel is here: $(FW_DIR)/$(TARGET_KERNEL)'
  39. @echo 'The nfs root tarball is: ${FW_DIR}/${ROOTFSUSERTARBALL}'
  40. endif
  41. ifeq ($(ADK_TARGET_FS),archive)
  42. imageinstall: $(FW_DIR)/$(ROOTFSTARBALL)
  43. @echo "The RootFS tarball is: $(FW_DIR)/$(ROOTFSTARBALL)"
  44. ifeq ($(ADK_HARDWARE_QEMU),y)
  45. @cp $(KERNEL) $(FW_DIR)/$(TARGET_KERNEL)
  46. @echo "Use following command to create a QEMU Image:"
  47. @echo "$(CREATE) qemu-${CPU_ARCH}.img $(FW_DIR)/$(ROOTFSTARBALL)"
  48. @echo "Start qemu with following command line:"
  49. ifeq ($(ADK_TARGET_QEMU_WITH_BOOTLOADER),y)
  50. @echo 'qemu-system-${QEMU_ARCH} ${QEMU_ARGS} -net user -net nic,model=e1000 qemu-${CPU_ARCH}.img'
  51. else
  52. @echo 'qemu-system-${QEMU_ARCH} ${QEMU_ARGS} -net user -net nic,model=e1000 -kernel $(FW_DIR)/$(TARGET_KERNEL) qemu-${CPU_ARCH}.img'
  53. endif
  54. endif
  55. ifeq ($(ADK_HARDWARE_VBOX),y)
  56. @cp $(KERNEL) $(FW_DIR)/$(TARGET_KERNEL)
  57. @echo "Use following command to create a VirtualBox Image:"
  58. @echo "./scripts/create.sh -T vdi vbox-${CPU_ARCH}.img $(FW_DIR)/$(ROOTFSTARBALL)"
  59. endif
  60. endif
  61. ifeq ($(ADK_TARGET_FS),initramfsarchive)
  62. imageinstall: $(FW_DIR)/$(ROOTFSUSERTARBALL)
  63. @cp $(KERNEL) $(FW_DIR)/$(TARGET_KERNEL)
  64. @echo 'The kernel file is: $(FW_DIR)/${TARGET_KERNEL}'
  65. @echo "The RootFS tarball is: $(FW_DIR)/$(ROOTFSUSERTARBALL)"
  66. endif
  67. ifeq ($(ADK_TARGET_FS),usb)
  68. imageinstall: $(FW_DIR)/$(ROOTFSTARBALL)
  69. @echo "The RootFS tarball is: $(FW_DIR)/$(ROOTFSTARBALL)"
  70. @echo "To install everything to USB use scripts/install.sh"
  71. endif
  72. ifeq ($(ADK_TARGET_FS),initramfs)
  73. imageinstall: $(FW_DIR)/$(INITRAMFS)
  74. @cp $(KERNEL) $(FW_DIR)/$(TARGET_KERNEL)
  75. @echo 'The kernel file is: $(FW_DIR)/${TARGET_KERNEL}'
  76. @echo 'The initramfs image is: ${FW_DIR}/${INITRAMFS}'
  77. ifeq ($(ADK_HARDWARE_QEMU),y)
  78. @echo "Start qemu with following command line:"
  79. @echo 'qemu-system-${QEMU_ARCH} ${QEMU_ARGS} -net user -net nic,model=e1000 -kernel $(FW_DIR)/$(TARGET_KERNEL) -initrd ${FW_DIR}/${INITRAMFS}'
  80. endif
  81. endif
  82. ifeq ($(ADK_TARGET_FS),initramfs-piggyback)
  83. imageinstall: createinitramfs
  84. @cp $(KERNEL) $(FW_DIR)/${TARGET_KERNEL}
  85. @echo 'The kernel+initramfs file is: $(FW_DIR)/${TARGET_KERNEL}'
  86. ifeq ($(ADK_HARDWARE_QEMU),y)
  87. @echo "Start qemu with following command line:"
  88. @echo 'qemu-system-${QEMU_ARCH} ${QEMU_ARGS} -net user -net nic,model=e1000 -kernel $(FW_DIR)/$(TARGET_KERNEL)'
  89. endif
  90. endif
  91. ifeq (${ADK_TARGET_FS},iso)
  92. imageinstall: ${FW_DIR}/${ROOTFSISO}
  93. @echo 'ISO image is at $<'
  94. endif