1
1
mirror of https://github.com/henrydcase/pqc.git synced 2024-11-22 23:48:58 +00:00
pqcrypto/Makefile

53 lines
1.2 KiB
Makefile
Raw Normal View History

ALL_SCHEMES=$(filter-out crypto_%.c, $(wildcard crypto_*/*))
2019-01-16 12:52:53 +00:00
default: help
.PHONY: require_scheme
require_scheme:
2019-01-17 16:44:55 +00:00
# assumes a SCHEME variable; e.g. make functest SCHEME=crypto_kem/kyber768
2019-01-16 12:52:53 +00:00
ifndef SCHEME
$(error The SCHEME variable is not set. Example: SCHEME=crypto_kem/kyber768)
endif
.PHONY: clean
clean:
rm -rf bin
.PHONY: tidy
2019-01-16 12:52:53 +00:00
tidy:
$(MAKE) do-tidy
do-tidy: require_scheme
clang-tidy \
2019-01-16 12:52:53 +00:00
-quiet $(.TIDY_FIX) \
$(SCHEME)/clean/*.c \
common/*.c \
-- -iquote "common/" -iquote "$(SCHEME)/clean"
2019-01-16 12:52:53 +00:00
.PHONY: apply-tidy
apply-tidy:
$(MAKE) do-tidy .TIDY_FIX=-fix
2019-01-16 12:52:53 +00:00
# The below should be outlined with ts=8
.PHONY: help
help:
2019-01-16 12:52:53 +00:00
@echo "make clean Clean up the bin/ folder"
@echo "make tidy SCHEME=scheme Runs the clang-tidy linter against SCHEME"
@echo "make apply-tidy SCHEME=scheme Tries to automatically fix the issues found by clang-tidy in SCHEME"
@echo "make tidy-all Runs the clang-tidy linter against all schemes"
@echo "make apply-tidy-all Tidy up all schemes"
@echo "make help Displays this message"
2019-01-16 12:02:35 +00:00
2019-01-22 16:22:18 +00:00
2019-01-16 12:02:35 +00:00
.PHONY: tidy-all
tidy-all:
2019-01-16 12:52:53 +00:00
@for scheme in $(ALL_SCHEMES); do \
$(MAKE) tidy SCHEME=$$scheme || exit 1 ; \
2019-01-16 12:52:53 +00:00
done
2019-01-16 12:02:35 +00:00
2019-01-16 12:52:53 +00:00
.PHONY: apply-tidy-all
2019-01-16 12:02:35 +00:00
apply-tidy-all:
2019-01-16 12:52:53 +00:00
@for scheme in $(ALL_SCHEMES); do \
$(MAKE) apply-tidy SCHEME=$$scheme; \
done