File: Makefile

package info (click to toggle)
amfora 1.11.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 3,272 kB
  • sloc: python: 71; sh: 42; makefile: 39
file content (42 lines) | stat: -rw-r--r-- 1,024 bytes parent folder | download | duplicates (3)
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
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) -d $(DESTDIR)$(PREFIX)/bin/
	$(INSTALL) -m 755 amfora $(DESTDIR)$(PREFIX)/bin/amfora
	$(INSTALL) -d $(DESTDIR)$(PREFIX)/share/applications/
	$(INSTALL) -m 644 amfora.desktop $(DESTDIR)$(PREFIX)/share/applications/amfora.desktop

.PHONY: uninstall
uninstall:
	$(RM) -f $(DESTDIR)$(PREFIX)/bin/amfora
	$(RM) -f $(DESTDIR)$(PREFIX)/share/applications/amfora.desktop

# Development helpers

.PHONY: fmt
fmt:
	$(GO) fmt ./...

.PHONY: gen
gen:
	$(GO) generate ./...