-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
40 lines (33 loc) · 897 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
APP?=t.xk.is
COMMIT_SHA=$(shell git rev-parse --short HEAD)
.PHONY: build
## build: build the application
build: clean
@echo "Building..."
@CGO_ENABLED=0 go build -v -o ${APP} ./...
@echo "Application \"${APP}\" built successfully."
## dist: build the application for all supported targets
dist:
.builds/scripts/build.sh t.xk.is true false
.PHONY: run
## run: runs go run main.go
run:
go run -race main.go
.PHONY: clean
## clean: cleans the binary
clean:
@echo "Cleaning"
@go clean
.PHONY: test
## test: runs go test with default values
test:
CGO_ENABLED=1 go test -v -count=1 -race ./...
.PHONY: docker-build
## docker-build: builds the stringifier docker image to registry
docker-build: build
docker build -t ${APP}:${COMMIT_SHA} .
.PHONY: help
## help: Prints this help message
help:
@echo "Usage: \n"
@sed -n 's/^##//p' ${MAKEFILE_LIST} | column -t -s ':' | sed -e 's/^/ /'