1
0

Makefile 3.6 KB

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