1
0
mirror of https://github.com/makew0rld/amfora.git synced 2024-06-15 19:15:24 +00:00
amfora/Makefile

43 lines
964 B
Makefile
Raw Normal View History

GITV != git describe --tags
GITC != git rev-parse --verify HEAD
2020-09-18 18:00:50 +00:00
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
2020-09-02 15:05:14 +00:00
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)"
2020-09-02 15:05:14 +00:00
.PHONY: clean
2020-09-02 15:05:14 +00:00
clean:
$(RM) -f amfora
.PHONY: install
install: amfora amfora.desktop
$(INSTALL) -d $(PREFIX)/bin/
$(INSTALL) -m 755 amfora $(PREFIX)/bin/amfora
$(INSTALL) -d $(PREFIX)/share/applications/
$(INSTALL) -m 644 amfora.desktop $(PREFIX)/share/applications/amfora.desktop
2020-09-02 15:05:14 +00:00
.PHONY: uninstall
2020-09-02 15:05:14 +00:00
uninstall:
$(RM) -f $(PREFIX)/bin/amfora
$(RM) -f $(PREFIX)/share/applications/amfora.desktop
2020-09-02 15:05:14 +00:00
# Development helpers
2021-04-13 20:45:44 +00:00
.PHONY: fmt
2020-09-02 15:05:14 +00:00
fmt:
$(GO) fmt ./...
2021-04-13 20:45:44 +00:00
.PHONY: gen
gen:
$(GO) generate ./...