From 399cf88146a02d8ba72c11c39a37ec4322bb62ef Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Thu, 10 Sep 2020 23:22:48 +0200 Subject: [PATCH] build: use SYSCONFDIR for default config path --- Makefile | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 800b092..00ee788 100644 --- a/Makefile +++ b/Makefile @@ -8,18 +8,24 @@ GOFLAGS = PREFIX = /usr/local BINDIR = $(PREFIX)/bin MANDIR = $(PREFIX)/share/man +SYSCONFDIR = /etc + +goflags = $(GOFLAGS) \ + -ldflags="-X 'main.configPath=$(SYSCONFDIR)/tlstunnel/config'" all: tlstunnel tlstunnel.1 tlstunnel: - $(GO) build $(GOFLAGS) ./cmd/tlstunnel + $(GO) build $(goflags) ./cmd/tlstunnel tlstunnel.1: tlstunnel.1.scd $(SCDOC) tlstunnel.1 clean: $(RM) -rf tlstunnel doc/tlstunnel.1 + install: all mkdir -p $(DESTDIR)$(BINDIR) mkdir -p $(DESTDIR)$(MANDIR)/man1 + mkdir -p $(DESTDIR)$(SYSCONFDIR)/tlstunnel cp -f tlstunnel $(DESTDIR)$(BINDIR) cp -f tlstunnel.1 $(DESTDIR)$(MANDIR)/man1