Makefile 3.0 KB

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