File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change 1
1
NAME := postgres-exporter
2
2
VERSION := v0.2.2
3
+ LDFLAGS := -ldflags "-X main.Version=$(VERSION ) "
3
4
4
5
help : # # Shows this help text
5
6
@grep -E ' ^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST ) | sort | awk ' BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
6
7
7
8
dev : # # Builds dev binary
8
- go build -ldflags " -X main.Version= $( VERSION ) "
9
+ go build $( LDFLAGS )
9
10
10
11
build : # # Builds binary for all supported platforms
11
12
@rm -rf build/
@@ -18,7 +19,7 @@ build: ## Builds binary for all supported platforms
18
19
./...
19
20
20
21
install : # # Locally installs dev binary
21
- go install -ldflags " -X main.Version= $( VERSION ) "
22
+ go install $( LDFLAGS )
22
23
23
24
deps : # # Installs dev dependencies
24
25
go get github.com/c4milo/github-release
@@ -42,4 +43,7 @@ release: dist ## Pushes up distributable artifacts to Github Releases
42
43
github-release c4milo/$(NAME ) $(VERSION ) " $$ (git rev-parse --abbrev-ref HEAD)" " **Changelog**<br/>$$ changelog" ' dist/*' ; \
43
44
git pull
44
45
45
- .PHONY : build dev dist install deps release
46
+ clean : # # Runs go clean
47
+ go clean $(LDFLAGS )
48
+
49
+ .PHONY : build dev clean dist install deps release
You can’t perform that action at this time.
0 commit comments