<commit_before>PREFIX?=/usr/local
INSTALL?=install

VERSION?=$(shell git describe HEAD --always)

all: stbt

stbt:
	sed s!@PREFIX@!$(PREFIX)!g stbt.in > stbt

install: stbt doc
	$(INSTALL) --mode 0755 -d $(DESTDIR)$(PREFIX)/{bin,lib/stbt}
	$(INSTALL) --mode 0755 -t $(DESTDIR)$(PREFIX)/bin stbt
	$(INSTALL) --mode 0755 -t $(DESTDIR)$(PREFIX)/lib/stbt stbt-record stbt-run
	$(INSTALL) --mode 0644 -t $(DESTDIR)$(PREFIX)/lib/stbt stbt.py
	$(INSTALL) --mode 0644 -t $(DESTDIR)$(PREFIX)/share/man/man1 stbt.1

doc: stbt.1

# Requires python-docutils
stbt.1: README.rst
	sed -e 's/^:Version: .*/:Version: $(VERSION)/' $< |\
	rst2man > $@

# Can only be run from within a git clone of stb-tester or VERSION wont be
# set correctly
dist: stb-tester-$(VERSION).tar.gz

stb-tester-$(VERSION).tar.gz:
	git archive HEAD --prefix stb-tester-$(VERSION)/ \
		-o stb-tester-$(VERSION).tar
	gzip stb-tester-$(VERSION).tar<commit_msg>Makefile: Delete the target produced by rule if there was an error.<commit_after>PREFIX?=/usr/local
INSTALL?=install

VERSION?=$(shell git describe HEAD --always)

all: stbt

stbt:
	sed s!@PREFIX@!$(PREFIX)!g stbt.in > stbt

install: stbt doc
	$(INSTALL) --mode 0755 -d $(DESTDIR)$(PREFIX)/{bin,lib/stbt}
	$(INSTALL) --mode 0755 -t $(DESTDIR)$(PREFIX)/bin stbt
	$(INSTALL) --mode 0755 -t $(DESTDIR)$(PREFIX)/lib/stbt stbt-record stbt-run
	$(INSTALL) --mode 0644 -t $(DESTDIR)$(PREFIX)/lib/stbt stbt.py
	$(INSTALL) --mode 0644 -t $(DESTDIR)$(PREFIX)/share/man/man1 stbt.1

doc: stbt.1

# Requires python-docutils
stbt.1: README.rst
	sed -e 's/^:Version: .*/:Version: $(VERSION)/' $< |\
	rst2man > $@

# Can only be run from within a git clone of stb-tester or VERSION wont be
# set correctly
dist: stb-tester-$(VERSION).tar.gz

stb-tester-$(VERSION).tar.gz:
	git archive HEAD --prefix stb-tester-$(VERSION)/ \
		-o stb-tester-$(VERSION).tar
	gzip stb-tester-$(VERSION).tar

.DELETE_ON_ERROR:
{'fraction_non_alphanumeric': 0.18772941793392764, 'fraction_numerical': 0.026219192448872573, 'mean_word_length': 4.021052631578947, 'pattern_counts': {'":': 0, '<': 5, '<?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': '3641684', 'n_tokens_mistral': 813, 'n_tokens_neox': 752, 'n_words': 187}