aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2018-05-15 02:15:16 +0200
committerJason A. Donenfeld <Jason@zx2c4.com>2018-05-15 02:16:51 +0200
commit08d7602dc34db580e41fc3af5a4340f2c25f09ff (patch)
treee4359307d809dd009fa1b34fecaae5ac9a6295cd
parentUse /dev/null as place holder (diff)
downloadwireguard-go-08d7602dc34db580e41fc3af5a4340f2c25f09ff.tar.xz
wireguard-go-08d7602dc34db580e41fc3af5a4340f2c25f09ff.zip
Improve makefile
-rw-r--r--Makefile12
1 files changed, 10 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index 1513ef5..21b2103 100644
--- a/Makefile
+++ b/Makefile
@@ -1,9 +1,17 @@
+PREFIX ?= /usr
+DESTDIR ?=
+BINDIR ?= $(PREFIX)/bin
+
all: wireguard-go
wireguard-go: $(wildcard *.go) $(wildcard */*.go)
- go build -o $@
+ go get -d -v
+ go build -v -o $@
+
+install: wireguard-go
+ @install -v -d "$(DESTDIR)$(BINDIR)" && install -m 0755 -v wireguard-go "$(DESTDIR)$(BINDIR)/wireguard-go"
clean:
rm -f wireguard-go
-.PHONY: clean cloc
+.PHONY: clean install