<commit_before>VSN=2.0.28a
ERLC=/usr/bin/env erlc
ERL=/usr/bin/env erl
APPDIR= $(abspath ./_build/sinan/lib/sinan-$(VSN))
SRCDIR=src
TESTDIR=test
COPYDIRS= include src test
BEAMDIR=$(APPDIR)/ebin
SMOKETEST_DIR=$(CURDIR)/smoketests
PYPATH=$(PYTHONPATH):$(SMOKETEST_DIR)
BEHAVIOURS= src/sin_task.erl src/sin_dep_resolver.erl
RSYNC_OPTIONS=-vaz --delete
.SUFFIXES: .erl .beam .yrl

vpath %.erl src test

ERL_OBJ = $(patsubst src/%.erl,$(BEAMDIR)/%.beam, $(wildcard $(SRCDIR)/*erl))
ERL_TEST_OBJ = $(patsubst test/%.erl,$(BEAMDIR)/%.beam, $(wildcard $(TESTDIR)/*erl))

all: main

setup:
	for f in $(COPYDIRS) ; do	\
		mkdir -p $(APPDIR)/$$f ; \
		rsync $(RSYNC_OPTIONS) $$f $(APPDIR); \
	done
	mkdir -p $(APPDIR)/ebin;
	rsync $(RSYNC_OPTIONS) ebin/sinan.app $(APPDIR)/ebin/sinan.app

build_behaviours: $(BEHAVIOURS)
        # make sure sin_task gets built first so its always available
	$(ERLC) -pa $(BEAMDIR) +warn_export_vars +warn_export_all \
	+warn_obsolete_guard \
	+warnings_as_errors +bin_opt_info +debug_info -W -o $(BEAMDIR) $(BEHAVIOURS)

main: setup build_behaviours ${ERL_OBJ} ${ERL_TEST_OBJ}

$(BEAMDIR)/%.beam: %.erl
	$(ERLC) -pa $(BEAMDIR) +warn_export_vars +warn_export_all \
	+warn_obsolete_guard \
	+warnings_as_errors +bin_opt_info +debug_info -W -o $(BEAMDIR) $<

build: main
	$(ERL) -pa $(BEAMDIR) -s sinan main -extra -s $(CURDIR) build

escript: main
	$(ERL) -pa $(BEAMDIR) -s sinan main -extra -s $(CURDIR) escript

cucumber: main
	$(ERL) -pa $(BEAMDIR) -s sinan main -extra -s $(CURDIR) cucumber

proper: main
	$(ERL) -pa $(BEAMDIR) -s sinan main -extra -s $(CURDIR) proper

eunit: main
	$(ERL) -pa $(BEAMDIR) -s sinan main -extra -s $(CURDIR) eunit

dialyzer: main
	$(ERL) -pa $(BEAMDIR) -s sinan main -extra -s $(CURDIR) dialyzer

run: main
	$(ERL) -pa $(BEAMDIR)

debug: main
	$(ERL) -pa $(BEAMDIR) -s debugger start

smoketests: main
	for f in $(wildcard $(SMOKETEST_DIR)/tests/*.py) ; do	\
		PYTHONPATH=$(PYPATH) python2 $$f ; \
	done

testall : cucumber proper eunit smoketests

gh-pages:
	./do-gh-pages

clean:
	rm -rf _build ;
	rm -rf erl_crash.dump<commit_msg>Solve problem in sinan app naming resolution for debian packaging<commit_after>VSN=2.0.28a
ERLC=/usr/bin/env erlc
ERL=/usr/bin/env erl
APPDIR= $(abspath ./_build/sinan/lib/sinan-$(VSN))
SRCDIR=src
TESTDIR=test
COPYDIRS= include src test
BEAMDIR=$(APPDIR)/ebin
SMOKETEST_DIR=$(CURDIR)/smoketests
PYPATH=$(PYTHONPATH):$(SMOKETEST_DIR)
BEHAVIOURS= src/sin_task.erl src/sin_dep_resolver.erl
SINFLAGS=-s $(CURDIR) -p sinan -n $(VSN)
RSYNC_OPTIONS=-vaz --delete
.SUFFIXES: .erl .beam .yrl

vpath %.erl src test

ERL_OBJ = $(patsubst src/%.erl,$(BEAMDIR)/%.beam, $(wildcard $(SRCDIR)/*erl))
ERL_TEST_OBJ = $(patsubst test/%.erl,$(BEAMDIR)/%.beam, $(wildcard $(TESTDIR)/*erl))

all: main

setup:
	for f in $(COPYDIRS) ; do	\
		mkdir -p $(APPDIR)/$$f ; \
		rsync $(RSYNC_OPTIONS) $$f $(APPDIR); \
	done
	mkdir -p $(APPDIR)/ebin;
	rsync $(RSYNC_OPTIONS) ebin/sinan.app $(APPDIR)/ebin/sinan.app

build_behaviours: $(BEHAVIOURS)
        # make sure sin_task gets built first so its always available
	$(ERLC) -pa $(BEAMDIR) +warn_export_vars +warn_export_all \
	+warn_obsolete_guard \
	+warnings_as_errors +bin_opt_info +debug_info -W -o $(BEAMDIR) $(BEHAVIOURS)

main: setup build_behaviours ${ERL_OBJ} ${ERL_TEST_OBJ}

$(BEAMDIR)/%.beam: %.erl
	$(ERLC) -pa $(BEAMDIR) +warn_export_vars +warn_export_all \
	+warn_obsolete_guard \
	+warnings_as_errors +bin_opt_info +debug_info -W -o $(BEAMDIR) $<

build: main
	$(ERL) -pa $(BEAMDIR) -s sinan main -extra $(SINFLAGS) build

escript: main
	$(ERL) -pa $(BEAMDIR) -s sinan main -extra $(SINFLAGS) escript

cucumber: main
	$(ERL) -pa $(BEAMDIR) -s sinan main -extra $(SINFLAGS) cucumber

proper: main
	$(ERL) -pa $(BEAMDIR) -s sinan main -extra $(SINFLAGS) proper

eunit: main
	$(ERL) -pa $(BEAMDIR) -s sinan main -extra $(SINFLAGS) eunit

dialyzer: main
	$(ERL) -pa $(BEAMDIR) -s sinan main -extra $(SINFLAGS) dialyzer

run: main
	$(ERL) -pa $(BEAMDIR)

debug: main
	$(ERL) -pa $(BEAMDIR) -s debugger start

smoketests: main
	for f in $(wildcard $(SMOKETEST_DIR)/tests/*.py) ; do	\
		PYTHONPATH=$(PYPATH) python $$f ; \
	done

testall : cucumber proper eunit smoketests

gh-pages:
	./do-gh-pages

clean:
	rm -rf _build ;
	rm -rf erl_crash.dump
{'fraction_non_alphanumeric': 0.16635426429240863, 'fraction_numerical': 0.0021087160262417996, 'mean_word_length': 4.35633626097867, 'pattern_counts': {'":': 0, '<': 5, '<?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': '6353584', 'n_tokens_mistral': 1911, 'n_tokens_neox': 1863, 'n_words': 444}