Makefile 2.7 KB

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