Makefile 2.5 KB

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