<commit_before>include Makefile.lib
-include Makefile.config

libre2=$(CURDIR)/re2/obj/libre2.a

extradirs=$(sort $(libgit2) $(gflags))

override CPPFLAGS += -I$(CURDIR)/re2/ $(patsubst %,-I%/include, $(extradirs))
override LDFLAGS += $(patsubst %, -L%/lib, $(extradirs))
override LDFLAGS += $(patsubst %, -Wl$(comma)-R%/lib, $(extradirs))

override CXXFLAGS+=-g -std=c++0x -Wall -Werror -Wno-sign-compare -pthread
override LDFLAGS+=-pthread
LDLIBS=-lgit2 -ljson -lgflags

ifeq ($(noopt),)
override CXXFLAGS+=-O2
endif
ifneq ($(densehash),)
override CXXFLAGS+=-DUSE_DENSE_HASH_SET
endif
ifneq ($(profile),)
override CXXFLAGS+=-DPROFILE_CODESEARCH
endif
ifneq ($(slowgtod),)
override CXXFLAGS+=-DCODESEARCH_SLOWGTOD
endif

OBJECTS = codesearch.o main.o chunk.o \
          chunk_allocator.o radix_sort.o \
          dump_load.o indexer.o re_width.o
DEPFILES = $(OBJECTS:%.o=.%.d)

all: codesearch $(DEPFILES)

codesearch: $(OBJECTS) $(libre2) .config/LDFLAGS
	$(CXX) -o $@ $(LDFLAGS) $(filter-out .config/%,$^) $(LDLIBS)

$(libre2): FORCE
	( cd re2 && $(MAKE) )

clean:
	rm -f codesearch $(OBJECTS) $(DEPFILES)

$(OBJECTS): .config/CXX .config/CXXFLAGS

-include $(DEPFILES)

<commit_msg>Support tcmalloc=1 to build against tcmalloc.<commit_after>include Makefile.lib
-include Makefile.config

libre2=$(CURDIR)/re2/obj/libre2.a

extradirs=$(sort $(libgit2) $(gflags))

override CPPFLAGS += -I$(CURDIR)/re2/ $(patsubst %,-I%/include, $(extradirs))
override LDFLAGS += $(patsubst %, -L%/lib, $(extradirs))
override LDFLAGS += $(patsubst %, -Wl$(comma)-R%/lib, $(extradirs))

override CXXFLAGS+=-g -std=c++0x -Wall -Werror -Wno-sign-compare -pthread
override LDFLAGS+=-pthread
LDLIBS=-lgit2 -ljson -lgflags

ifeq ($(noopt),)
override CXXFLAGS+=-O2
endif
ifneq ($(densehash),)
override CXXFLAGS+=-DUSE_DENSE_HASH_SET
endif
ifneq ($(profile),)
override CXXFLAGS+=-DPROFILE_CODESEARCH
endif
ifneq ($(slowgtod),)
override CXXFLAGS+=-DCODESEARCH_SLOWGTOD
endif
ifneq ($(tcmalloc),)
override LDLIBS+=-ltcmalloc
endif

OBJECTS = codesearch.o main.o chunk.o \
          chunk_allocator.o radix_sort.o \
          dump_load.o indexer.o re_width.o
DEPFILES = $(OBJECTS:%.o=.%.d)

all: codesearch $(DEPFILES)

codesearch: $(OBJECTS) $(libre2) .config/LDFLAGS
	$(CXX) -o $@ $(LDFLAGS) $(filter-out .config/%,$^) $(LDLIBS)

$(libre2): FORCE
	( cd re2 && $(MAKE) )

clean:
	rm -f codesearch $(OBJECTS) $(DEPFILES)

$(OBJECTS): .config/CXX .config/CXXFLAGS

-include $(DEPFILES)


{'fraction_non_alphanumeric': 0.18325883787078423, 'fraction_numerical': 0.009345794392523364, 'mean_word_length': 4.875894988066825, 'pattern_counts': {'":': 0, '<': 3, '<?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': '6084313', 'n_tokens_mistral': 1019, 'n_tokens_neox': 991, 'n_words': 202}