Makefile 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  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. tools-compile:
  24. $(MAKE) -C ../tools/uboot-mkimage
  25. kernel-install: tools-compile
  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. imageinstall: $(BIN_DIR)/$(ROOTFSTARBALL)
  49. @cp $(KERNEL) $(BIN_DIR)/$(TARGET_KERNEL)
  50. @echo 'The kernel file is: $(BIN_DIR)/${TARGET_KERNEL}'
  51. @echo "The RootFS tarball is: $(BIN_DIR)/$(ROOTFSTARBALL)"
  52. ifeq ($(ADK_TARGET_SYSTEM_QEMU_ARM),y)
  53. @echo "Use following command to create a QEMU Image:"
  54. @echo "sudo ./scripts/create-image.sh -f $(ADK_TARGET_ROOTFS) qemu-${CPU_ARCH}.img $(BIN_DIR)/$(ROOTFSTARBALL)"
  55. @echo "Start qemu with following options:"
  56. @echo 'qemu-system-arm -M $(MACH) -nographic $(NET) -kernel $(BIN_DIR)/$(TARGET_KERNEL) -hda qemu-${CPU_ARCH}.img'
  57. endif
  58. endif
  59. ifeq ($(ADK_TARGET_FS),initramfs)
  60. imageinstall: $(BIN_DIR)/$(INITRAMFS)
  61. @cp $(KERNEL) $(BIN_DIR)/$(TARGET_KERNEL)
  62. @echo 'The kernel file is: $(BIN_DIR)/${TARGET_KERNEL}'
  63. @echo 'The initramfs image is: ${BIN_DIR}/${INITRAMFS}'
  64. ifeq ($(ADK_TARGET_SYSTEM_QEMU_ARM),y)
  65. @echo "Start qemu with following command line:"
  66. @echo 'qemu-system-arm -M $(MACH) -nographic $(NET) -kernel $(BIN_DIR)/$(TARGET_KERNEL) -initrd ${BIN_DIR}/${INITRAMFS}'
  67. endif
  68. endif
  69. ifeq ($(ADK_TARGET_FS),initramfs-piggyback)
  70. imageinstall: ${BUILD_DIR}/${INITRAMFS_PIGGYBACK} createinitramfs
  71. @cp $(KERNEL) $(BIN_DIR)/$(TARGET_KERNEL)
  72. @echo 'The kernel+initramfs file is: $(BIN_DIR)/${TARGET_KERNEL}'
  73. ifeq ($(ADK_TARGET_SYSTEM_QEMU_ARM),y)
  74. @echo "Start qemu with following command line:"
  75. @echo 'qemu-system-arm -M $(MACH) -nographic $(NET) -kernel $(BIN_DIR)/$(TARGET_KERNEL)'
  76. endif
  77. endif