<commit_before>COMPILER_JAR=../closure-compiler/compiler.jar
CLOSURE_DIR=../closure-library/closure
CALCDEPS=$(CLOSURE_DIR)/bin/calcdeps.py
CALCDEPS_FLAGS=-o compiled --compiler_jar=$(COMPILER_JAR) -p $(CLOSURE_DIR) -p . \
               -f --compilation_level=ADVANCED_OPTIMIZATIONS \
               -f --warning_level=VERBOSE \
               -f '--output_wrapper="(function(){%output%})()"'
EXPORT_FILES=bm.js bookmarklet.js run.js all.js prettify.js

all: dirs _build

dirs: build

build:
	mkdir build

_build: $(foreach file, $(EXPORT_FILES), build/$(file))

clean:
	@rm -vf $(foreach file, $(EXPORT_FILES), build/$(file))

build/%: exports/%
	$(CALCDEPS) $(CALCDEPS_FLAGS) -i $^ --output_file=$@

# TODO: generate this automatically {{{1

exports/bm.js: jsprettify/prettify_text_inputs.js

exports/all.js: jsprettify/*.js

exports/prettify.js: jsprettify/prettify.js
<commit_msg>Add bookmarklet rule to Makefile<commit_after>COMPILER_JAR=../closure-compiler/compiler.jar
CLOSURE_DIR=../closure-library/closure
CALCDEPS=$(CLOSURE_DIR)/bin/calcdeps.py
CALCDEPS_FLAGS=-o compiled --compiler_jar=$(COMPILER_JAR) -p $(CLOSURE_DIR) -p . \
               -f --compilation_level=ADVANCED_OPTIMIZATIONS \
               -f --warning_level=VERBOSE \
               -f '--output_wrapper="(function(){%output%})()"'
EXPORT_FILES=bm.js bookmarklet.js run.js all.js prettify.js

all: dirs _build

dirs: build

build:
	mkdir build

_build: $(foreach file, $(EXPORT_FILES), build/$(file)) gadgets/bookmarklet.html

clean:
	@rm -vf $(foreach file, $(EXPORT_FILES), build/$(file))

build/%: exports/%
	$(CALCDEPS) $(CALCDEPS_FLAGS) -i $^ --output_file=$@

gadgets/bookmarklet.html: build/bookmarklet.js
	./bookmarklet.sh

# TODO: generate this automatically {{{1

exports/bm.js: jsprettify/prettify_text_inputs.js

exports/all.js: jsprettify/*.js

exports/prettify.js: jsprettify/prettify.js

{'fraction_non_alphanumeric': 0.1574468085106383, 'fraction_numerical': 0.0010638297872340426, 'mean_word_length': 4.002659574468085, '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': '7066956', 'n_tokens_mistral': 732, 'n_tokens_neox': 706, 'n_words': 122}