<commit_before>SRC_DIR = src
WYM_DIR = ${SRC_DIR}/wymeditor
BUILD_DIR = dist

JS_FILES = ${WYM_DIR}/core.js\
 ${WYM_DIR}/editor/base.js\
 ${WYM_DIR}/editor/ie.js\
 ${WYM_DIR}/editor/firefox.js\
 ${WYM_DIR}/editor/opera.js\
 ${WYM_DIR}/editor/webkit.js\
 ${WYM_DIR}/parser/xml-helper.js\
 ${WYM_DIR}/parser/xhtml-validator.js\
 ${WYM_DIR}/parser/parallel-regex.js\
 ${WYM_DIR}/parser/state-stack.js\
 ${WYM_DIR}/parser/lexer.js\
 ${WYM_DIR}/parser/xhtml-lexer.js\
 ${WYM_DIR}/parser/xhtml-parser.js\
 ${WYM_DIR}/parser/xhtml-sax-listener.js\
 ${WYM_DIR}/parser/css-lexer.js\
 ${WYM_DIR}/parser/css-parser.js

WE = ${BUILD_DIR}/jquery.wymeditor.js
WE_MIN = ${BUILD_DIR}/jquery.wymeditor.min.js
WE_ARCH = ${BUILD_DIR}/wymeditor.tar.gz

WYM_VER = $(shell cat version.txt)
VER = sed "s/@VERSION/$(WYM_VER)/"

MERGE = cat ${JS_FILES} | perl -pe 's/^\xEF\xBB\xBF//g' | ${VER} > ${WE}
WE_MINIFIER = uglifyjs ${WE} > ${WE_MIN}

all: archive

wymeditor:
	@@echo "Building" ${WE}
	@@mkdir -p ${BUILD_DIR}

	@@echo " - Merging files"
	@@${MERGE}

	@@echo ${WE} "Built"
	@@echo

min: wymeditor
	@@echo "Building" ${WE_MIN}

	@@echo " - Compressing using Uglifier"
	@@${WE_MINIFIER}
	
	@@echo ${WE_MIN} "Built"
	@@echo

archive: min
	@@echo "Building" ${WE_ARCH}

	@@echo " - Creating archive"
	@@mkdir -p ${BUILD_DIR}/wymeditor/wymeditor

	@@cp README.md CHANGELOG.rst AUTHORS *.txt ${BUILD_DIR}/wymeditor
	@@cp -pR ${SRC_DIR}/examples ${BUILD_DIR}/wymeditor
	@@cp -pR ${SRC_DIR}/jquery ${BUILD_DIR}/wymeditor

	@@cp ${WE} ${WE_MIN} ${BUILD_DIR}/wymeditor/wymeditor
	@@cp -pR ${WYM_DIR}/iframe ${BUILD_DIR}/wymeditor/wymeditor
	@@cp -pR ${WYM_DIR}/lang ${BUILD_DIR}/wymeditor/wymeditor
	@@cp -pR ${WYM_DIR}/plugins ${BUILD_DIR}/wymeditor/wymeditor
	@@cp -pR ${WYM_DIR}/skins ${BUILD_DIR}/wymeditor/wymeditor

	@@tar -C ${BUILD_DIR} -czf ${WE_ARCH} wymeditor
	
	@@echo ${WE_ARCH} "Built"
	@@echo<commit_msg>tar on Solaris is picky<commit_after>SRC_DIR = src
WYM_DIR = ${SRC_DIR}/wymeditor
BUILD_DIR = dist

JS_FILES = ${WYM_DIR}/core.js\
 ${WYM_DIR}/editor/base.js\
 ${WYM_DIR}/editor/ie.js\
 ${WYM_DIR}/editor/firefox.js\
 ${WYM_DIR}/editor/opera.js\
 ${WYM_DIR}/editor/webkit.js\
 ${WYM_DIR}/parser/xml-helper.js\
 ${WYM_DIR}/parser/xhtml-validator.js\
 ${WYM_DIR}/parser/parallel-regex.js\
 ${WYM_DIR}/parser/state-stack.js\
 ${WYM_DIR}/parser/lexer.js\
 ${WYM_DIR}/parser/xhtml-lexer.js\
 ${WYM_DIR}/parser/xhtml-parser.js\
 ${WYM_DIR}/parser/xhtml-sax-listener.js\
 ${WYM_DIR}/parser/css-lexer.js\
 ${WYM_DIR}/parser/css-parser.js

WE = ${BUILD_DIR}/jquery.wymeditor.js
WE_MIN = ${BUILD_DIR}/jquery.wymeditor.min.js
WE_ARCH = wymeditor.tar.gz

WYM_VER = $(shell cat version.txt)
VER = sed "s/@VERSION/$(WYM_VER)/"

MERGE = cat ${JS_FILES} | perl -pe 's/^\xEF\xBB\xBF//g' | ${VER} > ${WE}
WE_MINIFIER = uglifyjs ${WE} > ${WE_MIN}

all: archive

wymeditor:
	@@echo "Building" ${WE}
	@@mkdir -p ${BUILD_DIR}

	@@echo " - Merging files"
	@@${MERGE}

	@@echo ${WE} "Built"
	@@echo

min: wymeditor
	@@echo "Building" ${WE_MIN}

	@@echo " - Compressing using Uglifier"
	@@${WE_MINIFIER}
	
	@@echo ${WE_MIN} "Built"
	@@echo

archive: min
	@@echo "Building" ${WE_ARCH}

	@@echo " - Creating archive"
	@@mkdir -p ${BUILD_DIR}/wymeditor/wymeditor

	@@cp README.md CHANGELOG.rst AUTHORS *.txt ${BUILD_DIR}/wymeditor
	@@cp -pR ${SRC_DIR}/examples ${BUILD_DIR}/wymeditor
	@@cp -pR ${SRC_DIR}/jquery ${BUILD_DIR}/wymeditor

	@@cp ${WE} ${WE_MIN} ${BUILD_DIR}/wymeditor/wymeditor
	@@cp -pR ${WYM_DIR}/iframe ${BUILD_DIR}/wymeditor/wymeditor
	@@cp -pR ${WYM_DIR}/lang ${BUILD_DIR}/wymeditor/wymeditor
	@@cp -pR ${WYM_DIR}/plugins ${BUILD_DIR}/wymeditor/wymeditor
	@@cp -pR ${WYM_DIR}/skins ${BUILD_DIR}/wymeditor/wymeditor

	@@cd ${BUILD_DIR} && tar -czf ${WE_ARCH} wymeditor
	
	@@echo ${WE_ARCH} "Built"
	@@echo
{'fraction_non_alphanumeric': 0.20681458003169573, 'fraction_numerical': 0.0, 'mean_word_length': 4.472543352601156, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, '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': '1802002', 'n_tokens_mistral': 1732, 'n_tokens_neox': 1623, 'n_words': 271}