Makefile 4.2 KB

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