mirror of
https://github.com/strukturag/nextcloud-spreed-signaling
synced 2024-06-07 16:32:21 +02:00
make: Update for Go 1.17+
This commit is contained in:
parent
3cc074896a
commit
320f643a87
35
Makefile
35
Makefile
|
@ -1,7 +1,7 @@
|
||||||
all: build
|
all: build
|
||||||
|
|
||||||
GO := $(shell which go)
|
GO := $(shell which go)
|
||||||
GOPATH := "$(CURDIR)/vendor:$(CURDIR)"
|
GOPATH := $(shell "$(GO)" env GOPATH)
|
||||||
GOFMT := "$(shell dirname "$(GO)")/gofmt"
|
GOFMT := "$(shell dirname "$(GO)")/gofmt"
|
||||||
GOOS ?= linux
|
GOOS ?= linux
|
||||||
GOARCH ?= amd64
|
GOARCH ?= amd64
|
||||||
|
@ -43,19 +43,17 @@ TESTARGS := $(TESTARGS) -count $(COUNT)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(GOARCH), amd64)
|
ifeq ($(GOARCH), amd64)
|
||||||
VENDORBIN := $(CURDIR)/vendor/bin
|
GOPATHBIN := $(GOPATH)/bin
|
||||||
else
|
else
|
||||||
VENDORBIN := $(CURDIR)/vendor/bin/$(GOOS)_$(GOARCH)
|
GOPATHBIN := $(GOPATH)/bin/$(GOOS)_$(GOARCH)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
hook:
|
hook:
|
||||||
[ ! -d "$(CURDIR)/.git/hooks" ] || ln -sf "$(CURDIR)/scripts/pre-commit.hook" "$(CURDIR)/.git/hooks/pre-commit"
|
[ ! -d "$(CURDIR)/.git/hooks" ] || ln -sf "$(CURDIR)/scripts/pre-commit.hook" "$(CURDIR)/.git/hooks/pre-commit"
|
||||||
|
|
||||||
./vendor/bin/easyjson:
|
$(GOPATHBIN)/bin/easyjson:
|
||||||
GOPATH=$(GOPATH) $(GO) get -u github.com/mailru/easyjson/...
|
$(GO) get -u -d github.com/mailru/easyjson/...
|
||||||
@if dpkg --compare-versions "$(GOVERSION)" "ge" "1.17" ; then \
|
$(GO) install github.com/mailru/easyjson/...
|
||||||
GOPATH=$(GOPATH) $(GO) install github.com/mailru/easyjson/...; \
|
|
||||||
fi
|
|
||||||
|
|
||||||
continentmap.go:
|
continentmap.go:
|
||||||
$(CURDIR)/scripts/get_continent_map.py $@
|
$(CURDIR)/scripts/get_continent_map.py $@
|
||||||
|
@ -69,7 +67,7 @@ check-continentmap:
|
||||||
rm -rf $$TMP
|
rm -rf $$TMP
|
||||||
|
|
||||||
get:
|
get:
|
||||||
GOPATH=$(GOPATH) $(GO) get $(PACKAGE)
|
$(GO) get $(PACKAGE)
|
||||||
|
|
||||||
fmt: hook
|
fmt: hook
|
||||||
$(GOFMT) -s -w *.go client proxy server
|
$(GOFMT) -s -w *.go client proxy server
|
||||||
|
@ -82,18 +80,18 @@ test: vet common
|
||||||
|
|
||||||
cover: vet common
|
cover: vet common
|
||||||
rm -f cover.out && \
|
rm -f cover.out && \
|
||||||
GOPATH=$(GOPATH) $(GO) test -v -timeout $(TIMEOUT) -coverprofile cover.out $(ALL_PACKAGES) && \
|
$(GO) test -v -timeout $(TIMEOUT) -coverprofile cover.out $(ALL_PACKAGES) && \
|
||||||
sed -i "/_easyjson/d" cover.out && \
|
sed -i "/_easyjson/d" cover.out && \
|
||||||
GOPATH=$(GOPATH) $(GO) tool cover -func=cover.out
|
$(GO) tool cover -func=cover.out
|
||||||
|
|
||||||
coverhtml: vet common
|
coverhtml: vet common
|
||||||
rm -f cover.out && \
|
rm -f cover.out && \
|
||||||
GOPATH=$(GOPATH) $(GO) test -v -timeout $(TIMEOUT) -coverprofile cover.out $(ALL_PACKAGES) && \
|
$(GO) test -v -timeout $(TIMEOUT) -coverprofile cover.out $(ALL_PACKAGES) && \
|
||||||
sed -i "/_easyjson/d" cover.out && \
|
sed -i "/_easyjson/d" cover.out && \
|
||||||
GOPATH=$(GOPATH) $(GO) tool cover -html=cover.out -o coverage.html
|
$(GO) tool cover -html=cover.out -o coverage.html
|
||||||
|
|
||||||
%_easyjson.go: %.go ./vendor/bin/easyjson
|
%_easyjson.go: %.go $(GOPATHBIN)/bin/easyjson
|
||||||
PATH=$(shell dirname $(GO)):$(PATH) GOPATH=$(GOPATH) "$(VENDORBIN)/easyjson" -all $*.go
|
"$(GOPATHBIN)/easyjson" -all $*.go
|
||||||
|
|
||||||
common: \
|
common: \
|
||||||
api_signaling_easyjson.go \
|
api_signaling_easyjson.go \
|
||||||
|
@ -101,18 +99,19 @@ common: \
|
||||||
api_proxy_easyjson.go \
|
api_proxy_easyjson.go \
|
||||||
natsclient_easyjson.go \
|
natsclient_easyjson.go \
|
||||||
room_easyjson.go
|
room_easyjson.go
|
||||||
|
$(GO) mod tidy
|
||||||
|
|
||||||
$(BINDIR):
|
$(BINDIR):
|
||||||
mkdir -p $(BINDIR)
|
mkdir -p $(BINDIR)
|
||||||
|
|
||||||
client: common $(BINDIR)
|
client: common $(BINDIR)
|
||||||
GOPATH=$(GOPATH) $(GO) build $(BUILDARGS) -ldflags '$(INTERNALLDFLAGS)' -o $(BINDIR)/client ./client/...
|
$(GO) build $(BUILDARGS) -ldflags '$(INTERNALLDFLAGS)' -o $(BINDIR)/client ./client/...
|
||||||
|
|
||||||
server: common $(BINDIR)
|
server: common $(BINDIR)
|
||||||
GOPATH=$(GOPATH) $(GO) build $(BUILDARGS) -ldflags '$(INTERNALLDFLAGS)' -o $(BINDIR)/signaling ./server/...
|
$(GO) build $(BUILDARGS) -ldflags '$(INTERNALLDFLAGS)' -o $(BINDIR)/signaling ./server/...
|
||||||
|
|
||||||
proxy: common $(BINDIR)
|
proxy: common $(BINDIR)
|
||||||
GOPATH=$(GOPATH) $(GO) build $(BUILDARGS) -ldflags '$(INTERNALLDFLAGS)' -o $(BINDIR)/proxy ./proxy/...
|
$(GO) build $(BUILDARGS) -ldflags '$(INTERNALLDFLAGS)' -o $(BINDIR)/proxy ./proxy/...
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm -f *_easyjson.go
|
rm -f *_easyjson.go
|
||||||
|
|
Loading…
Reference in a new issue