Reference implementations of PQC
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.
 
 
 
 

49 lines
1.4 KiB

  1. # This -Wall was supported by the European Commission through the ERC Starting Grant 805031 (EPOQUE)
  2. CFLAGS=-Wall -Wextra -Wpedantic -Werror -std=c99 $(EXTRAFLAGS)
  3. functest: require_scheme $(dir $(SCHEME))test.c $(wildcard $(SCHEME)/clean/*.c) $(wildcard $(SCHEME)/clean/*.h)
  4. mkdir -p bin
  5. $(CC) $(CFLAGS) \
  6. -iquote "./common/" \
  7. -iquote "$(SCHEME)/clean/" \
  8. -o bin/functest_$(subst /,_,$(SCHEME)) \
  9. common/*.c \
  10. $(SCHEME)/clean/*.c \
  11. $<
  12. .PHONY: clean
  13. clean:
  14. rm -rf bin
  15. .PHONY: format
  16. format:
  17. find . -iname *.h -o -iname *.c | xargs clang-format -i -style=file
  18. .PHONY: tidy
  19. tidy: require_scheme
  20. clang-tidy \
  21. $(SCHEME)/clean/*.c \
  22. crypto_kem/test.c \
  23. common/*.c \
  24. $(.TIDY_FIX) \
  25. -- -iquote "common/" -iquote "$(SCHEME)/clean"
  26. .PHONY: fix-tidy
  27. apply-tidy: | $(eval .TIDY_FIX = -fix) tidy
  28. .PHONY: help
  29. help:
  30. @echo make functest SCHEME=scheme run functional tests for SCHEME
  31. @echo make clean clean up the bin/ folder
  32. @echo make format Automatically formats all the source code
  33. @echo make tidy SCHEME=scheme Runs the clang-tidy linter against SCHEME
  34. @echo make fix-tidy SCHEME=scheme Tries to automatically fix the issues found by clang-tidy in SCHEME
  35. @echo make help Displays this message
  36. .PHONY: require_scheme
  37. require_scheme:
  38. # assumes a SCHEME variable; e.g. make functest_kem SCHEME=crypto_kem/kyber768
  39. ifndef SCHEME
  40. $(error The SCHEME variable is not set. Example: SCHEME=crypto_kem/kyber768)
  41. endif