Skip to content

Commit 45d6a17

Browse files
committed
update makefile
Signed-off-by: Markus Blaschke <mblaschke82@gmail.com>
1 parent d737906 commit 45d6a17

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

Makefile

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1-
PROJECT_NAME := azure-devops-exporter
1+
PROJECT_NAME := $(shell basename $(CURDIR))
22
GIT_TAG := $(shell git describe --dirty --tags --always)
33
GIT_COMMIT := $(shell git rev-parse --short HEAD)
4-
LDFLAGS := -X "main.gitTag=$(GIT_TAG)" -X "main.gitCommit=$(GIT_COMMIT)" -extldflags "-static"
4+
LDFLAGS := -X "main.gitTag=$(GIT_TAG)" -X "main.gitCommit=$(GIT_COMMIT)" -linkmode external -extldflags "-static" -s -w
55

66
FIRST_GOPATH := $(firstword $(subst :, ,$(shell go env GOPATH)))
77
GOLANGCI_LINT_BIN := $(FIRST_GOPATH)/bin/golangci-lint
8+
GOSEC_BIN := $(FIRST_GOPATH)/bin/gosec
89

910
.PHONY: all
1011
all: build
@@ -38,6 +39,9 @@ test:
3839
dependencies:
3940
go mod vendor
4041

42+
.PHONY: check-release
43+
check-release: vendor lint gosec test
44+
4145
.PHONY: lint
4246
lint: $(GOLANGCI_LINT_BIN)
4347
$(GOLANGCI_LINT_BIN) run -E exportloopref,gofmt --timeout=30m
@@ -47,7 +51,7 @@ gosec: $(GOSEC_BIN)
4751
$(GOSEC_BIN) ./...
4852

4953
$(GOLANGCI_LINT_BIN):
50-
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin
54+
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(FIRST_GOPATH)/bin
5155

5256
$(GOSEC_BIN):
53-
curl -sfL https://raw.githubusercontent.com/securego/gosec/master/install.sh | sh -s -- -b $(FIRST_GOPATH)/bin v2.7.0
57+
curl -sfL https://raw.githubusercontent.com/securego/gosec/master/install.sh | sh -s -- -b $(FIRST_GOPATH)/bin

0 commit comments

Comments
 (0)