<commit_before>DOMAIN?=localhost:8000
DEBUG?=false

CLOSURECOMPILER=compiler.jar
ifeq ($(wildcard $(CLOSURECOMPILER)),)
	DEBUG=true
endif
GOFILES=eventtype.go location.go main.go user.go
JSFILES=js/jscolor.js js/msgpack.js js/script.js

all: vandal static/script.js templates/index.html

vandal: $(GOFILES)
	go build -o vandal $(GOFILES)

.PHONY: templates/index.html static/script.js mrproper

templates/index.html: templates/index.html.orig
	sed 's/DOMAIN_PLACEHOLDER/'$(DOMAIN)'/g' templates/index.html.orig > templates/index.html

static/script.js: $(JSFILES)
ifeq ($(DEBUG),true)
		cat $(JSFILES) > static/script.js
		echo "You sould get google closure-compiler from http://code.google.com/p/closure-compiler/"
		echo "and put compiler.jar in this folder."
		echo "I will only concatenate script files (no minifyingg)."
else
		java -jar $(CLOSURECOMPILER) --js $(JSFILES) --compilation_level SIMPLE_OPTIMIZATIONS --js_output_file static/script.js
endif
	sed -i 's/DOMAIN_PLACEHOLDER/'$(DOMAIN)'/g' static/script.js

mrproper:
	rm static/script.js templates/index.html vandal<commit_msg>Makefile factorisation<commit_after>DOMAIN?=localhost:8000
DEBUG?=false

CLOSURECOMPILER=compiler.jar
ifeq ($(wildcard $(CLOSURECOMPILER)),)
	DEBUG=true
endif
GOOUT=vandal
GOFILES=eventtype.go location.go main.go user.go
JSOUT=static/script.js
JSFILES=js/jscolor.js js/msgpack.js js/script.js
HTMLOUT=templates/index.html
HTMLFILES=$(HTMLOUT).orig

all: $(GOOUT) $(JSOUT) $(HTMLOUT)

$(GOOUT): $(GOFILES)
	go build -o $(GOOUT) $(GOFILES)

.PHONY: $(HTMLOUT) $(JSOUT) mrproper

$(HTMLOUT): $(HTMLFILES)
	sed 's/DOMAIN_PLACEHOLDER/'$(DOMAIN)'/g' $(HTMLFILES) > $(HTMLOUT)

$(JSOUT): $(JSFILES)
ifeq ($(DEBUG),true)
		cat $(JSFILES) > $(JSOUT)
		echo "You sould get google closure-compiler from http://code.google.com/p/closure-compiler/"
		echo "and put compiler.jar in this folder."
		echo "I will only concatenate script files (no minifyingg)."
else
		java -jar $(CLOSURECOMPILER) --js $(JSFILES) --compilation_level SIMPLE_OPTIMIZATIONS --js_output_file $(JSOUT)
endif
	sed -i 's/DOMAIN_PLACEHOLDER/'$(DOMAIN)'/g' $(JSOUT)

mrproper:
	rm $(JSOUT) $(HTMLOUT) $(GOOUT)
{'fraction_non_alphanumeric': 0.15106580166821132, 'fraction_numerical': 0.0037071362372567192, 'mean_word_length': 5.368731563421829, 'pattern_counts': {'":': 0, '<': 3, '<?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': '1098030', 'n_tokens_mistral': 870, 'n_tokens_neox': 820, 'n_words': 178}