Mirror of Go implementation of WireGuard.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

Makefile 836B

12345678910111213141516171819202122232425262728
  1. PREFIX ?= /usr
  2. DESTDIR ?=
  3. BINDIR ?= $(PREFIX)/bin
  4. export GO111MODULE := on
  5. all: generate-version-and-build
  6. MAKEFLAGS += --no-print-directory
  7. generate-version-and-build:
  8. @export GIT_CEILING_DIRECTORIES="$(realpath $(CURDIR)/..)" && \
  9. tag="$$(git describe --dirty 2>/dev/null)" && \
  10. ver="$$(printf 'package device\nconst WireGuardGoVersion = "%s"\n' "$${tag#v}")" && \
  11. [ "$$(cat device/version.go 2>/dev/null)" != "$$ver" ] && \
  12. echo "$$ver" > device/version.go && \
  13. git update-index --assume-unchanged device/version.go || true
  14. @$(MAKE) wireguard-go
  15. wireguard-go: $(wildcard *.go) $(wildcard */*.go)
  16. go build -v -o "$@"
  17. install: wireguard-go
  18. @install -v -d "$(DESTDIR)$(BINDIR)" && install -v -m 0755 "$<" "$(DESTDIR)$(BINDIR)/wireguard-go"
  19. clean:
  20. rm -f wireguard-go
  21. .PHONY: all clean install generate-version-and-build