-
Notifications
You must be signed in to change notification settings - Fork 9
/
Makefile
47 lines (34 loc) · 1.1 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# Force Go Modules
GO111MODULE = on
GOCC ?= go
GOFLAGS ?=
# If set, override the install location for plugins
IPFS_PATH ?= $(HOME)/.ipfs
# If set, override the IPFS version to build against. This _modifies_ the local
# go.mod/go.sum files and permanently sets this version.
IPFS_VERSION ?= $(lastword $(shell $(GOCC) list -m github.com/ipfs/kubo))
# make reproducible
ifneq ($(findstring /,$(IPFS_VERSION)),)
# Locally built go-ipfs
GOFLAGS += -asmflags=all=-trimpath="$(GOPATH)" -gcflags=all=-trimpath="$(GOPATH)"
else
# Remote version of go-ipfs (e.g. via `go get -trimpath` or official distribution)
GOFLAGS += -trimpath
endif
.PHONY: install build
go.mod: FORCE
./set-target.sh $(IPFS_VERSION)
FORCE:
datadog-plugin.so: plugin/main/main.go go.mod
$(GOCC) build $(GOFLAGS) -buildmode=plugin -o "$@" "$<"
chmod +x "$@"
build: datadog-plugin.so
@echo "Built against" $(IPFS_VERSION)
install: build
install -Dm700 datadog-plugin.so "$(IPFS_PATH)/plugins/datadog.so"
#
# Testing
#
.PHONY: integration
integration:
INTEGRATION=1 go test -v -count=1 -timeout 900s ./plugin/... -run TestOpenTelemetryIntegration