Makefile 3.4 KB

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