<commit_before>SHELL = /bin/bash

coffee_files = $(wildcard src/*.coffee)
js_files = $(coffee_files:src/%.coffee=lib/%.js) lib/grammar.js
bin_dir = node_modules/.bin
js_bundle = assets/index.js

all: build

lib/grammar.js: src/grammar.jison
	$(bin_dir)/jison -o $@ $<

lib/%.js: src/%.coffee
	$(bin_dir)/coffee -co lib $<

$(js_bundle): $(js_files)
	$(bin_dir)/browserify -o $@ lib/index.js
	@echo "// Generated by Browserify" | cat - $@ >$@.tmp && mv $@.tmp $@

.PHONY: build clean test watch

build: $(js_files) $(js_bundle)

clean:
	rm -rf lib $(js_bundle)

test: build
	$(bin_dir)/mocha --growl --colors >/dev/null

watch: test
	@inotifywait \
	  --monitor --quiet \
	  --event modify,close_write,moved_to,move_self,create,delete,delete_self \
	  --exclude ___jb_ \
	  --recursive src test | while read; do make test; done<commit_msg>Suppress --print-directory option from nested `make` calls<commit_after>coffee_files = $(wildcard src/*.coffee)
js_files = $(coffee_files:src/%.coffee=lib/%.js) lib/grammar.js
bin_dir = node_modules/.bin
js_bundle = assets/index.js

all: build

lib/grammar.js: src/grammar.jison
	$(bin_dir)/jison -o $@ $<

lib/%.js: src/%.coffee
	$(bin_dir)/coffee -co lib $<

$(js_bundle): $(js_files)
	$(bin_dir)/browserify -o $@ lib/index.js
	@echo "// Generated by Browserify" | cat - $@ >$@.tmp && mv $@.tmp $@

.PHONY: build clean test watch

build: $(js_files) $(js_bundle)

clean:
	rm -rf lib $(js_bundle)

test: build
	$(bin_dir)/mocha --growl --colors >/dev/null

watch: test
	@while true; do \
	  inotifywait \
	    --event modify,close_write,move,move_self,create,delete,delete_self \
	    --quiet --recursive \
	    src test; \
	  make --no-print-directory test; \
	done
{'fraction_non_alphanumeric': 0.17712609970674487, 'fraction_numerical': 0.0, 'mean_word_length': 3.5737265415549597, 'pattern_counts': {'":': 0, '<': 7, '<?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': '4831054', 'n_tokens_mistral': 714, 'n_tokens_neox': 664, 'n_words': 147}