Makefile 3.8 KB

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