mirror of
https://github.com/makeworld-the-better-one/amfora.git
synced 2024-11-23 00:56:29 +03:00
b2b8e3082d
go env changes env vars globally for users, altering their existing setups
36 lines
837 B
Makefile
36 lines
837 B
Makefile
GITV != git describe --tags
|
|
GITC != git rev-parse --verify HEAD
|
|
SRC != find -type f -name '*.go' ! -name '*_test.go'
|
|
TEST != find -type f -name '*_test.go'
|
|
|
|
PREFIX ?= /usr/local
|
|
VERSION ?= $(GITV)
|
|
COMMIT ?= $(GITC)
|
|
BUILDER ?= Makefile
|
|
|
|
GO := go
|
|
INSTALL := install
|
|
RM := rm
|
|
|
|
amfora: go.mod go.sum $(SRC)
|
|
GO111MODULE=on CGO_ENABLED=0 $(GO) build -o $@ -ldflags="-s -w -X main.version=$(VERSION) -X main.commit=$(COMMIT) -X main.builtBy=$(BUILDER)"
|
|
|
|
.PHONY: clean
|
|
clean:
|
|
$(RM) -f amfora
|
|
|
|
.PHONY: install
|
|
install: amfora amfora.desktop
|
|
install -Dm 755 amfora $(PREFIX)/bin/amfora
|
|
install -Dm 644 amfora.desktop $(PREFIX)/share/applications/amfora.desktop
|
|
|
|
.PHONY: uninstall
|
|
uninstall:
|
|
$(RM) -f $(PREFIX)/bin/amfora
|
|
$(RM) -f $(PREFIX)/share/applications/amfora.desktop
|
|
|
|
# Development helpers
|
|
.PHONY: fmt
|
|
fmt:
|
|
go fmt ./...
|