Makefile 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  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_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 scripts/install.sh"
  77. endif
  78. ifeq ($(ADK_TARGET_FS),iso)
  79. targethelp:
  80. @echo 'ISO image is at $<'
  81. endif
  82. # image creation and kernel install
  83. kernel-strip:
  84. @cp $(KERNEL) $(BUILD_DIR)/$(TARGET_KERNEL)
  85. kernel-install: kernel-strip
  86. @cp $(BUILD_DIR)/$(TARGET_KERNEL) $(FW_DIR)/${TARGET_KERNEL}
  87. # filesystem specific targets
  88. ifeq ($(ADK_TARGET_FS),archive)
  89. imageinstall: $(FW_DIR)/$(ROOTFSTARBALL) targethelp
  90. endif
  91. ifeq ($(ADK_TARGET_FS),initramfs)
  92. imageinstall: kernel-install $(FW_DIR)/$(INITRAMFS) targethelp
  93. endif
  94. ifeq ($(ADK_TARGET_FS),initramfsarchive)
  95. imageinstall: kernel-install $(FW_DIR)/$(ROOTFSUSERTARBALL) targethelp
  96. endif
  97. ifeq ($(ADK_TARGET_FS),initramfspiggyback)
  98. imageinstall: createinitramfs targethelp
  99. endif
  100. ifeq (${ADK_TARGET_FS},iso)
  101. imageinstall: ${FW_DIR}/${ROOTFSISO} targethelp
  102. endif
  103. ifeq ($(ADK_TARGET_FS),nfsroot)
  104. imageinstall: kernel-install $(FW_DIR)/$(ROOTFSUSERTARBALL) targethelp
  105. endif
  106. ifeq ($(ADK_TARGET_FS),usb)
  107. imageinstall: $(FW_DIR)/$(ROOTFSTARBALL) targethelp
  108. endif