<commit_before>CXX=g++
CXXFLAGS=-std=c++11 -c -fPIC -O2
CXXSRC=../libsaki/*.cpp
BUILD_DIR=./build

AR=ar
ARFLAGS=crf

SED_REGEX='s/\*\//\
		  \#cgo LDFLAGS: \$${SRCDIR}\/build\/libsaki.a\n\
		  \#cgo CXXFLAGS: -std=c++11\n\
		  \*\//g'

all: libsaki swig

libsaki: ${BUILD_DIR}
	@echo -n 'compiling libsaki...'
	@cd ${BUILD_DIR};\
		${CXX} ${CXXFLAGS} ${CXXSRC};\
		${AR} ${ARFLAGS} libsaki.a *.o;
	@echo -e '\e[OK\r[DONE] build/libsaki.a'

swig:
	@echo -n 'generating swig outputs...'
	@swig -go -cgo -c++ -intgosize 64 saki.i
	@sed -i ${SED_REGEX} -- saki.go
	@echo -e '\e[OK\r[DONE] saki.go saki_wrap.cxx'

${BUILD_DIR}:
	@mkdir -p ${BUILD_DIR}<commit_msg>remove f option in ar flags<commit_after>CXX=g++
CXXFLAGS=-std=c++11 -c -fPIC -O2
CXXSRC=../libsaki/*.cpp
BUILD_DIR=./build

AR=ar
ARFLAGS=cr

SED_REGEX='s/\*\//\
		  \#cgo LDFLAGS: \$${SRCDIR}\/build\/libsaki.a\n\
		  \#cgo CXXFLAGS: -std=c++11\n\
		  \*\//g'

all: libsaki swig

libsaki: ${BUILD_DIR}
	@echo -n 'compiling libsaki...'
	@cd ${BUILD_DIR};\
		${CXX} ${CXXFLAGS} ${CXXSRC};\
		${AR} ${ARFLAGS} libsaki.a *.o;
	@echo -e '\e[OK\r[DONE] build/libsaki.a'

swig:
	@echo -n 'generating swig outputs...'
	@swig -go -cgo -c++ -intgosize 64 saki.i
	@sed -i ${SED_REGEX} -- saki.go
	@echo -e '\e[OK\r[DONE] saki.go saki_wrap.cxx'

${BUILD_DIR}:
	@mkdir -p ${BUILD_DIR}
{'fraction_non_alphanumeric': 0.23891810668670171, 'fraction_numerical': 0.010518407212622089, 'mean_word_length': 3.0609756097560976, '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': '6108616', 'n_tokens_mistral': 695, 'n_tokens_neox': 643, 'n_words': 134}