1
0

Makefile 4.1 KB

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