<commit_before># Copyright (c) 2010, NorthScale, Inc.
# All rights reserved.
TMP_DIR=./tmp
TMP_VER=$(TMP_DIR)/version_num.tmp
DIST_DIR=$(TMP_DIR)/menelaus
SPROCKETIZE=sprocketize
REBAR=../../rebar

.PHONY: ebins version

# always rebuild TMP_VER just in case someone depends on it be
# up-to-date
.PHONY: $(TMP_VER)

all: deps priv/public/js/all.js ebins

ebins: src/menelaus.app.src
	test -d ebin || mkdir ebin
	$(REBAR) compile

src/menelaus.app.src: src/menelaus.app.src.in $(TMP_VER)
	(sed s/0.0.0/`cat $(TMP_VER)`/g $< > $@) || (rm $@ && false)

$(TMP_VER):
	test -d $(TMP_DIR) || mkdir $(TMP_DIR)
	(git describe | sed s/-/_/g > $(TMP_VER)) || (rm $@ && false)

priv/js/all-images.js: priv/public/images priv/public/images/spinner build-all-images.rb
	ruby build-all-images.rb >$@

priv/public/js/all.js: priv/js/*.js priv/js/all-images.js
	mkdir -p `dirname $@`
	$(SPROCKETIZE) -I priv/js priv/js/app.js >$@ || (rm $@ && false)

priv/public/js/t-all.js: priv/js/*.js priv/js/all-images.js
	mkdir -p `dirname $@`
	$(SPROCKETIZE) -I priv/js priv/js/app.js priv/js/hooks.js >$@ || (rm $@ && false)

deps:
	test -d deps/mochiweb/ebin || mkdir deps/mochiweb/ebin
	(cd deps/mochiweb; $(MAKE))
	(cd deps/erlwsh; $(MAKE))

clean:
	-rm -f ebin/*
	@(cd deps/mochiweb; $(MAKE) clean)
	rm -f menelaus_*.tar.gz priv/public/js/t-all.js priv/public/js/all.js
	@(cd deps/erlwsh; $(MAKE) clean)
	rm -f $(TMP_VER)
	rm -rf $(DIST_DIR)
	rm -f TAGS

test: all
	erl -pa ../../ebin ./ebin ./deps/*/ebin -noshell -s t start -s init stop -kernel error_logger silent

bdist: clean all
	test -d $(DIST_DIR)/deps/menelaus/priv || mkdir -p $(DIST_DIR)/deps/menelaus/priv
	cp -R ebin $(DIST_DIR)/deps/menelaus
	cp -R priv/public $(DIST_DIR)/deps/menelaus/priv/public
	cp -R deps/mochiweb $(DIST_DIR)/deps/mochiweb
	cp -R deps/erlwsh $(DIST_DIR)/deps/erlwsh
	tar --directory=$(TMP_DIR) -czf menelaus_`cat $(TMP_VER)`.tar.gz menelaus
	echo created menelaus_`cat $(TMP_VER)`.tar.gz

.PHONY: deps bdist clean TAGS
<commit_msg>don't leave empty all-images.js if ruby is missing<commit_after># Copyright (c) 2010, NorthScale, Inc.
# All rights reserved.
TMP_DIR=./tmp
TMP_VER=$(TMP_DIR)/version_num.tmp
DIST_DIR=$(TMP_DIR)/menelaus
SPROCKETIZE=sprocketize
REBAR=../../rebar

.PHONY: ebins version

# always rebuild TMP_VER just in case someone depends on it be
# up-to-date
.PHONY: $(TMP_VER)

all: deps priv/public/js/all.js ebins

ebins: src/menelaus.app.src
	test -d ebin || mkdir ebin
	$(REBAR) compile

src/menelaus.app.src: src/menelaus.app.src.in $(TMP_VER)
	(sed s/0.0.0/`cat $(TMP_VER)`/g $< > $@) || (rm $@ && false)

$(TMP_VER):
	test -d $(TMP_DIR) || mkdir $(TMP_DIR)
	(git describe | sed s/-/_/g > $(TMP_VER)) || (rm $@ && false)

priv/js/all-images.js: priv/public/images priv/public/images/spinner build-all-images.rb
	ruby build-all-images.rb >$@ || (rm $@ && false)

priv/public/js/all.js: priv/js/*.js priv/js/all-images.js
	mkdir -p `dirname $@`
	$(SPROCKETIZE) -I priv/js priv/js/app.js >$@ || (rm $@ && false)

priv/public/js/t-all.js: priv/js/*.js priv/js/all-images.js
	mkdir -p `dirname $@`
	$(SPROCKETIZE) -I priv/js priv/js/app.js priv/js/hooks.js >$@ || (rm $@ && false)

deps:
	test -d deps/mochiweb/ebin || mkdir deps/mochiweb/ebin
	(cd deps/mochiweb; $(MAKE))
	(cd deps/erlwsh; $(MAKE))

clean:
	-rm -f ebin/*
	@(cd deps/mochiweb; $(MAKE) clean)
	rm -f menelaus_*.tar.gz priv/public/js/t-all.js priv/public/js/all.js
	@(cd deps/erlwsh; $(MAKE) clean)
	rm -f $(TMP_VER)
	rm -rf $(DIST_DIR)
	rm -f TAGS

test: all
	erl -pa ../../ebin ./ebin ./deps/*/ebin -noshell -s t start -s init stop -kernel error_logger silent

bdist: clean all
	test -d $(DIST_DIR)/deps/menelaus/priv || mkdir -p $(DIST_DIR)/deps/menelaus/priv
	cp -R ebin $(DIST_DIR)/deps/menelaus
	cp -R priv/public $(DIST_DIR)/deps/menelaus/priv/public
	cp -R deps/mochiweb $(DIST_DIR)/deps/mochiweb
	cp -R deps/erlwsh $(DIST_DIR)/deps/erlwsh
	tar --directory=$(TMP_DIR) -czf menelaus_`cat $(TMP_VER)`.tar.gz menelaus
	echo created menelaus_`cat $(TMP_VER)`.tar.gz

.PHONY: deps bdist clean TAGS

{'fraction_non_alphanumeric': 0.18874907475943745, 'fraction_numerical': 0.0034542314335060447, 'mean_word_length': 3.591166477916195, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 13, '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': '7020660', 'n_tokens_mistral': 1855, 'n_tokens_neox': 1803, 'n_words': 391}