57 lines
1.2 KiB
Makefile
Raw Normal View History

2024-11-28 17:39:34 +00:00
CC = gcc
CFLAGS = -Wall -Werror -Wextra -Ofast -std=c2x
2024-12-02 14:10:18 +00:00
all: build run valgrind build_risspam run_risspam
2024-11-28 17:39:34 +00:00
build:
2024-11-30 21:05:06 +00:00
@echo "Compiling retoor_c project.".
2024-11-28 17:39:34 +00:00
@# removed -pedantic flag because it doesn't accept ' for formatting numbers
@# using printf
2024-11-30 21:05:06 +00:00
@$(CC) $(CFLAGS) retoor_c/isspam.c -o isspam
2024-11-28 17:39:34 +00:00
2024-11-30 19:58:00 +00:00
build_risspam:
2024-11-30 21:11:41 +00:00
@echo "Compiling 12bitfloat_risspam project."
2024-11-30 19:58:00 +00:00
cd 12bitfloat_rust/risspam && cargo run --release && cp target/release/risspam ../../
2024-11-28 17:39:34 +00:00
run: run_spam wl run_not_spam
2024-11-30 20:04:01 +00:00
run_risspam: run_spam_risspam run_not_spam_risspam
2024-11-30 19:58:00 +00:00
2024-11-28 17:39:34 +00:00
format:
clang-format *.c *.h -i
wl:
@echo ""
run_spam:
@./isspam ./spam/*.txt
run_not_spam:
@./isspam ./not_spam/*.txt
2024-11-30 19:58:00 +00:00
run_spam_risspam:
@./risspam ./spam/*.txt
run_not_spam_risspam:
@./risspam ./not_spam/*.txt
2024-11-28 17:39:34 +00:00
valgrind: build
2024-11-30 19:58:00 +00:00
valgrind ./isspam ./spam/*.txt
2024-12-01 21:02:32 +00:00
2024-12-02 14:10:18 +00:00
publish:
2024-12-02 14:30:51 +00:00
@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
2024-12-01 21:02:32 +00:00
benchmark:
-@rm -rf books
2024-12-02 14:16:31 +00:00
@echo "Extracting books."
@tar -xzf books.tar.gz books/
@echo "Extracted books."
@python bench.py