-
Notifications
You must be signed in to change notification settings - Fork 17
/
Makefile
93 lines (75 loc) · 2.55 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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
DEV_VERSION=0.9.5-dev
ENV=env
TODAY:=$(shell date -u +%Y-%m-%dT%H:%M:%S)
TIMESTAMP:=$(shell date -u +%Y%m%d%H%M%S)
GITREV?=$(shell git rev-parse HEAD)
CELLS_VERSION?="${DEV_VERSION}.${TIMESTAMP}"
XGO_TARGETS?="linux/amd64,darwin/amd64,windows/amd64"
XGO_IMAGE?=techknowlogick/xgo:go-1.19.x
XGO_BIN?=${GOPATH}/bin/xgo
.PHONY: all dev win xgo
all: clean cli
dep:
go install github.com/akavel/rsrc@latest
dev:
go build \
-ldflags "-X github.com/pydio/cells-sync/common.Version=${DEV_VERSION}" \
-o cells-sync
dist:
go build -a -trimpath \
-ldflags "-X github.com/pydio/cells-sync/common.Version=${CELLS_VERSION}" \
-o cells-sync
silicon:
GOOS=darwin GOARCH=arm64 CGO_ENABLED=1 go build -a -trimpath \
-ldflags "-X github.com/pydio/cells-sync/common.Version=${CELLS_VERSION}" \
-o cells-sync-m1
pure:
CGO_ENABLED=0 go build -a -trimpath --tags pure \
-ldflags "-X github.com/pydio/cells-sync/common.Version=${CELLS_VERSION}" \
-o cells-sync-noui
win:
go build -a -trimpath \
-ldflags "-H=windowsgui -X github.com/pydio/cells-sync/common.Version=${CELLS_VERSION}" \
-o cells-sync.exe
win_pure:
CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build -a -trimpath --tags pure \
-ldflags "-H=windowsgui -X github.com/pydio/cells-sync/common.Version=${CELLS_VERSION}" \
-o cells-sync-noui.exe
rsrc:
${GOPATH}/bin/rsrc -arch amd64 -ico app/resources/icon.ico
mod-local:
go mod edit -replace github.com/pydio/cells/v4=${GOPATH}/src/github.com/pydio/cells
mod-update:
go mod edit -dropreplace github.com/pydio/cells/v4
go get -d github.com/pydio/cells/v4@main
GONOSUMDB=* go mod download github.com/pydio/cells/v4
GONOSUMDB=* go mod tidy
libayatana:
rm -f cells-sync*
rm -f rsrc.syso
go mod edit -replace github.com/getlantern/systray=github.com/nekr0z/[email protected]
go mod download github.com/getlantern/systray
go build \
-ldflags "-X github.com/pydio/cells-sync/common.Version=${CELLS_VERSION}" \
-o cells-sync .
go mod edit -dropreplace github.com/getlantern/systray
xgowin:
${XGO_BIN} -go 1.19 \
-out "cells-sync" \
--image ${XGO_IMAGE} \
--targets windows/amd64 \
-ldflags "-H=windowsgui \
-X github.com/pydio/cells-sync/common.Version=${CELLS_VERSION}" \
.
xgowinnoui:
${XGO_BIN} -go 1.19 \
-out "cells-sync-noui" \
--image ${XGO_IMAGE} \
--targets windows/amd64 \
-ldflags "-X github.com/pydio/cells-sync/common.Version=${CELLS_VERSION}" \
.
clean:
rm -f cells-sync*
rm -f rsrc.syso
licenses:
go-licenses report . --template ${GOPATH}/src/github.com/google/go-licenses/testdata/modules/hello01/licenses.tpl > DEPENDENCIES