~emersion/drmdb

drmdb/Makefile -rw-r--r-- 645 bytes
b2b4bd96Simon Ser Upgrade dependencies 25 days 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
GO ?= go
GOFLAGS ?=
DESTDIR ?=
PREFIX ?= /usr/local
BINDIR ?= bin
DATADIR ?= share
LOCALSTATEDIR ?= /var

goldflags = \
	-X 'git.sr.ht/~emersion/drmdb/database.Dir=$(LOCALSTATEDIR)/lib/drmdb/db' \
	-X 'git.sr.ht/~emersion/drmdb.PublicDir=$(PREFIX)/$(DATADIR)/drmdb/public'

.PHONY: drmdb install

all: drmdb

drmdb:
	$(GO) build $(GOFLAGS) -ldflags="$(goldflags)" ./cmd/drmdb

install:
	mkdir -p $(DESTDIR)$(PREFIX)/$(BINDIR)
	mkdir -p $(DESTDIR)$(PREFIX)/$(DATADIR)/drmdb
	mkdir -p $(DESTDIR)$(LOCALSTATEDIR)/lib/drmdb
	cp -f drmdb $(DESTDIR)$(PREFIX)/$(BINDIR)
	cp -rf public/ $(DESTDIR)$(PREFIX)/$(DATADIR)/drmdb/public/

clean:
	rm -f drmdb