~gjabell/bmk

ref: edb4a06398b49fb3f3971678cb2449020eb7df6b bmk/Makefile -rw-r--r-- 623 bytes View raw
edb4a063Galen Abell Add .build.yml and Makefile targets 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
37
38
PREFIX?=/usr/local
_INSTDIR=$(DESTDIR)$(PREFIX)
BINDIR?=$(_INSTDIR)/bin
SHAREDIR?=$(_INSTDIR)/share/bmk
MANDIR?=$(_INSTDIR)/share/man

bmk:
	go build \
		-ldflags "-X main.Prefix=$(PREFIX)" \
		-ldflags "-X main.ShareDir=$(SHAREDIR)" \
		-o $@

doc: bmk
	./bmk doc -c config/config.toml

lint:
	golint ./...

vet:
	go vet ./...

test:
	go test ./...

all: bmk doc

clean:
	$(RM) bmk doc/*.1

install: bmk
	mkdir -p $(BINDIR) $(MANDIR)/man1 $(SHAREDIR)
	install -m755 bmk $(BINDIR)/bmk
	install -m644 doc/*.1 $(MANDIR)/man1/
	install -m644 config/config.toml $(SHAREDIR)/config.toml

.DEFAULT_GOAL := all

.PHONY: all clean