forked from ipfs/go-ds-s3
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
38 lines (28 loc) · 967 Bytes
/
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
# 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/go-ipfs))
# 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:
s3plugin.so: plugin/main/main.go go.mod
$(GOCC) build $(GOFLAGS) -buildmode=plugin -o "$@" "$<"
chmod +x "$@"
build: s3plugin.so
@echo "Built against" $(IPFS_VERSION)
install: build
install -Dm700 s3plugin.so "$(IPFS_PATH)/plugins/go-ds-s3.so"