Makefile 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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: kernel-install $(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. fi
  36. endif
  37. ifeq ($(FS),nfsroot)
  38. imageinstall: kernel-install $(BIN_DIR)/$(ROOTFSUSERTARBALL)
  39. @echo 'The kernel file is: ${BIN_DIR}/${ADK_TARGET}-${FS}-kernel'
  40. @echo 'The nfs root tarball is: ${BIN_DIR}/${ROOTFSUSERTARBALL}'
  41. @echo 'You can flash the kernel via tftp:'
  42. @echo 'tftp 192.168.1.1'
  43. @echo 'tftp> binary'
  44. @echo 'tftp> put ${ADK_TARGET}-${FS}-kernel upgrade_code.bin'
  45. endif