2020-09-09 15:13:57 +02:00
|
|
|
.POSIX:
|
|
|
|
.SUFFIXES:
|
|
|
|
|
|
|
|
GO = go
|
|
|
|
RM = rm
|
|
|
|
SCDOC = scdoc
|
|
|
|
GOFLAGS =
|
|
|
|
PREFIX = /usr/local
|
2020-09-10 23:17:52 +02:00
|
|
|
BINDIR = $(PREFIX)/bin
|
|
|
|
MANDIR = $(PREFIX)/share/man
|
2020-09-10 23:22:48 +02:00
|
|
|
SYSCONFDIR = /etc
|
2020-09-10 23:33:09 +02:00
|
|
|
SHAREDSTATEDIR = /var/lib
|
2020-09-10 23:22:48 +02:00
|
|
|
|
|
|
|
goflags = $(GOFLAGS) \
|
2020-09-13 15:50:46 +02:00
|
|
|
-ldflags="-X 'main.configPath=$(SYSCONFDIR)/tlstunnel/config' \
|
|
|
|
-X 'main.certDataPath=$(SHAREDSTATEDIR)/tlstunnel'"
|
2020-09-09 15:13:57 +02:00
|
|
|
|
|
|
|
all: tlstunnel tlstunnel.1
|
|
|
|
|
|
|
|
tlstunnel:
|
2020-09-10 23:22:48 +02:00
|
|
|
$(GO) build $(goflags) ./cmd/tlstunnel
|
2020-09-09 15:13:57 +02:00
|
|
|
tlstunnel.1: tlstunnel.1.scd
|
|
|
|
$(SCDOC) <tlstunnel.1.scd >tlstunnel.1
|
|
|
|
|
|
|
|
clean:
|
2020-09-10 23:31:40 +02:00
|
|
|
$(RM) -rf tlstunnel tlstunnel.1
|
2020-09-10 23:22:48 +02:00
|
|
|
|
2020-09-09 15:13:57 +02:00
|
|
|
install: all
|
2020-09-10 23:17:52 +02:00
|
|
|
mkdir -p $(DESTDIR)$(BINDIR)
|
|
|
|
mkdir -p $(DESTDIR)$(MANDIR)/man1
|
2020-09-10 23:22:48 +02:00
|
|
|
mkdir -p $(DESTDIR)$(SYSCONFDIR)/tlstunnel
|
2020-09-10 23:17:52 +02:00
|
|
|
cp -f tlstunnel $(DESTDIR)$(BINDIR)
|
|
|
|
cp -f tlstunnel.1 $(DESTDIR)$(MANDIR)/man1
|