Makefile 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  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:=i386
  8. QEMU_ARGS:=-M pc
  9. QEMU_ARGS+=${ADK_QEMU_ARGS}
  10. QEMU_ARGS+=-net user -net nic,model=e1000
  11. ifeq ($(ADK_PACKAGE_GRUB_EFI_X86),y)
  12. QEMU_ARGS+=-L . -bios bios-x86.bin
  13. endif
  14. ifeq ($(ADK_TARGET_QEMU_WITH_AUDIO),y)
  15. QEMU_ARGS+=-soundhw 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_TARGET_VBOX),y)
  42. @cp $(KERNEL) $(FW_DIR)/$(TARGET_KERNEL)
  43. @echo "Use following command to create a VirtualBox Image:"
  44. @echo "./scripts/create.sh -g -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 use scripts/install.sh"
  78. endif
  79. ifeq ($(ADK_TARGET_FS),iso)
  80. targethelp:
  81. @echo 'ISO image is at $<'
  82. endif
  83. ifeq ($(ADK_TARGET_FS),genimage)
  84. targethelp:
  85. @echo "The disk image is: $(FW_DIR)/disk.img"
  86. @echo "Use following command to install it on SD card:"
  87. ifeq ($(ADK_TARGET_QEMU),y)
  88. @echo 'qemu-system-${QEMU_ARCH} ${QEMU_ARGS} $(FW_DIR)/disk.img'
  89. else
  90. @echo 'sudo dd if=$(FW_DIR)/disk.img of=/dev/sdX bs=2048k'
  91. endif
  92. endif
  93. # image creation and kernel install
  94. kernel-strip:
  95. @cp $(KERNEL) $(BUILD_DIR)/$(TARGET_KERNEL)
  96. kernel-install: kernel-strip
  97. @cp $(BUILD_DIR)/$(TARGET_KERNEL) $(FW_DIR)/${TARGET_KERNEL}
  98. # filesystem specific targets
  99. ifeq ($(ADK_TARGET_FS),archive)
  100. imageinstall: $(FW_DIR)/$(ROOTFSTARBALL) targethelp
  101. endif
  102. ifeq ($(ADK_TARGET_FS),initramfs)
  103. imageinstall: kernel-install $(FW_DIR)/$(INITRAMFS) targethelp
  104. endif
  105. ifeq ($(ADK_TARGET_FS),initramfsarchive)
  106. imageinstall: kernel-install $(FW_DIR)/$(ROOTFSUSERTARBALL) targethelp
  107. endif
  108. ifeq ($(ADK_TARGET_FS),initramfspiggyback)
  109. imageinstall: createinitramfs targethelp
  110. endif
  111. ifeq (${ADK_TARGET_FS},genimage)
  112. imageinstall: ${FW_DIR}/${GENIMAGE} targethelp
  113. endif
  114. ifeq (${ADK_TARGET_FS},iso)
  115. imageinstall: ${FW_DIR}/${ROOTFSISO} targethelp
  116. endif
  117. ifeq ($(ADK_TARGET_FS),nfsroot)
  118. imageinstall: kernel-install $(FW_DIR)/$(ROOTFSUSERTARBALL) targethelp
  119. endif
  120. ifeq ($(ADK_TARGET_FS),usb)
  121. imageinstall: $(FW_DIR)/$(ROOTFSTARBALL) targethelp
  122. endif