Makefile 2.6 KB

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