Makefile 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  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. endif
  42. ifeq ($(ADK_TARGET_FS),initramfs)
  43. targethelp:
  44. @echo 'The kernel file is: $(FW_DIR)/${TARGET_KERNEL}'
  45. @echo 'The initramfs image is: ${FW_DIR}/${INITRAMFS}'
  46. ifeq ($(ADK_TARGET_QEMU),y)
  47. @echo "Start qemu with following command line:"
  48. @echo 'qemu-system-${QEMU_ARCH} ${QEMU_ARGS} -kernel $(FW_DIR)/$(TARGET_KERNEL) -initrd ${FW_DIR}/${INITRAMFS}'
  49. endif
  50. endif
  51. ifeq ($(ADK_TARGET_FS),initramfsarchive)
  52. targethelp:
  53. @echo 'The kernel file is: $(FW_DIR)/${TARGET_KERNEL}'
  54. @echo "The RootFS tarball is: $(FW_DIR)/$(ROOTFSUSERTARBALL)"
  55. endif
  56. ifeq ($(ADK_TARGET_FS),initramfspiggyback)
  57. targethelp:
  58. @echo 'The kernel+initramfs file is: $(FW_DIR)/${TARGET_KERNEL}'
  59. ifeq ($(ADK_TARGET_QEMU),y)
  60. @echo "Start qemu with following command line:"
  61. @echo 'qemu-system-${QEMU_ARCH} ${QEMU_ARGS} -kernel $(FW_DIR)/$(TARGET_KERNEL)'
  62. endif
  63. endif
  64. ifeq ($(ADK_TARGET_FS),nfsroot)
  65. targethelp:
  66. @echo 'The kernel file is: $(FW_DIR)/${TARGET_KERNEL}'
  67. @echo 'The nfs root tarball is: ${FW_DIR}/${ROOTFSUSERTARBALL}'
  68. endif
  69. ifeq ($(ADK_TARGET_FS),usb)
  70. targethelp:
  71. @echo 'The root tarball is: ${FW_DIR}/${ROOTFSTARBALL}'
  72. @echo "To install everything to USB use scripts/install.sh"
  73. endif
  74. ifeq ($(ADK_TARGET_FS),iso)
  75. targethelp:
  76. @echo 'ISO image is at $<'
  77. endif
  78. ifeq ($(ADK_TARGET_FS),genimage)
  79. targethelp:
  80. @echo "The disk image is: $(FW_DIR)/disk.img"
  81. ifeq ($(ADK_TARGET_QEMU),y)
  82. @echo "Start qemu with following command line:"
  83. @echo 'qemu-system-${QEMU_ARCH} ${QEMU_ARGS} $(FW_DIR)/disk.img'
  84. else
  85. @echo "Use following command to install it on SD card:"
  86. @echo 'sudo dd if=$(FW_DIR)/disk.img of=/dev/sdX bs=2048k'
  87. endif
  88. endif
  89. # image creation and kernel install
  90. kernel-strip:
  91. @cp $(KERNEL) $(BUILD_DIR)/$(TARGET_KERNEL)
  92. kernel-install: kernel-strip
  93. @cp $(BUILD_DIR)/$(TARGET_KERNEL) $(FW_DIR)/${TARGET_KERNEL}
  94. # filesystem specific targets
  95. ifeq ($(ADK_TARGET_FS),archive)
  96. imageinstall: $(FW_DIR)/$(ROOTFSTARBALL) targethelp
  97. endif
  98. ifeq ($(ADK_TARGET_FS),initramfs)
  99. imageinstall: kernel-install $(FW_DIR)/$(INITRAMFS) targethelp
  100. endif
  101. ifeq ($(ADK_TARGET_FS),initramfsarchive)
  102. imageinstall: kernel-install $(FW_DIR)/$(ROOTFSUSERTARBALL) targethelp
  103. endif
  104. ifeq ($(ADK_TARGET_FS),initramfspiggyback)
  105. imageinstall: createinitramfs targethelp
  106. endif
  107. ifeq (${ADK_TARGET_FS},genimage)
  108. imageinstall: ${FW_DIR}/${GENIMAGE} targethelp
  109. endif
  110. ifeq (${ADK_TARGET_FS},iso)
  111. imageinstall: ${FW_DIR}/${ROOTFSISO} targethelp
  112. endif
  113. ifeq ($(ADK_TARGET_FS),nfsroot)
  114. imageinstall: kernel-install $(FW_DIR)/$(ROOTFSUSERTARBALL) targethelp
  115. endif
  116. ifeq ($(ADK_TARGET_FS),usb)
  117. imageinstall: $(FW_DIR)/$(ROOTFSTARBALL) targethelp
  118. endif