<commit_before>PREFIX=/usr/local
DESTDIR=
PYTHONVER=$(shell pkg-config --modversion python3 2>/dev/null)

BINDIR=$(DESTDIR)$(PREFIX)/bin
PYLIBDIR=$(DESTDIR)$(PREFIX)/lib/python$(PYTHONVER)/site-packages
DOCDIR=$(DESTDIR)$(PREFIX)/share/doc/ua
MANDIR=$(DESTDIR)$(PREFIX)/share/man

GODIRS=ggs rss2json maildir-put ua-inline

export GOPATH := $(PWD)/tmp-go

.PHONY: all clean doc

all: ggs/ggs rss2json/rss2json maildir-put/maildir-put ua-inline/ua-inline
doc:
	test -d doc || mkdir doc
	test -f doc/ua.md || ln -s ../README.md doc/ua.md
	for d in $(GODIRS) ; do test -f doc/$$d.md || ln -s ../$$d/README.md doc/$$d.md ; done
	cd doc ; for f in *.md ; do ronn $$f ; done

ggs/ggs: ggs/ggs.go tmp-go
	cd ggs; go get -d && go build

rss2json/rss2json: rss2json/rss2json.go tmp-go
	cd rss2json; go get -d && go build

maildir-put/maildir-put: maildir-put/maildir-put.go maildir-put/cache.go tmp-go
	cd maildir-put; go get -d && go build

ua-inline/ua-inline: ua-inline/ua-inline.go tmp-go
	cd ua-inline; go get -d && go build

tmp-go:
	mkdir tmp-go
	mkdir tmp-go/bin
	mkdir tmp-go/src
	mkdir tmp-go/pkg

install: all
	install -d $(BINDIR)
	for f in $(GODIRS) ; do install $$f/$$f $(BINDIR)/ ; done
	install scrappers/mangareader2json $(BINDIR)/
	install scrappers/ipboard2json $(BINDIR)/
	install scrappers/medscape2json $(BINDIR)/
	<commit_msg>Use default $GOPATH<commit_after>PREFIX=/usr/local
DESTDIR=
PYTHONVER=$(shell pkg-config --modversion python3 2>/dev/null)

BINDIR=$(DESTDIR)$(PREFIX)/bin
PYLIBDIR=$(DESTDIR)$(PREFIX)/lib/python$(PYTHONVER)/site-packages
DOCDIR=$(DESTDIR)$(PREFIX)/share/doc/ua
MANDIR=$(DESTDIR)$(PREFIX)/share/man

GODIRS=ggs rss2json maildir-put ua-inline

export GOPATH ?= $(PWD)/tmp-go

.PHONY: all clean doc

all: ggs/ggs rss2json/rss2json maildir-put/maildir-put ua-inline/ua-inline
doc:
	test -d doc || mkdir doc
	test -f doc/ua.md || ln -s ../README.md doc/ua.md
	for d in $(GODIRS) ; do test -f doc/$$d.md || ln -s ../$$d/README.md doc/$$d.md ; done
	cd doc ; for f in *.md ; do ronn $$f ; done

ggs/ggs: ggs/ggs.go $(GOPATH)
	cd ggs; go get -d && go build

rss2json/rss2json: rss2json/rss2json.go $(GOPATH)
	cd rss2json; go get -d && go build

maildir-put/maildir-put: maildir-put/maildir-put.go maildir-put/cache.go $(GOPATH)
	cd maildir-put; go get -d && go build

ua-inline/ua-inline: ua-inline/ua-inline.go $(GOPATH)
	cd ua-inline; go get -d && go build

$(GOPATH):
	mkdir $(GOPATH)
	mkdir $(GOPATH)/bin
	mkdir $(GOPATH)/src
	mkdir $(GOPATH)/pkg

install: all
	install -d $(BINDIR)
	for f in $(GODIRS) ; do install $$f/$$f $(BINDIR)/ ; done
	install scrappers/mangareader2json $(BINDIR)/
	install scrappers/ipboard2json $(BINDIR)/
	install scrappers/medscape2json $(BINDIR)/
	
{'fraction_non_alphanumeric': 0.16771102100995208, 'fraction_numerical': 0.009583486914854404, 'mean_word_length': 3.8464285714285715, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '5051010', 'n_tokens_mistral': 1167, 'n_tokens_neox': 1145, 'n_words': 274}