1
0

Makefile 3.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  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/cris/boot/zImage
  9. KERNEL:=$(LINUX_DIR)/vmlinux
  10. tools-compile:
  11. $(MAKE) -C ../tools/mkfimage all
  12. ifneq ($(ADK_HOST_DARWIN),y)
  13. $(MAKE) -C ../tools/e100boot all
  14. endif
  15. $(MAKE) -C ../tools/squashfs all
  16. $(INSTALL_BIN) ../tools/boot_linux $(BIN_DIR)/
  17. kernel-install: tools-compile
  18. PATH='${TARGET_PATH}' mkfimage $(ZKERNEL) $(BUILD_DIR)/$(TARGET_KERNEL) $(MAKE_TRACE)
  19. ${BUILD_DIR}/${ROOTFSSQUASHFS}: ${BUILD_DIR}/root.squashfs
  20. cat ${BUILD_DIR}/${TARGET_KERNEL} ${BUILD_DIR}/root.squashfs \
  21. >${BUILD_DIR}/${ROOTFSSQUASHFS}
  22. ifeq ($(ADK_TARGET_FS),squashfs)
  23. imageinstall: kernel-install $(BUILD_DIR)/$(ROOTFSSQUASHFS)
  24. dd if=${BUILD_DIR}/${ROOTFSSQUASHFS} of=${BIN_DIR}/${ROOTFSSQUASHFS} \
  25. bs=4063232 conv=sync $(MAKE_TRACE)
  26. @if [ $$($(STATCMD) ${BIN_DIR}/${ROOTFSSQUASHFS}) -gt 4063232 ];then \
  27. echo 'Image is too big!'; \
  28. else \
  29. echo 'Use sudo ./boot_linux -F -i $(ROOTFSSQUASHFS) to flash'; \
  30. echo 'Do not forget to set the network boot jumper, before you start the foxboard'; \
  31. fi
  32. endif
  33. ifeq ($(ADK_TARGET_FS),nfsroot)
  34. imageinstall: kernel-install ${BIN_DIR}/${ROOTFSUSERTARBALL}
  35. @cp $(BUILD_DIR)/$(TARGET_KERNEL) $(BIN_DIR)/$(TARGET_KERNEL)
  36. @echo Use sudo ./boot_linux -F -i $(BIN_DIR)/${TARGET_KERNEL} to flash the kernel
  37. @echo Do not forget to set network boot jumper, before you start the foxboard
  38. @echo ${ROOTFSUSERTARBALL} is your nfs root and can be extracted on your nfs server
  39. endif
  40. ifeq ($(ADK_TARGET_FS),archive)
  41. imageinstall: $(BIN_DIR)/$(ROOTFSTARBALL)
  42. @cp $(KERNEL) $(BIN_DIR)/$(TARGET_KERNEL)
  43. @echo 'The kernel file is: $(BIN_DIR)/${TARGET_KERNEL}'
  44. @echo "The RootFS tarball is: $(BIN_DIR)/$(ROOTFSTARBALL)"
  45. ifeq ($(ADK_TARGET_SYSTEM_QEMU_CRIS),y)
  46. @echo "Use following command to create a QEMU Image:"
  47. @echo "sudo ./scripts/create-image.sh -f ${ADK_TARGET_ROOTFS} qemu-${CPU_ARCH}.img $(BIN_DIR)/$(ROOTFSTARBALL)"
  48. @echo "Start qemu with following command line:"
  49. @echo 'qemu-system-cris -M axis-dev88 -nographic -kernel $(BIN_DIR)/$(TARGET_KERNEL) qemu-${CPU_ARCH}.img'
  50. endif
  51. endif
  52. ifeq ($(ADK_TARGET_FS),initramfs)
  53. imageinstall: $(BIN_DIR)/$(INITRAMFS)
  54. @cp $(KERNEL) $(BIN_DIR)/$(TARGET_KERNEL)
  55. @echo 'The kernel file is: $(BIN_DIR)/${TARGET_KERNEL}'
  56. @echo 'The initramfs image is: ${BIN_DIR}/${INITRAMFS}'
  57. ifeq ($(ADK_TARGET_SYSTEM_QEMU_CRIS),y)
  58. @echo "Start qemu with following command line:"
  59. @echo 'qemu-system-cris -M axis-dev88 -nographic -kernel $(BIN_DIR)/$(TARGET_KERNEL) -initrd ${BIN_DIR}/${INITRAMFS}'
  60. endif
  61. endif
  62. ifeq ($(ADK_TARGET_FS),initramfs-piggyback)
  63. imageinstall: createinitramfs
  64. @cp $(KERNEL) $(BIN_DIR)/${TARGET_KERNEL}
  65. @echo 'The kernel+initramfs file is: $(BIN_DIR)/${TARGET_KERNEL}'
  66. ifeq ($(ADK_TARGET_SYSTEM_QEMU_CRIS),y)
  67. @echo "Start qemu with following command line:"
  68. @echo 'qemu-system-cris -M axis-dev88 -nographic -kernel $(BIN_DIR)/$(TARGET_KERNEL)'
  69. endif
  70. endif