<commit_before># config
MKDIR=mkdir -p
RM=rm -rf
CXX=g++
CPPFLAGS=-g -O2 -std=c++11

RBIN=rmatch
RDIR=src
RSRCS=main.cpp Util.cpp

TBIN=test
TDIR=tests
TSRCS=TestSuite.cpp main.cpp

OUT=out
BINOUT=$(OUT)/bin
DEPEND=$(OUT)/depend

#

RFULLSRCS=$(addprefix $(RDIR)/,$(RSRCS))
ROBJDIR=$(OUT)/$(RDIR)
ROBJS=$(addprefix $(ROBJDIR)/,$(subst .cpp,.o,$(RSRCS)))
RFULLBIN=$(BINOUT)/$(RBIN)
EROBJDIR=$(subst /,\/,$(ROBJDIR))

TFULLSRCS=$(addprefix $(TDIR)/,$(TSRCS))
TOBJDIR=$(OUT)/$(TDIR)
TOBJS=$(addprefix $(TOBJDIR)/,$(subst .cpp,.o,$(TSRCS)))
TFULLBIN=$(BINOUT)/$(TBIN)
ETOBJDIR=$(subst /,\/,$(TOBJDIR))

FULLSRCS=$(RFULLSRCS) $(TFULLSRCS)
DEPENDDIR=$(dir $(DEPEND))

.PHONY: all
all: $(RFULLBIN) $(TFULLBIN)

$(BINOUT)/$(RBIN): $(ROBJS) | $(BINOUT)
	$(CXX) $(LDFLAGS) -o $@ $^ $(LDLIBS)
$(BINOUT)/$(TBIN): $(TOBJS) | $(BINOUT)
	$(CXX) $(LDFLAGS) -o $@ $^ $(LDLIBS)

$(OUT)/%.o: %.cpp
	$(CXX) -c $(CFLAGS) $(CPPFLAGS) -o $@ $<

$(DEPEND): $(FULLSRCS) | $(DEPENDDIR)
	$(CXX) -MM $(RFULLSRCS) | sed -e 's/^\([^ ]\)/$(EROBJDIR)\/\1/g' | \
		sed -e 's/\([^\]\)$$/\1 | $(EROBJDIR)/g' > $@
	$(CXX) -MM $(TFULLSRCS) | sed -e 's/^\([^ ]\)/$(ETOBJDIR)\/\1/g' | \
		sed -e 's/\([^\]\)$$/\1 | $(ETOBJDIR)/g' >> $@

$(OUT):
	$(MKDIR) $@
$(BINOUT):
	$(MKDIR) $@
$(DEPENDDIR):
	$(MKDIR) $@
$(ROBJDIR):
	$(MKDIR) $@
$(TOBJDIR):
	$(MKDIR) $@

.PHONY: clean
clean:<commit_msg>Fix depend file creation<commit_after># config
MKDIR=mkdir -p
RM=rm -rf
CXX=g++
CPPFLAGS=-g -O2 -std=c++11

RBIN=rmatch
RDIR=src
RSRCS=main.cpp Util.cpp

TBIN=test
TDIR=tests
TSRCS=TestSuite.cpp main.cpp

OUT=out
BINOUT=$(OUT)/bin
DEPEND=$(OUT)/depend

#

RFULLSRCS=$(addprefix $(RDIR)/,$(RSRCS))
ROBJDIR=$(OUT)/$(RDIR)
ROBJS=$(addprefix $(ROBJDIR)/,$(subst .cpp,.o,$(RSRCS)))
RFULLBIN=$(BINOUT)/$(RBIN)
EROBJDIR=$(subst /,\/,$(ROBJDIR))

TFULLSRCS=$(addprefix $(TDIR)/,$(TSRCS))
TOBJDIR=$(OUT)/$(TDIR)
TOBJS=$(addprefix $(TOBJDIR)/,$(subst .cpp,.o,$(TSRCS)))
TFULLBIN=$(BINOUT)/$(TBIN)
ETOBJDIR=$(subst /,\/,$(TOBJDIR))

FULLSRCS=$(RFULLSRCS) $(TFULLSRCS)
DEPENDDIR=$(dir $(DEPEND))

.PHONY: all
all: $(RFULLBIN) $(TFULLBIN)

.PHONY: $(RBIN)
$(RBIN): $(RFULLBIN)
.PHONY: $(TBIN)
$(TBIN): $(TFULLBIN)

$(BINOUT)/$(RBIN): $(ROBJS) | $(BINOUT)
	$(CXX) $(LDFLAGS) -o $@ $^ $(LDLIBS)
$(BINOUT)/$(TBIN): $(TOBJS) | $(BINOUT)
	$(CXX) $(LDFLAGS) -o $@ $^ $(LDLIBS)

$(OUT)/%.o: %.cpp
	$(CXX) -c $(CFLAGS) $(CPPFLAGS) -o $@ $<

$(DEPEND): $(FULLSRCS) | $(DEPENDDIR)
	$(CXX) $(CFLAGS) $(CPPFLAGS) -MM $(RFULLSRCS) | \
		sed -e 's/^\([^ ]\)/$(EROBJDIR)\/\1/g' | \
		sed -e 's/\([^\]\)$$/\1 | $(EROBJDIR)/g' > $@
	$(CXX) $(CFLAGS) $(CPPFLAGS) -MM $(TFULLSRCS) | \
		sed -e 's/^\([^ ]\)/$(ETOBJDIR)\/\1/g' | \
		sed -e 's/\([^\]\)$$/\1 | $(ETOBJDIR)/g' >> $@

$(OUT):
	$(MKDIR) $@
$(BINOUT):
	$(MKDIR) $@
$(DEPENDDIR):
	$(MKDIR) $@
$(ROBJDIR):
	$(MKDIR) $@
$(TOBJDIR):
	$(MKDIR) $@

.PHONY: clean
clean:
{'fraction_non_alphanumeric': 0.31645569620253167, 'fraction_numerical': 0.004922644163150493, 'mean_word_length': 4.656063618290259, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 9, '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': '6968610', 'n_tokens_mistral': 1445, 'n_tokens_neox': 1364, 'n_words': 228}