Makefile 1.2 KB

123456789101112131415161718192021222324252627282930313233
  1. # These are testcases & benchmarks for the library on the target processors
  2. # (currently ARM Cortex M3 and AVR). They are a bit tricky to run, as they
  3. # depend on specific simulator versions.
  4. FILES = benchmark.c ../libfixmath/fix16.c ../libfixmath/fix16_sqrt.c ../libfixmath/fix16_exp.c
  5. CFLAGS = -DFIXMATH_NO_OVERFLOW -DFIXMATH_NO_ROUNDING -ffast-math -I../libfixmath
  6. testcases.c: generate_testcases.py
  7. python $<
  8. benchmark-arm.elf: $(FILES) interface-arm.c testcases.c
  9. # Note: this needs hacked QEmu that "makes no sense":
  10. # https://bugs.launchpad.net/qemu/+bug/696094
  11. arm-none-eabi-gcc -mcpu=cortex-m3 -mthumb -T generic-m-hosted.ld \
  12. -Wall -O2 $(CFLAGS) \
  13. -o $@ -I .. $(FILES) interface-arm.c -lm
  14. run-benchmark-arm: benchmark-arm.elf
  15. qemu-system-arm -cpu cortex-m3 -icount 0 -device armv7m_nvic \
  16. -nographic -monitor null -serial null \
  17. -semihosting -kernel $<
  18. benchmark-avr.elf: $(FILES) interface-avr.c testcases.c
  19. avr-gcc -Wall -mmcu=atmega128 $(CFLAGS) \
  20. -Wall -O2 -DFIXMATH_OPTIMIZE_8BIT \
  21. -o $@ -I .. $(FILES) interface-avr.c
  22. run-benchmark-avr: benchmark-avr.elf
  23. # Note: this needs simulavrxx 1.0rc0 or newer
  24. simulavr -d atmega128 -f $< -W 0x20,- -T exit