- Add 'benchmark' target to Makefile that extracts books archive and runs bench.py - Reorder includes in isspam.c (rstr.h before rstring_list.h) - Replace file_exists() with case-insensitive stricmp() for forbidden word matching - Remove unused flags (show_capitalized, show_sentences, etc.) and stripws() function - Add memory usage comment and fix trailing newline in rstr.h header guard
49 lines
941 B
Makefile
49 lines
941 B
Makefile
CC = gcc
|
|
CFLAGS = -Wall -Werror -Wextra -Ofast -std=c2x
|
|
|
|
all: build run valgrind build_risspam run_risspam benchmark
|
|
|
|
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
|
|
|
|
benchmark:
|
|
-@rm -rf books
|
|
echo "Extracting books."
|
|
tar -xzf books.tar.gz books/
|
|
echo "Extracted books."
|
|
python bench.py
|