<commit_before>CC = g++
CCOPT = -Wall -c
LINK = g++
LINKOPT =
PACKA = ar
PARCAOPT = rc
DOLINK = $(LINK) $(LINKOPT) -o $@ $^
SOURCES := $(wildcard *.cpp)
OBJS := $(patsubst %.cpp,%.o,$(SOURCES))

CMDIR = ./cppcommon
CMLIB = $(CMDIR)/cmlib.a
CMLIB_DEPS := $(wildcard $(CMDIR)/*)


# remove the objs after compilation
.INTERMEDIATE: 
.PHONY: clean

# This is a suffix rule 
#.c.o: 
%.o: %.cpp
	$(CC) $(CCOPT) $<

# Main Targets
all: main


main: $(OBJS) $(CMLIB)
	$(DOLINK)

$(CMLIB): $(CMLIB_DEPS)
	cd $(CMDIR) && $(MAKE)

#unit test
Trie.ut: Trie.cpp Trie.h globals.h $(CMLIB)
	$(CC) -o $@ $< -DTRIE_UT $(CMLIB) 

Segment.ut: Segment.cpp Trie.cpp Segment.h Trie.h globals.h $(CMLIB)
	$(CC) -o $@ Segment.cpp Trie.cpp -DSEGMENT_UT $(CMLIB) 


clean:
	rm -f *.o *.d *.ut main
	cd $(CMDIR) && make clean

sinclude $(SOURCES:.cpp=.d)
%.d:%.cpp
	@set -e; rm -f $@; \
	$(CC) -MM $< > $@.$$$$; \
	sed 's,\($*\).o[ :]*,\1.o $@ : ,g' < $@.$$$$ > $@; \
	rm -f $@.$$$$
<commit_msg>modify makefile<commit_after>CC = g++
CCOPT = -Wall -c
LINK = g++
LINKOPT =
PACKA = ar
PACKAOPT = rc
DOLINK = $(LINK) $(LINKOPT) -o $@ $^
DOPACK = $(PACKA) $(PACKAOPT) $@ $?
SOURCES := $(wildcard *.cpp)
OBJS := $(patsubst %.cpp,%.o,$(SOURCES))

CMDIR = ./cppcommon
CMLIB = $(CMDIR)/cmlib.a

LIBA = cppjiebalib.a

# remove the objs after compilation
.INTERMEDIATE: 
.PHONY: clean $(CMLIB)

all: $(LIBA)


# This is a suffix rule 
#.c.o: 
%.o: %.cpp
	$(CC) $(CCOPT) $<


$(LIBA): $(OBJS) $(CMLIB)
	$(DOPACK)

$(CMLIB):
	cd $(CMDIR) && $(MAKE)

#unit test
Trie.ut: Trie.cpp Trie.h globals.h $(CMLIB)
	$(CC) -o $@ $< -DTRIE_UT $(CMLIB) 

Segment.ut: Segment.cpp Trie.cpp Segment.h Trie.h globals.h $(CMLIB)
	$(CC) -o $@ Segment.cpp Trie.cpp -DSEGMENT_UT $(CMLIB) 

clean:
	rm -f *.o *.d *.ut $(LIBA)
	cd $(CMDIR) && make clean

sinclude $(SOURCES:.cpp=.d)
%.d:%.cpp
	@set -e; rm -f $@; \
	$(CC) -MM $< > $@.$$$$; \
	sed 's,\($*\).o[ :]*,\1.o $@ : ,g' < $@.$$$$ > $@; \
	rm -f $@.$$$$

{'fraction_non_alphanumeric': 0.26321190354027707, 'fraction_numerical': 0.001026167265264238, 'mean_word_length': 3.1666666666666665, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 7, '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': '6558854', 'n_tokens_mistral': 998, 'n_tokens_neox': 921, 'n_words': 221}