Makefile 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  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 $(TOPDIR)/rules.mk
  4. include $(TOPDIR)/mk/kernel.mk
  5. include $(TOPDIR)/mk/modules.mk
  6. include $(TOPDIR)/mk/kernel-build.mk
  7. include $(TOPDIR)/mk/image.mk
  8. ifeq ($(ADK_TARGET_KERNEL_ZIMAGE),y)
  9. KERNEL:=$(LINUX_DIR)/arch/arm/boot/zImage
  10. else
  11. KERNEL:=$(LINUX_DIR)/$(ADK_TARGET_KERNEL)
  12. endif
  13. LOADADDR:=0x20008000
  14. ifeq ($(ADK_TARGET_QEMU_ARM_MODEL_SPITZ),y)
  15. MACH:=spitz
  16. endif
  17. ifeq ($(ADK_TARGET_QEMU_ARM_MODEL_VERSATILE),y)
  18. MACH:=versatilepb
  19. NET:=-net user,hostfwd=tcp::2222-:22 -net nic,model=smc91c111
  20. endif
  21. kernel-install:
  22. gzip -9 < $(LINUX_DIR)/arch/arm/boot/Image > ${BUILD_DIR}/Image.gz
  23. PATH='${TARGET_PATH}' mkimage -A arm -O linux -T kernel -C gzip \
  24. -a ${LOADADDR} -e ${LOADADDR} -d ${BUILD_DIR}/Image.gz \
  25. -n foxg20 $(KERNEL) $(MAKE_TRACE)
  26. ifeq ($(ADK_TARGET_FS),nfsroot)
  27. imageinstall: kernel-install ${BIN_DIR}/${ROOTFSUSERTARBALL}
  28. @cp $(KERNEL) $(BIN_DIR)/$(TARGET_KERNEL)
  29. @echo 'Type dhcp via u-boot prompt to load kernel'
  30. @echo 'After that type bootm to load the kernel'
  31. endif
  32. ifeq ($(ADK_TARGET_FS),mmc)
  33. imageinstall: kernel-install $(BIN_DIR)/$(ROOTFSTARBALL)
  34. @echo "The RootFS tarball is:"
  35. @echo "$(BIN_DIR)/$(ROOTFSTARBALL)"
  36. @echo 'Before booting from MicroSD card you need to set following u-boot environment variable:'
  37. @echo "setenv bootcmd 'mmc init; sleep 1; fatload mmc 0 0x22000000 kernel; bootm 0x22000000'"
  38. @echo "saveenv"
  39. @echo
  40. @echo "Boot the board via network and use adkinstall."
  41. @echo "If you just want to update, use adkupdate."
  42. endif
  43. ifeq ($(ADK_TARGET_FS),archive)
  44. ifeq ($(ADK_TARGET_SYSTEM_ACMESYSTEMS_FOXG20),y)
  45. imageinstall: kernel-install $(BIN_DIR)/$(ROOTFSTARBALL)
  46. else
  47. imageinstall: $(BIN_DIR)/$(ROOTFSTARBALL)
  48. endif
  49. @echo "The RootFS tarball is: $(BIN_DIR)/$(ROOTFSTARBALL)"
  50. ifeq ($(ADK_TARGET_SYSTEM_RASPBERRY_PI),y)
  51. @echo "Use following command to install it on SD card:"
  52. @echo "sudo ./scripts/install-rpi.sh /dev/sdb $(BIN_DIR)/$(ROOTFSTARBALL)"
  53. endif
  54. ifeq ($(ADK_TARGET_SYSTEM_QEMU_ARM),y)
  55. @cp $(KERNEL) $(BIN_DIR)/$(TARGET_KERNEL)
  56. @echo 'The kernel file is: $(BIN_DIR)/${TARGET_KERNEL}'
  57. @echo "Use following command to create a QEMU Image:"
  58. @echo "./scripts/create.sh +g qemu-${CPU_ARCH}.img $(BIN_DIR)/$(ROOTFSTARBALL)"
  59. @echo "Start qemu with following options:"
  60. @echo 'qemu-system-arm -M $(MACH) -nographic $(NET) -kernel $(BIN_DIR)/$(TARGET_KERNEL) -hda qemu-${CPU_ARCH}.img'
  61. endif
  62. endif
  63. ifeq ($(ADK_TARGET_FS),initramfs)
  64. imageinstall: $(BIN_DIR)/$(INITRAMFS)
  65. @cp $(KERNEL) $(BIN_DIR)/$(TARGET_KERNEL)
  66. @echo 'The kernel file is: $(BIN_DIR)/${TARGET_KERNEL}'
  67. @echo 'The initramfs image is: ${BIN_DIR}/${INITRAMFS}'
  68. ifeq ($(ADK_TARGET_SYSTEM_QEMU_ARM),y)
  69. @echo "Start qemu with following command line:"
  70. @echo 'qemu-system-arm -M $(MACH) -nographic $(NET) -kernel $(BIN_DIR)/$(TARGET_KERNEL) -initrd ${BIN_DIR}/${INITRAMFS}'
  71. endif
  72. endif
  73. ifeq ($(ADK_TARGET_FS),initramfs-piggyback)
  74. imageinstall: createinitramfs
  75. @cp $(KERNEL) $(BIN_DIR)/$(TARGET_KERNEL)
  76. @echo 'The kernel+initramfs file is: $(BIN_DIR)/${TARGET_KERNEL}'
  77. ifeq ($(ADK_TARGET_SYSTEM_QEMU_ARM),y)
  78. @echo "Start qemu with following command line:"
  79. @echo 'qemu-system-arm -M $(MACH) -nographic $(NET) -kernel $(BIN_DIR)/$(TARGET_KERNEL)'
  80. endif
  81. endif