File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -4,6 +4,10 @@ APP = path-helper
4
4
VERSION ?= $(shell cat ./version)
5
5
# build directory
6
6
BUILD_DIR ?= build
7
+ # build flags
8
+ BUILD_FLAGS ?= -v -a -ldflags=-s
9
+ # gopath copy from environment
10
+ GOPATH ?= ${GOPATH}
7
11
8
12
.PHONY : default bootstrap build clean test
9
13
@@ -13,10 +17,10 @@ bootstrap:
13
17
GO111MODULE=on go mod vendor
14
18
15
19
build : clean
16
- go build -v -o $(BUILD_DIR ) /$(APP ) cmd/$(APP ) /*
20
+ CGO_ENABLED=0 go build $( BUILD_FLAGS ) -o $(BUILD_DIR ) /$(APP ) cmd/$(APP ) /*
17
21
18
22
install : build
19
- go install cmd/$(APP ) /*
23
+ CGO_ENABLED=0 go install $( BUILD_FLAGS ) cmd/$(APP ) /*
20
24
21
25
clean :
22
26
rm -rf $(BUILD_DIR ) > /dev/null
@@ -37,6 +41,12 @@ codecov:
37
41
snapshot :
38
42
goreleaser --rm-dist --snapshot
39
43
44
+ snapshot-local :
45
+ goreleaser --rm-dist --snapshot --skip-publish --debug
46
+
47
+ snapshot-install : snapshot-local
48
+ install -m 755 build/dist/darwin_darwin_amd64/$(APP ) " $( GOPATH) /bin/$( APP) "
49
+
40
50
release :
41
51
git tag $(VERSION )
42
52
git push origin $(VERSION )
You can’t perform that action at this time.
0 commit comments