You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

63 lines
1.6 KiB

  1. # Copyright (c) 2014 Cryptography Research, Inc.
  2. # Released under the MIT License. See LICENSE.txt for license information.
  3. CC = clang
  4. CFLAGS = -O3 -std=c99 -pedantic -Wall -Wextra -Werror \
  5. -mssse3 -maes -mavx2 -DMUST_HAVE_AVX2 -mbmi2 \
  6. -ffunction-sections -fdata-sections -fomit-frame-pointer -fPIC \
  7. -DEXPERIMENT_ECDH_OBLITERATE_CT=1 -DEXPERIMENT_ECDH_STIR_IN_PUBKEYS=1
  8. .PHONY: clean all runbench todo doc
  9. .PRECIOUS: build/%.s
  10. HEADERS= Makefile $(shell find . -name "*.h") build/timestamp
  11. LIBCOMPONENTS= build/goldilocks.o build/barrett_field.o build/crandom.o \
  12. build/p448.o build/ec_point.o build/scalarmul.o build/sha512.o
  13. all: bench
  14. bench: *.h *.c
  15. $(CC) $(CFLAGS) -o $@ *.c
  16. build/timestamp:
  17. mkdir -p build
  18. touch $@
  19. build/%.o: build/%.s
  20. $(CC) -c -o $@ $<
  21. build/%.s: %.c $(HEADERS)
  22. $(CC) $(CFLAGS) -S -c -o $@ $<
  23. build/goldilocks.so: $(LIBCOMPONENTS)
  24. rm -f $@
  25. libtool -macosx_version_min 10.6 -dynamic -dead_strip -lc -x -o $@ \
  26. -exported_symbols_list exported.sym \
  27. $(LIBCOMPONENTS)
  28. doc/timestamp:
  29. mkdir -p doc
  30. touch $@
  31. doc: Doxyfile doc/timestamp *.c *.h
  32. doxygen
  33. todo::
  34. @egrep --color=auto -w -i 'hack|todo|fixme|bug|xxx|perf|future|remove' *.h *.c
  35. @echo '============================='
  36. @(for i in FIXME BUG XXX TODO HACK PERF FUTURE REMOVE; do \
  37. egrep -w -i $$i *.h *.c > /dev/null || continue; \
  38. /bin/echo -n $$i' ' | head -c 10; \
  39. egrep -w -i $$i *.h *.c | wc -l; \
  40. done)
  41. @echo '============================='
  42. @echo -n 'Total '
  43. @egrep -w -i 'hack|todo|fixme|bug|xxx|perf|future|remove' *.h *.c | wc -l
  44. runbench: bench
  45. ./$<
  46. clean:
  47. rm -fr build bench *.o *.s