-
Notifications
You must be signed in to change notification settings - Fork 7
/
Makefile
30 lines (25 loc) · 819 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
LAST_COMMIT := $(shell git rev-parse --short HEAD)
LAST_COMMIT_DATE := $(shell git show -s --format=%ci ${LAST_COMMIT})
TAG := $(shell git describe --tags)
BUILDSTR := ${TAG} (${LAST_COMMIT} ${LAST_COMMIT_DATE})
STATIC := assets/index.html
BIN := gotp
.PHONY: build
build:
go build -o ${BIN} -ldflags="-X 'main.buildString=${BUILDSTR}'" cmd/*.go
- stuffbin -a stuff -in ${BIN} -out ${BIN} ./assets/index.html
.PHONY: test
test:
go test ./...
clean:
go clean
- rm -f ${BIN}
.PHONY: deps
deps:
go get -u github.com/knadh/stuffbin/...
# pack-releases runns stuffbin packing on a given list of
# binaries. This is used with goreleaser for packing
# release builds for cross-build targets.
.PHONY: pack-releases
pack-releases:
$(foreach var,$(RELEASE_BUILDS),stuffbin -a stuff -in ${var} -out ${var} ${STATIC};)