~emersion/drmdb

96444f0746a3153374829e77a737ca44b56d9aa5 — Simon Ser 2 months ago 145d80d
Fix database.Dir not being passed to Go -ldflags

The second flag overwrites the first it seems…
1 files changed, 5 insertions(+), 4 deletions(-)

M Makefile
M Makefile => Makefile +5 -4
@@ 6,15 6,16 @@ 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="-X 'git.sr.ht/~emersion/drmdb/database.Dir=$(LOCALSTATEDIR)/lib/drmdb/db'" \
		-ldflags="-X 'git.sr.ht/~emersion/drmdb.PublicDir=$(PREFIX)/$(DATADIR)/drmdb/public'" \
		./cmd/drmdb
	$(GO) build $(GOFLAGS) -ldflags="$(goldflags)" ./cmd/drmdb

install:
	mkdir -p $(DESTDIR)$(PREFIX)/$(BINDIR)