Add the complete source tree for the isspam spam detection utility, including the main C implementation (isspam.c), custom memory allocator (rmalloc.h), string builder (rstr.h), dynamic string list (rstring_list.h), build configuration (Makefile, .clang-format), CI workflow (.gitea/workflows/build.yaml), and sample test data (spam/examole_spam3.txt, not_spam/correct1.txt). The core logic defines a list of forbidden words and provides functions for tokenizing input, removing preserved characters, and checking content against the spam keyword set.
26 lines
422 B
Makefile
26 lines
422 B
Makefile
CC = gcc
|
|
CFLAGS = -Wall -Werror -Wextra -Ofast -std=c2x
|
|
|
|
all: build run
|
|
|
|
build:
|
|
@# removed -pedantic flag because it doesn't accept ' for formatting numbers
|
|
@# using printf
|
|
@$(CC) $(CFLAGS) isspam.c -o isspam
|
|
|
|
run: run_spam wl run_not_spam
|
|
|
|
format:
|
|
clang-format *.c *.h -i
|
|
|
|
wl:
|
|
@echo ""
|
|
|
|
run_spam:
|
|
@./isspam ./spam/*.txt
|
|
|
|
run_not_spam:
|
|
@./isspam ./not_spam/*.txt
|
|
|
|
valgrind: build
|
|
valgrind ./isspam ./spam/*.txt
|