Makefile 3.3 KB

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