<commit_before>ifeq ($(MYTARGDIR),)
	MYTARGDIR:=target
endif

CONF_NAME=kurz.conf

ifeq ($(PREFIX),)
	PREFIX:=usr
endif

ifeq ($(STATIC_DIR),)
	STATIC_DIR:=$(PREFIX)/share/kurz
endif

TARG=src/kurz

CLEANFILES=$(MYTARGDIR)


all: bin-dist


$(TARG): src/*.go
	@go build -o $(TARG) src/*.go


clean:
	@rm -r $(CLEANFILES)
	@rm -r $(TARG)

bin-dist: $(TARG) assets
	@cp -rf conf/kurz.conf $(MYTARGDIR)/etc/kurz/
	@sed 's?=static?=$(STATIC_DIR)?' conf/$(CONF_NAME) > $(MYTARGDIR)/etc/kurz/$(CONF_NAME)
	@cp $(TARG) $(MYTARGDIR)/$(PREFIX)/bin
	@git log --pretty=format:"kurz.go %H" -1 > $(MYTARGDIR)/$(STATIC_DIR)/_version


assets: directories
	@cp -r stuff/assets/* $(MYTARGDIR)/$(STATIC_DIR)


directories:
	@mkdir -p $(MYTARGDIR)/$(STATIC_DIR)
	@mkdir -p $(MYTARGDIR)/etc/kurz/
	@mkdir -p $(MYTARGDIR)/etc/rc.d/init.d/
	@mkdir -p $(MYTARGDIR)/$(PREFIX)/bin

.PHONY: clean bin-dist assets directories kurz<commit_msg>add test target to Makefile; more tests to come<commit_after>ifeq ($(MYTARGDIR),)
	MYTARGDIR:=target
endif

CONF_NAME=kurz.conf

ifeq ($(PREFIX),)
	PREFIX:=usr
endif

ifeq ($(STATIC_DIR),)
	STATIC_DIR:=$(PREFIX)/share/kurz
endif

TARG=src/kurz

CLEANFILES=$(MYTARGDIR)


all: bin-dist


$(TARG): src/*.go
	@go build -o $(TARG) src/*.go

test: src/*.go
	go test src/*.go

clean:
	@rm -r $(CLEANFILES)
	@rm -r $(TARG)

bin-dist: $(TARG) assets
	@cp -rf conf/kurz.conf $(MYTARGDIR)/etc/kurz/
	@sed 's?=static?=$(STATIC_DIR)?' conf/$(CONF_NAME) > $(MYTARGDIR)/etc/kurz/$(CONF_NAME)
	@cp $(TARG) $(MYTARGDIR)/$(PREFIX)/bin
	@git log --pretty=format:"kurz.go %H" -1 > $(MYTARGDIR)/$(STATIC_DIR)/_version


assets: directories
	@cp -r stuff/assets/* $(MYTARGDIR)/$(STATIC_DIR)


directories:
	@mkdir -p $(MYTARGDIR)/$(STATIC_DIR)
	@mkdir -p $(MYTARGDIR)/etc/kurz/
	@mkdir -p $(MYTARGDIR)/etc/rc.d/init.d/
	@mkdir -p $(MYTARGDIR)/$(PREFIX)/bin

.PHONY: clean bin-dist assets directories test
{'fraction_non_alphanumeric': 0.20853080568720378, 'fraction_numerical': 0.00105318588730911, 'mean_word_length': 4.539358600583091, 'pattern_counts': {'":': 0, '<': 3, '<?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': '3964743', 'n_tokens_mistral': 885, 'n_tokens_neox': 819, 'n_words': 164}