<commit_before># Copyright (c) 2010, NorthScale, Inc.
# All rights reserved.
SHELL=/bin/sh

EFLAGS=-pa ./ebin ./deps/*/ebin ./deps/*/deps/*/ebin

TMP_DIR=./tmp

TMP_VER=$(TMP_DIR)/version_num.tmp

.PHONY: ebins ebin_app version

all: ebins deps_all

deps_menelaus:
	(cd deps/menelaus && $(MAKE) all)

deps_smtp:
	(cd deps/gen_smtp && $(MAKE) ebins)

deps_all: deps_menelaus deps_smtp

ebins: ebin_app
	test -d ebin || mkdir ebin
	erl -noinput +B $(EFLAGS) -eval 'case make:all() of up_to_date -> halt(0); error -> halt(1) end.'

ebin_app: version
	test -d ebin || mkdir ebin
	sed s/0.0.0/`cat $(TMP_VER)`/g src/ns_server.app.src > ebin/ns_server.app

version:
	test -d $(TMP_DIR) || mkdir $(TMP_DIR)
	git describe | sed s/-/_/g > $(TMP_VER)

bdist: clean ebins deps_all
	(cd .. && tar cf -  \
                          ns_server/ebin \
                          ns_server/deps/*/ebin \
                          ns_server/deps/*/deps/*/ebin \
                          ns_server/deps/menelaus/priv/public | gzip -9 -c > \
                          ns_server/ns_server_`cat ns_server/$(TMP_VER)`.tar.gz )
	echo created ns_server_`cat $(TMP_VER)`.tar.gz

clean clean_all:
	@(cd deps/menelaus && $(MAKE) clean)
	@(cd deps/gen_smtp && $(MAKE) clean)
	rm -f $(TMP_VER)
	rm -f $(TMP_DIR)/*.cov.html
	rm -f cov.html
	rm -f erl_crash.dump
	rm -f ns_server_*.tar.gz
	rm -f src/ns_server.app
	rm -rf test/log
	rm -rf ebin

test: test_$(OS)

test_: test_unit test_menelaus

test_Windows_NT: test_unit test_menelaus

test_unit: ebins
	erl $(EFLAGS) -noshell -s t start -s init stop -kernel error_logger silent

test_menelaus: deps/menelaus
	(cd deps/menelaus; $(MAKE) test)

# assuming exuberant-ctags
TAGS:
	ctags -eR .

dialyzer: ebins
	dialyzer -pa ebin -r .

features/Makefile:
	(cd features && ../test/parallellize_features.rb) >features/Makefile

.PHONY : features/Makefile

parallel_cucumber: features/Makefile
	$(MAKE) -k -C features all_branches<commit_msg>Make "make dialyzer" more useful.<commit_after># Copyright (c) 2010, NorthScale, Inc.
# All rights reserved.
SHELL=/bin/sh

EFLAGS=-pa ./ebin ./deps/*/ebin ./deps/*/deps/*/ebin

TMP_DIR=./tmp

TMP_VER=$(TMP_DIR)/version_num.tmp

.PHONY: ebins ebin_app version

all: ebins deps_all

deps_menelaus:
	(cd deps/menelaus && $(MAKE) all)

deps_smtp:
	(cd deps/gen_smtp && $(MAKE) ebins)

deps_all: deps_menelaus deps_smtp

ebins: ebin_app
	test -d ebin || mkdir ebin
	erl -noinput +B $(EFLAGS) -eval 'case make:all() of up_to_date -> halt(0); error -> halt(1) end.'

ebin_app: version
	test -d ebin || mkdir ebin
	sed s/0.0.0/`cat $(TMP_VER)`/g src/ns_server.app.src > ebin/ns_server.app

version:
	test -d $(TMP_DIR) || mkdir $(TMP_DIR)
	git describe | sed s/-/_/g > $(TMP_VER)

bdist: clean ebins deps_all
	(cd .. && tar cf -  \
                          ns_server/ebin \
                          ns_server/deps/*/ebin \
                          ns_server/deps/*/deps/*/ebin \
                          ns_server/deps/menelaus/priv/public | gzip -9 -c > \
                          ns_server/ns_server_`cat ns_server/$(TMP_VER)`.tar.gz )
	echo created ns_server_`cat $(TMP_VER)`.tar.gz

clean clean_all:
	@(cd deps/menelaus && $(MAKE) clean)
	@(cd deps/gen_smtp && $(MAKE) clean)
	rm -f $(TMP_VER)
	rm -f $(TMP_DIR)/*.cov.html
	rm -f cov.html
	rm -f erl_crash.dump
	rm -f ns_server_*.tar.gz
	rm -f src/ns_server.app
	rm -rf test/log
	rm -rf ebin

test: test_$(OS)

test_: test_unit test_menelaus

test_Windows_NT: test_unit test_menelaus

test_unit: ebins
	erl $(EFLAGS) -noshell -s t start -s init stop -kernel error_logger silent

test_menelaus: deps/menelaus
	(cd deps/menelaus; $(MAKE) test)

# assuming exuberant-ctags
TAGS:
	ctags -eR .

dialyzer: ebins
	dialyzer --build_plt --apps erts kernel stdlib mnesia crypto -pa ebin -r .

features/Makefile:
	(cd features && ../test/parallellize_features.rb) >features/Makefile

.PHONY : features/Makefile

parallel_cucumber: features/Makefile
	$(MAKE) -k -C features all_branches
{'fraction_non_alphanumeric': 0.1399497487437186, 'fraction_numerical': 0.005025125628140704, 'mean_word_length': 2.816874400767018, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 15, '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': '5742447', 'n_tokens_mistral': 1683, 'n_tokens_neox': 1658, 'n_words': 382}