mirror of
https://github.com/abhinavxd/libredesk.git
synced 2026-09-23 11:03:43 +00:00
23 lines
702 B
Makefile
23 lines
702 B
Makefile
# Git version for injecting into Go bins.
|
|
LAST_COMMIT := $(shell git rev-parse --short HEAD)
|
|
LAST_COMMIT_DATE := $(shell git show -s --format=%ci ${LAST_COMMIT})
|
|
VERSION := $(shell git describe --tags)
|
|
BUILDSTR := ${VERSION} (Commit: ${LAST_COMMIT_DATE} (${LAST_COMMIT}), Build: $(shell date +"%Y-%m-%d %H:%M:%S %z"))
|
|
|
|
BIN_ARTEMIS := artemis.bin
|
|
DIST := dist
|
|
|
|
.PHONY: $(BIN_ARTEMIS)
|
|
$(BIN_ARTEMIS):
|
|
CGO_ENABLED=0 go build -a -ldflags="-X 'main.buildVersion=${BUILDSTR}' -X 'main.buildDate=${LAST_COMMIT_DATE}' -s -w" -o ${BIN_ARTEMIS} cmd/*.go
|
|
@echo "Build successful. Current build version: $(VERSION)"
|
|
|
|
test:
|
|
@go test -v ./...
|
|
.PHONY: test
|
|
|
|
clean:
|
|
@go clean
|
|
-@rm -f ${BIN_ARTEMIS}
|
|
.PHONY: clean
|