build: use SYSCONFDIR for default config path

This commit is contained in:
Simon Ser 2020-09-10 23:22:48 +02:00
parent 51785ebdf0
commit 399cf88146
No known key found for this signature in database
GPG Key ID: 0FDE7BE0E88F5E48
1 changed files with 7 additions and 1 deletions

View File

@ -8,18 +8,24 @@ GOFLAGS =
PREFIX = /usr/local PREFIX = /usr/local
BINDIR = $(PREFIX)/bin BINDIR = $(PREFIX)/bin
MANDIR = $(PREFIX)/share/man MANDIR = $(PREFIX)/share/man
SYSCONFDIR = /etc
goflags = $(GOFLAGS) \
-ldflags="-X 'main.configPath=$(SYSCONFDIR)/tlstunnel/config'"
all: tlstunnel tlstunnel.1 all: tlstunnel tlstunnel.1
tlstunnel: tlstunnel:
$(GO) build $(GOFLAGS) ./cmd/tlstunnel $(GO) build $(goflags) ./cmd/tlstunnel
tlstunnel.1: tlstunnel.1.scd tlstunnel.1: tlstunnel.1.scd
$(SCDOC) <tlstunnel.1.scd >tlstunnel.1 $(SCDOC) <tlstunnel.1.scd >tlstunnel.1
clean: clean:
$(RM) -rf tlstunnel doc/tlstunnel.1 $(RM) -rf tlstunnel doc/tlstunnel.1
install: all install: all
mkdir -p $(DESTDIR)$(BINDIR) mkdir -p $(DESTDIR)$(BINDIR)
mkdir -p $(DESTDIR)$(MANDIR)/man1 mkdir -p $(DESTDIR)$(MANDIR)/man1
mkdir -p $(DESTDIR)$(SYSCONFDIR)/tlstunnel
cp -f tlstunnel $(DESTDIR)$(BINDIR) cp -f tlstunnel $(DESTDIR)$(BINDIR)
cp -f tlstunnel.1 $(DESTDIR)$(MANDIR)/man1 cp -f tlstunnel.1 $(DESTDIR)$(MANDIR)/man1