<commit_before>.PHONY: test all build clean

PROTOFILES=$(shell find . -name \*.proto)
PBGOFILES=$(patsubst %.proto,%.pb.go,$(PROTOFILES))
GOFILES=$(shell find . \( -name \*.go ! -name version.go \) )

# for protoc-gen-go
export PATH := $(GOPATH)/bin:$(PATH)

GOLDFLAGS=-ldflags '-r $${ORIGIN}/lib'


BUILD_DATE=$(shell date +%Y%m%d)
BUILD_REV=$(shell git rev-parse --short HEAD)
BUILD_VERSION=dev-$(BUILD_DATE)-$(BUILD_REV)

all: build test

imposm3: $(GOFILES) $(PROTOFILES)
	@sed -i='' 's/buildVersion = ".*"/buildVersion = "$(BUILD_VERSION)"/' version.go
	go build $(GOLDFLAGS)
	@sed -i='' 's/buildVersion = ".*"/buildVersion = ""/' version.go

build: imposm3

clean:
	rm -f imposm3
	(cd test && make clean)

test:
	(cd test && make test)

%.pb.go: %.proto
	protoc --go_out=. $^<commit_msg>call go test in test target<commit_after>.PHONY: test all build clean

PROTOFILES=$(shell find . -name \*.proto)
PBGOFILES=$(patsubst %.proto,%.pb.go,$(PROTOFILES))
GOFILES=$(shell find . \( -name \*.go ! -name version.go \) )

# for protoc-gen-go
export PATH := $(GOPATH)/bin:$(PATH)

GOLDFLAGS=-ldflags '-r $${ORIGIN}/lib'


BUILD_DATE=$(shell date +%Y%m%d)
BUILD_REV=$(shell git rev-parse --short HEAD)
BUILD_VERSION=dev-$(BUILD_DATE)-$(BUILD_REV)

all: build test

imposm3: $(GOFILES) $(PROTOFILES)
	@sed -i='' 's/buildVersion = ".*"/buildVersion = "$(BUILD_VERSION)"/' version.go
	go build $(GOLDFLAGS)
	@sed -i='' 's/buildVersion = ".*"/buildVersion = ""/' version.go

build: imposm3

clean:
	rm -f imposm3
	(cd test && make clean)

test:
	go test imposm3/... -i
	go test imposm3/...
	(cd test && make test)

%.pb.go: %.proto
	protoc --go_out=. $^
{'fraction_non_alphanumeric': 0.2082574377656345, 'fraction_numerical': 0.004857316332726169, 'mean_word_length': 4.024390243902439, 'pattern_counts': {'":': 0, '<': 3, '<?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': '1899264', 'n_tokens_mistral': 676, 'n_tokens_neox': 665, 'n_words': 158}