<commit_before>
SHELL    = /bin/bash
SRC_LIST := main.go,dbcc.go
PRG      ?= $(shell basename $$PWD)
LOG      ?= $(PRG).log
PID      ?= /tmp/$(PRG).pid
HOST     ?= localhost
PORT     ?= 8000
ARCH     ?= amd64
OSARCH   ?= linux/$(ARCH)
ALLARCH  ?= "linux/amd64 linux/386 windows/amd64 darwin/386"
GOPATH   ?=
DBUSER   ?= op
APPUSER  ?= appuser
APPPASS  ?= apppass
KEYFILE  ?= .appkey

all: chkgo clean build test sum

dist: chkgo clean buildall sum

chkgo:
	@echo "*** $@ ***"
	@[ -f $(GOPATH)/bin/gox ] || { echo "Error: gox compiler not found" ; exit 1 ; }

clean:
	@echo "*** $@ ***"
	@for f in bin/$(PRG)*; do [ -e "$$f" ] && rm "$$f" || echo "no files" ; done
	@[ -d bin ] && [ -f bin/SHA256SUMS ] && rm bin/SHA256SUMS || true 
	@[ -d bin ] && rm -d bin || true

build:
	@echo "*** $@ ***"
	@[ -d bin ] || mkdir bin
	@pushd bin ; \
	gox -osarch="$(OSARCH)" ../ && popd || { popd ; exit 1 ; }

buildall:
	@echo "*** $@ ***"
	@[ -d bin ] || mkdir bin
	@pushd bin ; \
	gox -osarch=$(ALLARCH) ../ && popd || { popd ; exit 1 ; }

test:
	@echo "*** $@ ***"
	go test

testall:
	@echo "*** $@ ***"
	@PGUSER=$(DBUSER) DBCC_TEST_DB=1 go test<commit_msg>added buildpack target for creating zips<commit_after>
SHELL    = /bin/bash
SRC_LIST := main.go,dbcc.go
PRG      ?= $(shell basename $$PWD)
LOG      ?= $(PRG).log
PID      ?= /tmp/$(PRG).pid
HOST     ?= localhost
PORT     ?= 8000
ARCH     ?= amd64
OSARCH   ?= linux/$(ARCH)
ALLARCH  ?= "linux/amd64 linux/386 windows/amd64 darwin/386"
GOPATH   ?=
DBUSER   ?= op
APPUSER  ?= appuser
APPPASS  ?= <PASSWORD>pass
KEYFILE  ?= .appkey

all: chkgo clean build test sum

dist: chkgo clean buildall sum

chkgo:
	@echo "*** $@ ***"
	@[ -f $(GOPATH)/bin/gox ] || { echo "Error: gox compiler not found" ; exit 1 ; }

clean:
	@echo "*** $@ ***"
	@for f in bin/$(PRG)*; do [ -e "$$f" ] && rm "$$f" || echo "no bin files" ; done
	@for f in $(PRG)*.zip; do [ -e "$$f" ] && rm "$$f" || echo "no zip files" ; done
	@[ -d bin ] && [ -f bin/SHA256SUMS ] && rm bin/SHA256SUMS || true 
	@[ -d bin ] && rm -d bin || true

build:
	@echo "*** $@ ***"
	@[ -d bin ] || mkdir bin
	@pushd bin ; \
	gox -osarch="$(OSARCH)" ../ && popd || { popd ; exit 1 ; }

buildall:
	@echo "*** $@ ***"
	@[ -d bin ] || mkdir bin
	@pushd bin ; \
	gox -osarch=$(ALLARCH) ../ && popd || { popd ; exit 1 ; }

buildpack:
	@echo "*** $@ ***"
	@pushd bin ; \
	for f in $(PRG)* ; do [ -e "$$f" ] && zip "../$$f.zip" "$$f" || echo "no files" ; done

test:
	@echo "*** $@ ***"
	go test

testall:
	@echo "*** $@ ***"
	@PGUSER=$(DBUSER) DBCC_TEST_DB=1 go test
{'fraction_non_alphanumeric': 0.23411764705882354, 'fraction_numerical': 0.0203921568627451, 'mean_word_length': 2.7404692082111435, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, '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': '688645', 'n_tokens_mistral': 1155, 'n_tokens_neox': 1089, 'n_words': 285}