diff --git a/Makefile b/Makefile index a8ccf0e..9e0e8f4 100644 --- a/Makefile +++ b/Makefile @@ -1,13 +1,21 @@ .PHONY: all clean install uninstall deps -GOBUILD=go build -GOGET=go get -d -v -GOGET_UPDATE=go get -d -u -v -PREFIX=/usr/local -ifeq ($(shell uname),Darwin) - CONFDIR=/usr/local/etc/dns-over-https +PREFIX = /usr/local + +ifeq ($(GOROOT),) +GOBUILD = go build +GOGET = go get -d -v +GOGET_UPDATE = go get -d -u -v else - CONFDIR=/etc/dns-over-https +GOBUILD = $(GOROOT)/bin/go build +GOGET = $(GOROOT)/bin/go get -d -v +GOGET_UPDATE = $(GOROOT)/bin/go get -d -u -v +endif + +ifeq ($(shell uname),Darwin) +CONFDIR = /usr/local/etc/dns-over-https +else +CONFDIR = /etc/dns-over-https endif all: doh-client/doh-client doh-server/doh-server