|
CC = gcc
|
|
CFLAGS = -Wall -Werror -Wextra -Ofast -std=c2x
|
|
|
|
all: build run valgrind build_risspam run_risspam
|
|
|
|
build:
|
|
@echo "Compiling retoor_c project.".
|
|
@# removed -pedantic flag because it doesn't accept ' for formatting numbers
|
|
@# using printf
|
|
@$(CC) $(CFLAGS) retoor_c/isspam.c -o isspam
|
|
|
|
|
|
build_risspam:
|
|
@echo "Compiling 12bitfloat_risspam project."
|
|
cd 12bitfloat_rust/risspam && cargo run --release && cp target/release/risspam ../../
|
|
|
|
|
|
run: run_spam wl run_not_spam
|
|
run_risspam: run_spam_risspam run_not_spam_risspam
|
|
|
|
format:
|
|
clang-format *.c *.h -i
|
|
|
|
wl:
|
|
@echo ""
|
|
|
|
run_spam:
|
|
@./isspam ./spam/*.txt
|
|
|
|
run_not_spam:
|
|
@./isspam ./not_spam/*.txt
|
|
|
|
run_spam_risspam:
|
|
@./risspam ./spam/*.txt
|
|
|
|
run_not_spam_risspam:
|
|
@./risspam ./not_spam/*.txt
|
|
|
|
|
|
valgrind: build
|
|
valgrind ./isspam ./spam/*.txt
|
|
|
|
publish:
|
|
@wget https://retoor.molodetz.nl/api/packages/retoor/generic/env.py/1.0.0/env.py --quiet
|
|
@wget https://retoor.molodetz.nl/api/packages/retoor/generic/publish/1.0.0/publish --quiet
|
|
@chmod +x publish
|
|
@./publish isspam
|
|
@./publish risspam
|
|
@rm publish
|
|
@rm env.py
|
|
benchmark:
|
|
-@rm -rf books
|
|
@echo "Extracting books."
|
|
@tar -xzf books.tar.gz books/
|
|
@echo "Extracted books."
|
|
@python bench.py
|