Makefile 4.1 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:=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. ifeq ($(ADK_TARGET_QEMU),y)
  87. @echo "Start qemu with following command line:"
  88. @echo 'qemu-system-${QEMU_ARCH} ${QEMU_ARGS} $(FW_DIR)/disk.img'
  89. else
  90. @echo "Use following command to install it on SD card:"
  91. @echo 'sudo dd if=$(FW_DIR)/disk.img of=/dev/sdX bs=2048k'
  92. endif
  93. endif
  94. # image creation and kernel install
  95. kernel-strip:
  96. @cp $(KERNEL) $(BUILD_DIR)/$(TARGET_KERNEL)
  97. kernel-install: kernel-strip
  98. @cp $(BUILD_DIR)/$(TARGET_KERNEL) $(FW_DIR)/${TARGET_KERNEL}
  99. # filesystem specific targets
  100. ifeq ($(ADK_TARGET_FS),archive)
  101. imageinstall: $(FW_DIR)/$(ROOTFSTARBALL) targethelp
  102. endif
  103. ifeq ($(ADK_TARGET_FS),initramfs)
  104. imageinstall: kernel-install $(FW_DIR)/$(INITRAMFS) targethelp
  105. endif
  106. ifeq ($(ADK_TARGET_FS),initramfsarchive)
  107. imageinstall: kernel-install $(FW_DIR)/$(ROOTFSUSERTARBALL) targethelp
  108. endif
  109. ifeq ($(ADK_TARGET_FS),initramfspiggyback)
  110. imageinstall: createinitramfs targethelp
  111. endif
  112. ifeq (${ADK_TARGET_FS},genimage)
  113. imageinstall: ${FW_DIR}/${GENIMAGE} targethelp
  114. endif
  115. ifeq (${ADK_TARGET_FS},iso)
  116. imageinstall: ${FW_DIR}/${ROOTFSISO} targethelp
  117. endif
  118. ifeq ($(ADK_TARGET_FS),nfsroot)
  119. imageinstall: kernel-install $(FW_DIR)/$(ROOTFSUSERTARBALL) targethelp
  120. endif
  121. ifeq ($(ADK_TARGET_FS),usb)
  122. imageinstall: $(FW_DIR)/$(ROOTFSTARBALL) targethelp
  123. endif