Makefile 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  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. $(TOOLS_BUILD_DIR):
  9. mkdir -p $(TOOLS_BUILD_DIR)
  10. tools-compile: $(TOOLS_BUILD_DIR)
  11. $(MAKE) -C tools/addpattern
  12. $(MAKE) -C tools/srec2bin
  13. $(MAKE) -C ../tools/squashfs prepare compile install
  14. kernel-install: tools-compile
  15. ${TARGET_CROSS}objcopy -S -O srec $(LINUX_DIR)/vmlinuz \
  16. $(LINUX_DIR)/vmlinux.srec
  17. PATH='${TARGET_PATH}' \
  18. srec2bin $(LINUX_DIR)/vmlinux.srec $(LINUX_DIR)/vmlinux.bin
  19. (dd if=/dev/zero bs=16 count=1; cat $(LINUX_DIR)/vmlinux.bin) > \
  20. $(LINUX_DIR)/vmlinux.tmp
  21. PATH='${TARGET_PATH}' \
  22. addpattern -p AG3B -b -r 2.0 -i $(LINUX_DIR)/vmlinux.tmp \
  23. -o $(BIN_DIR)/${ADK_TARGET}-${FS}-kernel 2>/dev/null
  24. ifeq ($(FS),squashfs)
  25. imageinstall: $(BIN_DIR)/$(ROOTFSSQUASHFS)
  26. @if [ $$(stat --format=%s ${BUILD_DIR}/${ROOTFSSQUASHFS}) -gt 3801088 ];then \
  27. echo 'Image is too big!'; \
  28. else \
  29. ${CP} ${BUILD_DIR}/${ROOTFSSQUASHFS} ${BIN_DIR}/${ROOTFSSQUASHFS}; \
  30. echo The image file is $(ROOTFSSQUASHFS); \
  31. echo 'You can flash the image via tftp:'; \
  32. echo 'tftp 192.168.1.1'; \
  33. echo 'tftp> binary'; \
  34. echo "tftp> put $(ROOTFSSQUASHFS) upgrade_code.bin"; \
  35. echo 'Login as user root with password linux123 via ssh or console'; \
  36. fi
  37. endif
  38. ifeq ($(FS),nfsroot)
  39. imageinstall: $(BIN_DIR)/$(ROOTFSUSERTARBALL)
  40. @echo
  41. @echo 'The kernel file is: ${BIN_DIR}/${ADK_TARGET}-${FS}-kernel'
  42. @echo 'The nfs root tarball is: ${BIN_DIR}/${ROOTFSUSERTARBALL}'
  43. @echo 'You can flash the kernel via tftp:'
  44. @echo 'tftp 192.168.1.1'
  45. @echo 'tftp> binary'
  46. @echo 'tftp> put ${ADK_TARGET}-${FS}-kernel upgrade_code.bin'
  47. @echo 'Login as user root with password linux123 via ssh or console'
  48. endif