diff options
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 29 |
1 files changed, 6 insertions, 23 deletions
@@ -10,11 +10,9 @@ $(shell printf 'package main\nconst UseTheKernelModuleInstead = 0xdeadbabe\n' > endif endif -all: wireguard-go +export GOPATH ?= $(CURDIR)/.gopath -export GOPATH := $(CURDIR)/.gopath -export PATH := $(PATH):$(CURDIR)/.gopath/bin -GO_IMPORT_PATH := git.zx2c4.com/wireguard-go +all: wireguard-go version.go: @export GIT_CEILING_DIRECTORIES="$(realpath $(CURDIR)/..)" && \ @@ -24,28 +22,13 @@ version.go: echo "$$ver" > $@ && \ git update-index --assume-unchanged $@ || true -.gopath/.created: - rm -rf .gopath - mkdir -p $(dir .gopath/src/$(GO_IMPORT_PATH)) - ln -s ../../.. .gopath/src/$(GO_IMPORT_PATH) - touch $@ - -vendor/.created: Gopkg.toml Gopkg.lock | .gopath/.created - command -v dep >/dev/null || go get -v github.com/golang/dep/cmd/dep - export PWD; cd .gopath/src/$(GO_IMPORT_PATH) && dep ensure -vendor-only -v - touch $@ - -wireguard-go: $(wildcard *.go) $(wildcard */*.go) .gopath/.created vendor/.created version.go - go build -v $(GO_IMPORT_PATH) +wireguard-go: $(wildcard *.go) $(wildcard */*.go) + go build -v -o "$@" install: wireguard-go - @install -v -d "$(DESTDIR)$(BINDIR)" && install -v -m 0755 wireguard-go "$(DESTDIR)$(BINDIR)/wireguard-go" + @install -v -d "$(DESTDIR)$(BINDIR)" && install -v -m 0755 "$<" "$(DESTDIR)$(BINDIR)/wireguard-go" clean: rm -f wireguard-go -update-dep: | .gopath/.created - command -v dep >/dev/null || go get -v github.com/golang/dep/cmd/dep - cd .gopath/src/$(GO_IMPORT_PATH) && dep ensure -update -v - -.PHONY: clean install update-dep version.go +.PHONY: clean install version.go |