summaryrefslogtreecommitdiffhomepage
path: root/Makefile
blob: e1c53c57e4441f96bb13a3be8a8dbf5266ff9879 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
PREFIX ?= /usr
DESTDIR ?=
BINDIR ?= $(PREFIX)/bin

ifeq ($(shell go env GOOS),linux)
ifeq ($(wildcard .git),)
$(error Do not build this for Linux. Instead use the Linux kernel module. See wireguard.com/install/ for more info.)
endif
endif

all: wireguard-go

wireguard-go: $(wildcard *.go) $(wildcard */*.go)
	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 install