-
Notifications
You must be signed in to change notification settings - Fork 5
/
common.mk
45 lines (35 loc) · 1.3 KB
/
common.mk
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
.PHONY: doc
LDFLAGS = -X cypherpunks.ru/govpn.Version=$(VERSION)
PREFIX ?= /usr/local
BINDIR = $(DESTDIR)$(PREFIX)/bin
INFODIR = $(DESTDIR)$(PREFIX)/info
SHAREDIR = $(DESTDIR)$(PREFIX)/share/govpn
DOCDIR = $(DESTDIR)$(PREFIX)/share/doc/govpn
all: govpn-client govpn-server govpn-verifier
govpn-client:
GOPATH=$(GOPATH) go build -ldflags "$(LDFLAGS)" cypherpunks.ru/govpn/cmd/govpn-client
govpn-server:
GOPATH=$(GOPATH) go build -ldflags "$(LDFLAGS)" cypherpunks.ru/govpn/cmd/govpn-server
govpn-verifier:
GOPATH=$(GOPATH) go build -ldflags "$(LDFLAGS)" cypherpunks.ru/govpn/cmd/govpn-verifier
bench:
GOPATH=$(GOPATH) go test -benchmem -bench . cypherpunks.ru/govpn/...
clean:
rm -f govpn-client govpn-server govpn-verifier
doc:
$(MAKE) -C doc
install: all doc
mkdir -p $(BINDIR)
cp -f govpn-client govpn-server govpn-verifier $(BINDIR)
chmod 755 $(BINDIR)/govpn-client $(BINDIR)/govpn-server $(BINDIR)/govpn-verifier
mkdir -p $(INFODIR)
cp -f doc/govpn.info $(INFODIR)
chmod 644 $(INFODIR)/govpn.info
mkdir -p $(SHAREDIR)
cp -f utils/newclient.sh $(SHAREDIR)
chmod 755 $(SHAREDIR)/newclient.sh
mkdir -p $(DOCDIR)
cp -f -L AUTHORS INSTALL NEWS README README.RU THANKS $(DOCDIR)
chmod 644 $(DOCDIR)/*
install-strip: install
strip $(BINDIR)/govpn-client $(BINDIR)/govpn-server $(BINDIR)/govpn-verifier