<commit_before>
CFLAGS = -fPIC -O3 -Wall
CINCL  = -I src -I deps/discodb/src
CLIBS  = $(foreach L,Judy cmph m,-l$(L))
CHDRS  = $(wildcard src/*.h)
CSRCS  = $(wildcard src/*.c src/dsfmt/dSFMT.c deps/discodb/src/*.c)
COBJS  = $(patsubst %.c,%.o,$(CSRCS))

PYTHON = python

.PHONY: all bins libs clean python

all: libs bins

bins: bin/encode bin/index bin/merge bin/mix

libs: lib/libtraildb.a lib/libtraildb.so

clean:
	rm -f $(COBJS)
	rm -f bin/encode bin/index bin/mix
	rm -f lib/libtraildb.*

bin/merge: src/bin/merge/*.c $(COBJS)
	$(CC) $(CFLAGS) $(CINCL) -I $(<D) $(CLIBS) -o $@ $^

bin/mix: src/bin/mix/*.c src/bin/mix/ops/*.c $(COBJS)
	$(CC) $(CFLAGS) $(CINCL) -I $(<D) $(CLIBS) -o $@ $^

bin/%: src/bin/%.c $(COBJS)
	$(CC) $(CFLAGS) $(CINCL) $(CLIBS) -o $@ $^

deps/discodb/src/%.o:
	make -C deps/discodb CFLAGS="$(CFLAGS)"

deps/%.git:
	git submodule update --init $(@D)

lib/libtraildb.a: $(COBJS)
	$(AR) -ruvs $@ $^

lib/libtraildb.so: $(COBJS)
	$(CC) $(CFLAGS) $(CINCL) $(CLIBS) -shared -o $@ $^

src/dsfmt/%.o: src/dsfmt/%.c
	$(CC) $(CFLAGS) $(CINCL) -DDSFMT_MEXP=521 -DHAVE_SSE2=1 -msse2 -c -o $@ $^

src/%.o: src/%.c $(CHDRS)
	$(CC) $(CFLAGS) $(CINCL) -DENABLE_COOKIE_INDEX -c -o $@ $<<commit_msg>fix link order for gcc<commit_after>
CFLAGS = -fPIC -O3 -Wall
CINCL  = -I src -I deps/discodb/src
CLIBS  = $(foreach L,Judy cmph m,-l$(L))
CHDRS  = $(wildcard src/*.h)
CSRCS  = $(wildcard src/*.c src/dsfmt/dSFMT.c deps/discodb/src/*.c)
COBJS  = $(patsubst %.c,%.o,$(CSRCS))

PYTHON = python

.PHONY: all bins libs clean python

all: libs bins

bins: bin/encode bin/index bin/merge bin/mix

libs: lib/libtraildb.a lib/libtraildb.so

clean:
	rm -f $(COBJS)
	rm -f bin/encode bin/index bin/mix
	rm -f lib/libtraildb.*

bin/merge: src/bin/merge/*.c $(COBJS)
	$(CC) $(CFLAGS) $(CINCL) -I $(<D) -o $@ $^ $(CLIBS)

bin/mix: src/bin/mix/*.c src/bin/mix/ops/*.c $(COBJS)
	$(CC) $(CFLAGS) $(CINCL) -I $(<D) -o $@ $^ $(CLIBS)

bin/%: src/bin/%.c $(COBJS)
	$(CC) $(CFLAGS) $(CINCL) -o $@ $^ $(CLIBS)

deps/discodb/src/%.o:
	make -C deps/discodb CFLAGS="$(CFLAGS)"

deps/%.git:
	git submodule update --init $(@D)

lib/libtraildb.a: $(COBJS)
	$(AR) -ruvs $@ $^

lib/libtraildb.so: $(COBJS)
	$(CC) $(CFLAGS) $(CINCL) -shared -o $@ $^ $(CLIBS)

src/dsfmt/%.o: src/dsfmt/%.c
	$(CC) $(CFLAGS) $(CINCL) -DDSFMT_MEXP=521 -DHAVE_SSE2=1 -msse2 -c -o $@ $^

src/%.o: src/%.c $(CHDRS)
	$(CC) $(CFLAGS) $(CINCL) -DENABLE_COOKIE_INDEX -c -o $@ $<
{'fraction_non_alphanumeric': 0.24516659810777458, 'fraction_numerical': 0.005758946935417524, 'mean_word_length': 3.3506261180679786, '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': '4636025', 'n_tokens_mistral': 1259, 'n_tokens_neox': 1202, 'n_words': 260}