2024-05-06 15:10:45 +02:00
|
|
|
TARGET = ./cc-metric-store
|
|
|
|
VERSION = 1.3.0
|
|
|
|
GIT_HASH := $(shell git rev-parse --short HEAD || echo 'development')
|
|
|
|
CURRENT_TIME = $(shell date +"%Y-%m-%d:T%H:%M:%S")
|
|
|
|
LD_FLAGS = '-s -X main.date=${CURRENT_TIME} -X main.version=${VERSION} -X main.commit=${GIT_HASH}'
|
2022-03-07 12:22:22 +01:00
|
|
|
|
2024-05-06 15:10:45 +02:00
|
|
|
.PHONY: clean test tags $(TARGET)
|
2022-03-07 12:22:22 +01:00
|
|
|
|
2024-05-06 15:10:45 +02:00
|
|
|
.NOTPARALLEL:
|
2022-03-07 12:22:22 +01:00
|
|
|
|
2024-05-06 15:10:45 +02:00
|
|
|
$(TARGET):
|
2024-06-18 07:13:56 +02:00
|
|
|
$(info ===> BUILD cc-metric-store)
|
2024-05-06 15:10:45 +02:00
|
|
|
@go build -ldflags=${LD_FLAGS} ./cmd/cc-metric-store
|
2022-03-07 12:22:22 +01:00
|
|
|
|
|
|
|
clean:
|
2024-05-06 15:10:45 +02:00
|
|
|
$(info ===> CLEAN)
|
|
|
|
@go clean
|
|
|
|
@rm -f $(TARGET)
|
|
|
|
|
|
|
|
test:
|
|
|
|
$(info ===> TESTING)
|
|
|
|
@go clean -testcache
|
|
|
|
@go build ./...
|
|
|
|
@go vet ./...
|
|
|
|
@go test ./...
|
|
|
|
|
|
|
|
tags:
|
|
|
|
$(info ===> TAGS)
|
|
|
|
@ctags -R
|