-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
24 lines (18 loc) · 791 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
####################
# ToolsGo Makefile #
####################
JOBDATE ?= $(shell date -u +%Y-%m-%dT%H%M%SZ)
GIT_REVISION ?= $(shell git rev-parse --short HEAD)
VERSION ?= $(shell git describe --tags --abbrev=0)
LDFLAGS += -s -w
LDFLAGS += -X github.com/youstinus/toolsgo/pkg/config.appVersion=$(VERSION)
LDFLAGS += -X github.com/youstinus/toolsgo/pkg/config.commit=$(GIT_REVISION)
LDFLAGS += -X github.com/youstinus/toolsgo/pkg/config.buildTime=$(JOBDATE)
LDFLAGS_LINUX += -linkmode external -extldflags -static
BUILDPATH=$(CURDIR)
# Install on windows
iw:
GOOS=windows CGO_ENABLED=1 go build -ldflags "$(LDFLAGS)" github.com/youstinus/toolsgo/cmd/toolsgo
# Install on linux
i:
GOOS=linux CGO_ENABLED=1 go build -ldflags "$(LDFLAGS)" github.com/youstinus/toolsgo/cmd/toolsgo