<commit_before>NODE ?= "./node_modules/"
KARMA ?= "$(NODE)/karma/bin/karma"
PEGJS ?= "$(NODE)/pegjs/bin/pegjs"

all: compile min

get-deps:
	npm install

compile: get-deps
	mkdir -p build
	cat src/dice.js src/dice.parse.js src/dice.eval.js > build/dice.js

min: compile
	java -jar compiler.jar --language_in ECMASCRIPT5 --js build/dice.js --js_output_file build/dice.min.js

peg:
	$(PEGJS) -e dice.parse src/dice.peg src/dice.parse.js

test: get-deps peg compile
	$(KARMA) start karma.conf.js --single-run

dbgtest: get-deps peg compile
	$(KARMA) start karma.conf.js

clean:
	rm -rf $(NODE)<commit_msg>Updated makefile with browserify and fixes.<commit_after>NODE ?= "./node_modules/.bin"
KARMA ?= "$(NODE)/karma"
PEGJS ?= "$(NODE)/pegjs"
BROWSERIFY ?= "$(NODE)/browserify"

all: compile min

get-deps:
	npm install

compile: get-deps
	mkdir -p build
#	cat src/dice.js src/dice.parse.js src/dice.eval.js > build/dice.js
	$(BROWSERIFY) -e src/dice.js > build/dice.js -s dice

min: compile
	java -jar compiler.jar --language_in ECMASCRIPT5 --js build/dice.js --js_output_file build/dice.min.js

peg:
	$(PEGJS) src/dice.peg src/parser.js

test: node_test browser_test

browser_test: get-deps peg compile
	$(KARMA) start karma.conf.js --single-run

dbgtest: get-deps peg compile
	$(KARMA) start karma.conf.js

node_test: get-deps peg compile
	$(NODE)/jasmine-node tests

clean:
	rm -rf $(NODE)
{'fraction_non_alphanumeric': 0.1511879049676026, 'fraction_numerical': 0.0014398848092152627, 'mean_word_length': 3.793103448275862, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 6, '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': '1703127', 'n_tokens_mistral': 581, 'n_tokens_neox': 562, 'n_words': 135}