Makefile 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  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. $(TARGET_CROSS)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 WA21 -i $(LINUX_DIR)/vmlinux.tmp \
  24. -o $(BIN_DIR)/${ADK_TARGET}-${FS}-kernel
  25. ifeq ($(FS),squashfs)
  26. imageinstall: kernel-install $(BIN_DIR)/$(ROOTFSSQUASHFS)
  27. ${CP} ${BUILD_DIR}/${ROOTFSSQUASHFS} $(BIN_DIR)/$(ROOTFSSQUASHFS)
  28. @echo The image file is $(ROOTFSSQUASHFS)
  29. @echo 'You can flash the image via tftp:'
  30. @echo 'tftp 192.168.1.1'
  31. @echo 'tftp> binary'
  32. @echo "tftp> put $(ROOTFSSQUASHFS) upgrade_code.bin"
  33. endif
  34. ifeq ($(FS),nfsroot)
  35. imageinstall: kernel-install $(BIN_DIR)/$(ROOTFSTARBALL)
  36. @echo 'The kernel file is: ${BIN_DIR}/${ADK_TARGET}-${FS}-kernel'
  37. @echo 'The nfs root tarball is: ${BIN_DIR}/${ROOTFSTARBALL}'
  38. @echo 'You can flash the kernel via tftp:'
  39. @echo 'tftp 192.168.1.1'
  40. @echo 'tftp> binary'
  41. @echo 'tftp> put ${ADK_TARGET}-${FS}-kernel upgrade_code.bin'
  42. endif