blob: 6606978b2d226fa02cbade63cb1d09cf071e4d82 [file] [log] [blame]
Akronaa629162025-06-04 11:44:52 +02001MODULE = github.com/KorAP/KoralPipe-TermMapper
2CONFIG = github.com/KorAP/KoralPipe-TermMapper/config
3DEV_DIR = $(shell pwd)
4BUILDDATE = $(shell date -u '+%Y-%m-%d_%I:%M:%S%p')
5BUILDVERSION = $(shell git describe --tags --abbrev=0 2>/dev/null)
6BUILDCOMMIT = $(shell git rev-parse --short HEAD)
7
8BUILDOUT =
9ifeq ($(ACTION), build)
10 BUILDOUT = -o ./termmapper
11endif
12
13
14ifeq ($(strip $(BUILDVERSION)), )
15 BUILDVERSION = "EARLY"
16endif
17
18build:
19 go build -v \
20 -ldflags "-X $(CONFIG).Buildtime=$(BUILDDATE) \
21 -X $(CONFIG).Buildhash=$(BUILDCOMMIT) \
22 -X $(CONFIG).Version=$(BUILDVERSION) \
23 -s \
24 -w" \
25 --trimpath \
26 $(BUILDOUT) \
27 ./cmd/termmapper/
28
29update: ## Update all dependencies and clean up the dependency files.
30 go get -u all && go mod tidy
31
32test:
33 go test ./...
34
35bench: ## Run all benchmarks in the code.
36 go test -bench=. -benchmem ./... -run=^# -count 5
37
38vet: ## Run `go vet` on the code.
39 go vet ./...
40
41fuzz:
42 go test -fuzz=FuzzTransformEndpoint -fuzztime=1m ./cmd/termmapper
Akron50d5f832025-06-06 15:08:04 +020043
44docker:
45 docker build -f Dockerfile -t korap/koralpipe-termmapper:latest .