Makefile 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  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)/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_AUDIO),y)
  14. QEMU_ARGS+=-soundhw ac97
  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. # target helper text
  26. ifeq ($(ADK_TARGET_FS),archive)
  27. targethelp:
  28. @echo "The RootFS tarball is: $(FW_DIR)/$(ROOTFSTARBALL)"
  29. ifeq ($(ADK_TARGET_QEMU),y)
  30. @echo 'The kernel file is: $(FW_DIR)/${TARGET_KERNEL}'
  31. @echo "Use following command to create a QEMU Image:"
  32. @echo "./scripts/create.sh qemu-${ADK_TARGET_CPU_ARCH}.img $(FW_DIR)/$(ROOTFSTARBALL)"
  33. @echo "Start qemu with following options:"
  34. ifeq ($(ADK_TARGET_QEMU_WITH_BOOTLOADER),y)
  35. @echo 'qemu-system-${QEMU_ARCH} ${QEMU_ARGS} qemu-${ADK_TARGET_CPU_ARCH}.img'
  36. else
  37. @echo 'qemu-system-${QEMU_ARCH} ${QEMU_ARGS} -kernel $(FW_DIR)/$(TARGET_KERNEL) qemu-${ADK_TARGET_CPU_ARCH}.img'
  38. endif
  39. endif
  40. ifeq ($(ADK_HARDWARE_VBOX),y)
  41. @cp $(KERNEL) $(FW_DIR)/$(TARGET_KERNEL)
  42. @echo "Use following command to create a VirtualBox Image:"
  43. @echo "./scripts/create.sh -T vdi vbox-${ADK_TARGET_CPU_ARCH}.img $(FW_DIR)/$(ROOTFSTARBALL)"
  44. endif
  45. endif
  46. ifeq ($(ADK_TARGET_FS),initramfs)
  47. targethelp:
  48. @echo 'The kernel file is: $(FW_DIR)/${TARGET_KERNEL}'
  49. @echo 'The initramfs image is: ${FW_DIR}/${INITRAMFS}'
  50. ifeq ($(ADK_TARGET_QEMU),y)
  51. @echo "Start qemu with following command line:"
  52. @echo 'qemu-system-${QEMU_ARCH} ${QEMU_ARGS} -kernel $(FW_DIR)/$(TARGET_KERNEL) -initrd ${FW_DIR}/${INITRAMFS}'
  53. endif
  54. endif
  55. ifeq ($(ADK_TARGET_FS),initramfsarchive)
  56. targethelp:
  57. @echo 'The kernel file is: $(FW_DIR)/${TARGET_KERNEL}'
  58. @echo "The RootFS tarball is: $(FW_DIR)/$(ROOTFSUSERTARBALL)"
  59. endif
  60. ifeq ($(ADK_TARGET_FS),initramfspiggyback)
  61. targethelp:
  62. @echo 'The kernel+initramfs file is: $(FW_DIR)/${TARGET_KERNEL}'
  63. ifeq ($(ADK_TARGET_QEMU),y)
  64. @echo "Start qemu with following command line:"
  65. @echo 'qemu-system-${QEMU_ARCH} ${QEMU_ARGS} -kernel $(FW_DIR)/$(TARGET_KERNEL)'
  66. endif
  67. endif
  68. ifeq ($(ADK_TARGET_FS),nfsroot)
  69. targethelp:
  70. @echo 'The kernel file is: $(FW_DIR)/${TARGET_KERNEL}'
  71. @echo 'The nfs root tarball is: ${FW_DIR}/${ROOTFSUSERTARBALL}'
  72. endif
  73. ifeq ($(ADK_TARGET_FS),usb)
  74. targethelp:
  75. @echo 'The root tarball is: ${FW_DIR}/${ROOTFSTARBALL}'
  76. @echo "To install everything to USB use:"
  77. @echo "sudo ./scripts/install.sh -g -t default /dev/sdX $(FW_DIR)/$(ROOTFSTARBALL)"
  78. endif
  79. ifeq ($(ADK_TARGET_FS),iso)
  80. targethelp:
  81. @echo 'ISO image is at $<'
  82. endif
  83. # image creation and kernel install
  84. kernel-strip:
  85. @cp $(KERNEL) $(BUILD_DIR)/$(TARGET_KERNEL)
  86. kernel-install: kernel-strip
  87. @cp $(BUILD_DIR)/$(TARGET_KERNEL) $(FW_DIR)/${TARGET_KERNEL}
  88. # filesystem specific targets
  89. ifeq ($(ADK_TARGET_FS),archive)
  90. imageinstall: $(FW_DIR)/$(ROOTFSTARBALL) targethelp
  91. endif
  92. ifeq ($(ADK_TARGET_FS),initramfs)
  93. imageinstall: kernel-install $(FW_DIR)/$(INITRAMFS) targethelp
  94. endif
  95. ifeq ($(ADK_TARGET_FS),initramfsarchive)
  96. imageinstall: kernel-install $(FW_DIR)/$(ROOTFSUSERTARBALL) targethelp
  97. endif
  98. ifeq ($(ADK_TARGET_FS),initramfspiggyback)
  99. imageinstall: createinitramfs targethelp
  100. endif
  101. ifeq (${ADK_TARGET_FS},iso)
  102. imageinstall: ${FW_DIR}/${ROOTFSISO} targethelp
  103. endif
  104. ifeq ($(ADK_TARGET_FS),nfsroot)
  105. imageinstall: kernel-install $(FW_DIR)/$(ROOTFSUSERTARBALL) targethelp
  106. endif
  107. ifeq ($(ADK_TARGET_FS),usb)
  108. imageinstall: $(FW_DIR)/$(ROOTFSTARBALL) targethelp
  109. endif