<commit_before>
CFLAGS=-g -Wall -Isrc
LIBS=-lzmq -lsqlite3


SOURCES=$(wildcard src/**/*.c src/*.c)
OBJECTS=$(patsubst %.c,%.o,${SOURCES})
LIB_SRC=$(filter-out src/mongrel2.c,${SOURCES})
LIB_OBJ=$(filter-out src/mongrel2.o,${OBJECTS})
TEST_SRC=$(wildcard tests/*.c)
TESTS=$(patsubst %.c,%,${TEST_SRC})

all: bin/mongrel2 tests


bin/mongrel2: build/libm2.a src/mongrel2.o
	$(CC) $(CFLAGS) $(LIBS) src/mongrel2.o -o $@ $<


build/libm2.a: build ${LIB_OBJ}
	ar rcs $@ ${LIB_OBJ}
	ranlib $@

build:
	@mkdir -p build
	@mkdir -p bin

clean:
	rm -rf build bin lib ${OBJECTS} ${TESTS}

tests: build/libm2.a ${TESTS}

$(TESTS): %: %.c
	$(CC) $(CFLAGS) $(LIBS) -o $@ $< build/libm2.a
	$@

check:<commit_msg>Regenerate the tests/config.sqlite file from the example config.<commit_after>
CFLAGS=-g -Wall -Isrc
LIBS=-lzmq -lsqlite3


SOURCES=$(wildcard src/**/*.c src/*.c)
OBJECTS=$(patsubst %.c,%.o,${SOURCES})
LIB_SRC=$(filter-out src/mongrel2.c,${SOURCES})
LIB_OBJ=$(filter-out src/mongrel2.o,${OBJECTS})
TEST_SRC=$(wildcard tests/*.c)
TESTS=$(patsubst %.c,%,${TEST_SRC})

all: bin/mongrel2 tests


bin/mongrel2: build/libm2.a src/mongrel2.o
	$(CC) $(CFLAGS) $(LIBS) src/mongrel2.o -o $@ $<


build/libm2.a: build ${LIB_OBJ}
	ar rcs $@ ${LIB_OBJ}
	ranlib $@

build:
	@mkdir -p build
	@mkdir -p bin

clean:
	rm -rf build bin lib ${OBJECTS} ${TESTS} tests/config.sqlite

tests: build/libm2.a tests/config.sqlite ${TESTS}

tests/config.sqlite: src/config/config.sql src/config/example.sql
	sqlite3 $@ < src/config/config.sql
	sqlite3 $@ < src/config/example.sql

$(TESTS): %: %.c
	$(CC) $(CFLAGS) $(LIBS) -o $@ $< build/libm2.a
	$@

check:
{'fraction_non_alphanumeric': 0.21389059618930548, 'fraction_numerical': 0.014751075599262446, 'mean_word_length': 4.302931596091205, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6728151', 'n_tokens_mistral': 758, 'n_tokens_neox': 711, 'n_words': 141}