Repository navigation
Expand file tree
/
Copy pathMakefile
More file actions
76 lines (63 loc) · 2.36 KB
/
Copy pathMakefile
File metadata and controls
76 lines (63 loc) · 2.36 KB
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
TAGS=with_gvisor,with_quic,with_dhcp,with_wireguard,with_utls,with_acme
UNAME_S := $(shell uname -s)
ifeq ($(UNAME_S),Darwin)
TAGS := standalone,$(TAGS)
endif
ifeq ($(OS),Windows_NT)
LANTERND := lanternd.exe
LANTERN := lantern.exe
else
LANTERND := lanternd
LANTERN := lantern
endif
VERSION ?=
# Commit and build time identify the exact build in telemetry (vcs.ref.head.revision, build.time).
COMMIT := $(or $(strip $(shell git rev-parse --short=7 HEAD 2>/dev/null)),unknown)
BUILD_TIME := $(shell date -u +%Y-%m-%dT%H:%M:%SZ)
LDFLAGS := -ldflags "$(if $(VERSION),-X 'github.com/getlantern/radiance/common.Version=$(VERSION)' )-X 'github.com/getlantern/radiance/common.Commit=$(COMMIT)' -X 'github.com/getlantern/radiance/common.BuildTime=$(BUILD_TIME)'"
.PHONY: build-daemon
build-daemon:
go build -tags "$(TAGS)" $(LDFLAGS) -o bin/$(LANTERND) ./cmd/lanternd
.PHONY: run-daemon
run-daemon:
go run -tags=$(TAGS) ./cmd/lanternd run \
$(if $(data-path),--data-path=$(data-path)) \
$(if $(log-path),--log-path=$(log-path)) \
$(if $(log-level),--log-level=$(log-level))
.PHONY: build-cli
build-cli:
ifeq ($(UNAME_S),Darwin)
go build -tags "standalone" $(LDFLAGS) -o bin/$(LANTERN) ./cmd/lantern
else
go build $(LDFLAGS) -o bin/$(LANTERN) ./cmd/lantern
endif
.PHONY: build
build: build-daemon build-cli
# install* recipes compile binaries into $GOBIN. They do NOT register
# lanternd as a system service — use `lanternd install` for that.
.PHONY: install-daemon
install-daemon:
go install -tags "$(TAGS)" $(LDFLAGS) ./cmd/lanternd
.PHONY: install-cli
install-cli:
ifeq ($(UNAME_S),Darwin)
go install -tags "standalone" $(LDFLAGS) ./cmd/lantern
else
go install $(LDFLAGS) ./cmd/lantern
endif
.PHONY: install
install: install-daemon install-cli
.PHONY: proto
proto:
go build -o build/protoc-gen-go google.golang.org/protobuf/cmd/protoc-gen-go
protoc --go_out=. --plugin=build/protoc-gen-go --go_opt=paths=source_relative account/protos/auth.proto
protoc --go_out=. --plugin=build/protoc-gen-go --go_opt=paths=source_relative account/protos/subscription.proto
protoc --go_out=. --plugin=build/protoc-gen-go --go_opt=paths=source_relative issue/issue.proto
.PHONY: test
test:
go test -v ./...
# Runs on a connected device or emulator. Set RADIANCE_SMART_NETWORK_TEST=1 to
# include the tests that need real egress.
.PHONY: test-android
test-android:
./scripts/android-test.sh