-
Notifications
You must be signed in to change notification settings - Fork 12
/
Makefile
36 lines (25 loc) · 835 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
.PHONY: build webui bindata release clean
binout=bin/sudis
Version=$(shell git describe --tags `git rev-list --tags --max-count=1`)
BuildDate=$(shell date +"%F %T")
GitCommit=$(shell git rev-parse --short HEAD)
debug=-w -s
param=-X main.VERSION=${Version} -X main.GITLOG_VERSION=${GitCommit} -X 'main.BUILD_TIME=${BuildDate}'
gobinddata=$(shell command -v go-bindata)
ifeq ($(gobinddata),'')
go get -u github.com/shuLhan/go-bindata/cmd/go-bindata
endif
build: bindata
go mod download
go build -tags bindata -ldflags "${debug} ${param}" -o ${binout}
docker:
docker build --build-arg LDFLAGS="${debug} ${param}" -t xhaiker/sudis:${Version} .
bindata:
go generate generator.go
webui:
make -C webui build
clean:
@rm -rf bin
@rm -rf webui/dist
@rm -rf webui/node_modules
@rm -f nodes/http/http_static_bindata_assets.go