-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
58 lines (45 loc) · 1.5 KB
/
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
SHELL=/bin/bash -o pipefail
VERSION=0.0.6
GO ?= go
NPM ?= npm
GIT_REV := $(shell git rev-parse HEAD 2> /dev/null || true)
GIT_COMMIT := $(if $(shell git status --porcelain --untracked-files=no),${GIT_REV}-dirty,${GIT_REV})
GIT_BRANCH ?= $(shell git rev-parse --abbrev-ref HEAD 2>/dev/null)
LDFLAGS := -s -X github.com/codenotary/immuproof/meta.version=v${VERSION} \
-X github.com/codenotary/immuproof/meta.gitCommit=${GIT_COMMIT} \
-X github.com/codenotary/immuproof/meta.gitBranch=${GIT_BRANCH}
LDFLAGS_STATIC := ${LDFLAGS} \
-X github.com/codenotary/immuproof/meta.static=static \
-extldflags "-static"
TEST_FLAGS ?= -v -race
.PHONY: immuproof
immuproof:
cd vue && $(NPM) install && $(NPM) run build
$(GO) build -ldflags '${LDFLAGS} -X github.com/codenotary/immuproof/meta.version=v${VERSION}-dev' -o immuproof ./main.go
.PHONY: immuproof-release
immuproof-release:
cd vue && $(NPM) install && $(NPM) run build
$(GO) build -ldflags '${LDFLAGS}' -o immuproof ./main.go
.PHONY: test
test:
cd vue && $(NPM) install && $(NPM) run build
$(GO) vet ./...
$(GO) test ${TEST_FLAGS} ./...
.PHONY: static
static:
CGO_ENABLED=0 $(GO) build -ldflags '${LDFLAGS_STATIC}' -o immuproof ./main.go
.PHONY: clean/dist
clean/dist:
rm -Rf ./dist
.PHONY: clean
clean: clean/dist
rm -f ./vcn
.PHONY: docker
docker:
docker build -t immuproof .
.PHONY: CHANGELOG.md
CHANGELOG.md:
git-chglog -o CHANGELOG.md
.PHONY: CHANGELOG.md.next-tag
CHANGELOG.md.next-tag:
git-chglog -o CHANGELOG.md --next-tag v${VERSION}