Makefile.old 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. TARGET_DIR=$(PWD)/.build
  2. ROM_ELF_FILE ?= /tmp/eagle.pro.rom.out
  3. all: newlib check_common_syms
  4. newlib_xtensa-2.2.0:
  5. git submodule update --init
  6. newlib: newlib_xtensa-2.2.0
  7. newlib:
  8. cd newlib_xtensa-2.2.0 && \
  9. ./configure \
  10. --with-newlib \
  11. --enable-multilib \
  12. --disable-newlib-io-c99-formats \
  13. --disable-newlib-supplied-syscalls \
  14. --enable-newlib-nano-formatted-io \
  15. --enable-newlib-reent-small \
  16. --enable-target-optspace \
  17. --program-transform-name="s&^&xtensa-esp108-elf-&" \
  18. --disable-option-checking \
  19. --with-target-subdir=xtensa-esp108-elf \
  20. --target=xtensa-esp108-elf \
  21. --prefix=$(TARGET_DIR) \
  22. && CROSS_CFLAGS="-DSIGNAL_PROVIDED -DABORT_PROVIDED -DMALLOC_PROVIDED" make all install || true
  23. cp -r $(TARGET_DIR)/xtensa-esp108-elf/{include,lib} ./
  24. cp lib/libc.a lib/libc_rom.a
  25. xtensa-esp108-elf-ar d lib/libc_rom.a lib_a-nano-vfprintf_float.o
  26. xtensa-esp108-elf-ar d lib/libc_rom.a lib_a-nano-vfscanf_float.o
  27. while read obj; do xtensa-esp108-elf-ar d lib/libc.a $$obj; done <libc_discard.list
  28. clean:
  29. rm -rf newlib_xtensa-2.2.0 .build include lib
  30. check_common_syms:
  31. @# get symbols in libc.a, except for _printf_float and _scanf_float
  32. @xtensa-esp108-elf-nm lib/libc.a | grep -v -E "\W+U\W+" | awk '{print $$3}' | grep -v -E '^$$' | grep -v '_printf_float' | grep -v '_scanf_float' | sort >libc.syms
  33. @# get symbols in ROM
  34. @xtensa-esp108-elf-nm $(ROM_ELF_FILE) | grep -v -E '\W+U\W+' | awk '{print $$3}' | sort >rom.syms
  35. @# check that there are no common symbols
  36. @test $$(comm -12 rom.syms libc.syms | tee common.syms | wc -l) -eq 0
  37. .PHONY: all clean newlib