Makefile 1.9 KB

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