Add new Rust-based spam detection project under jest_rust/jisspam with Cargo.toml, main.rs implementing forbidden word analysis, and test files for spam/not-spam classification. Include build_jest target in Makefile, add jisspam binary to .gitignore, and integrate its execution into bench.py benchmark suite alongside existing C, CPP, and Python implementations.
68 lines
1.5 KiB
Makefile
68 lines
1.5 KiB
Makefile
CC = gcc
|
|
CFLAGS = -Ofast
|
|
|
|
all: build run valgrind build_risspam run_risspam build_cpp build_borded_cpp build_py build_jest
|
|
|
|
build:
|
|
@echo "Compiling retoor_c project.".
|
|
@$(CC) $(CFLAGS) retoor_c/isspam.c -o isspam
|
|
|
|
build_py:
|
|
@echo "Copying py file"
|
|
@cp retoor_c/isspam.py isspam.py
|
|
|
|
build_cpp:
|
|
@echo "Compiling C++ version of isspam."
|
|
@g++ -Ofast retoor_c/isspam.cpp -o isspam_cpp
|
|
|
|
build_borded_cpp:
|
|
@echo "Compiling Borded C++ version of isspam."
|
|
@g++ -std=c++23 -Ofast borded_cpp/src/main3.cpp -o borded_cpp_exec
|
|
|
|
build_risspam:
|
|
@echo "Compiling 12bitfloat_risspam project."
|
|
cd 12bitfloat_rust/risspam && cargo run --release && cp target/release/risspam ../../
|
|
|
|
build_jest:
|
|
@echo "compiling jest_rust project"
|
|
cd jest_rust/jisspam && cargo build --release && cp target/release/jisspam ../../
|
|
|
|
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
|