~porcellis/t

ref: 9ccc8779f3633e66a7352a68ecfd2b77fdca785e t/Makefile -rw-r--r-- 678 bytes
9ccc8779 — Pedro Lucas Porcellis Add command to share notes at a given provider 9 months ago
                                                                                
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
PKGNAME = git.sr.ht/~porcellis/t
GOPATH = $(realpath .go)
PKGPATH = .go/src/$(PKGNAME)

PREFIX?=/usr/local
_INSTDIR=$(DESTDIR)$(PREFIX)
BINDIR?=$(_INSTDIR)/bin
SHAREDIR?=$(_INSTDIR)/share/t
MANDIR?=$(_INSTDIR)/share/man

all: t doc

install: all
	mkdir -m755 -p $(BINDIR) $(MANDIR)/man1 $(SHAREDIR)
	install -m755 t $(BINDIR)/t
	install -m644 docs/t.1 $(MANDIR)/man1/t.1
	install -m644 config/t.conf $(SHAREDIR)

.go:
		mkdir -p $(dir $(PKGPATH))
		ln -fTrs $(realpath .) $(PKGPATH)

doc:
	gzip -c docs/t.1 > docs/t.1.gz

t: .go
	env GOPATH=$(GOPATH) go build -o $@ ./main.go

get: .go
	env GOPATH=$(GOPATH) go get -d ./...

clean:
	rm -rf t docs/*.gz

.PHONY:
	t get clean doc