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.
 
 
 
 
 

43 lines
976 B

  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. -mavx2 -DMUST_HAVE_SSSE3 -mbmi2 \
  6. -ffunction-sections -fdata-sections -fomit-frame-pointer -fPIC
  7. .PHONY: clean all runbench
  8. .PRECIOUS: build/%.s
  9. HEADERS= Makefile $(shell find . -name "*.h") build/timestamp
  10. LIBCOMPONENTS= build/goldilocks.o build/barrett_field.o build/crandom.o \
  11. build/p448.o build/ec_point.o build/scalarmul.o
  12. all: bench
  13. bench: *.h *.c
  14. $(CC) $(CFLAGS) -o $@ *.c
  15. build/timestamp:
  16. mkdir -p build
  17. touch $@
  18. build/%.o: build/%.s
  19. $(CC) -c -o $@ $<
  20. build/%.s: %.c $(HEADERS)
  21. $(CC) $(CFLAGS) -S -c -o $@ $<
  22. build/goldilocks.so: $(LIBCOMPONENTS)
  23. rm -f $@
  24. libtool -macosx_version_min 10.6 -dynamic -dead_strip -lc -x -o $@ \
  25. -exported_symbols_list exported.sym \
  26. $(LIBCOMPONENTS)
  27. runbench: bench
  28. ./$<
  29. clean:
  30. rm -fr build bench *.o *.s