-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
49 lines (40 loc) · 1.21 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
48
49
ORIGINAL_FILE=rclone/backend/s3/s3.go
UPDATED_FILE=backend/s3/s3.go
PATCH_FILE=patches/s3.patch
RCLONE_VERSION=v1.58.1
CUR_OS=""
ifeq ($(OS),Windows_NT)
publish:
cp `go env GOPATH`/bin/rclone`go env GOEXE` ./rclone_windows.exe
prepare: clean
mv ${UPDATED_FILE} ${ORIGINAL_FILE}
else
UNAME_S := $(shell uname -s)
ifeq ($(UNAME_S),Linux)
publish:
cp `go env GOPATH`/bin/rclone`go env GOEXE` ./rclone_linux
endif
ifeq ($(UNAME_S),Darwin)
publish:
cp `go env GOPATH`/bin/rclone`go env GOEXE` ./rclone_osx
endif
prepare: clean
-diff -u ${ORIGINAL_FILE} ${UPDATED_FILE} > ${PATCH_FILE}
patch ${ORIGINAL_FILE} < ${PATCH_FILE}
endif
.PHONY: all build prepare clean patch vars version build-plugin
all: clean prepare patch build
build: clean prepare patch
# Change dir and call `make rclone`
$(MAKE) -C rclone rclone
clean:
git submodule init
git submodule update --init
git submodule sync
cd rclone && git reset --hard HEAD && git checkout ${RCLONE_VERSION}
patch: prepare
cp backend/s3/iam.go rclone/backend/s3/
cp backend/s3/authMinio.go rclone/backend/s3/
cd rclone && go mod tidy
build-plugin:
cd plugins/s3iam && go mod tidy && go build -buildmode=plugin -o librcloneplugin_backend_s3iam.so .