From 96444f0746a3153374829e77a737ca44b56d9aa5 Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Sat, 2 Jul 2022 19:46:07 +0200 Subject: [PATCH] Fix database.Dir not being passed to Go -ldflags MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The second flag overwrites the first it seems… --- Makefile | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 16d95ad..2b1c8f5 100644 --- a/Makefile +++ b/Makefile @@ -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) -- 2.45.2