Makefile 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. # $Id: Makefile 30 2008-09-04 13:31:09Z wbx $
  2. #-
  3. # This file is part of the OpenADK project. OpenADK is copyrighted
  4. # material, please see the LICENCE file in the top-level directory.
  5. include $(TOPDIR)/rules.mk
  6. include $(TOPDIR)/mk/kernel.mk
  7. include $(TOPDIR)/mk/modules.mk
  8. include $(TOPDIR)/mk/kernel-build.mk
  9. include $(TOPDIR)/mk/image.mk
  10. $(TOOLS_BUILD_DIR):
  11. mkdir -p $(TOOLS_BUILD_DIR)
  12. tools-compile: $(TOOLS_BUILD_DIR)
  13. $(MAKE) -C tools/addpattern
  14. $(MAKE) -C tools/srec2bin
  15. $(MAKE) -C tools/squashfs prepare compile install
  16. kernel-install: tools-compile
  17. PATH='${TARGET_PATH}' \
  18. mipsel-linux-objcopy -S -O srec $(LINUX_DIR)/vmlinux \
  19. $(LINUX_DIR)/vmlinux.srec
  20. PATH='${TARGET_PATH}' \
  21. srec2bin $(LINUX_DIR)/vmlinux.srec $(LINUX_DIR)/vmlinux.bin
  22. (dd if=/dev/zero bs=16 count=1; cat $(LINUX_DIR)/vmlinux.bin) > \
  23. $(LINUX_DIR)/vmlinux.tmp
  24. PATH='${TARGET_PATH}' \
  25. addpattern -p AG3B -b -r 2.0 -i $(LINUX_DIR)/vmlinux.tmp \
  26. -o $(BIN_DIR)/${ADK_TARGET}-${ARCH}-kernel
  27. ifeq ($(FS),squashfs)
  28. imageinstall: $(BIN_DIR)/$(ROOTFSSQUASHFS)
  29. @if [ $$(stat --format=%s ${BUILD_DIR}/${ROOTFSSQUASHFS}) -gt 3801088 ];then \
  30. echo 'Image is too big!'; \
  31. else \
  32. ${CP} ${BUILD_DIR}/${ROOTFSSQUASHFS} ${BIN_DIR}/${ROOTFSSQUASHFS}; \
  33. echo The image file is $(ROOTFSSQUASHFS); \
  34. echo 'You can flash the image via tftp:'; \
  35. echo 'tftp 192.168.1.1'; \
  36. echo 'tftp> binary'; \
  37. echo "tftp> put $(ROOTFSSQUASHFS) upgrade_code.bin"; \
  38. echo 'Login as user root with password linux123 via ssh or console'; \
  39. fi
  40. endif
  41. ifeq ($(FS),nfsroot)
  42. imageinstall: $(BIN_DIR)/$(ROOTFSTARBALL)
  43. @echo
  44. @echo 'The kernel file is: ${BIN_DIR}/${ADK_TARGET}-${ARCH}-kernel'
  45. @echo 'The nfs root tarball is: ${BIN_DIR}/${ROOTFSTARBALL}'
  46. @echo 'You can flash the kernel via tftp:'
  47. @echo 'tftp 192.168.1.1'
  48. @echo 'tftp> binary'
  49. @echo 'tftp> put ag241-mips-kernel upgrade_code.bin'
  50. @echo 'Login as user root with password linux123 via ssh or console'
  51. endif