-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
69 lines (53 loc) · 2.96 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
NETWORK ?= stage
AD_TAG ?= default
# One of patch, minor, or major
UPGRADE_TYPE ?= patch
ABI_DIR := pkg/register/ABIs
SRC := $(shell find . -type f -name '*.go') go.mod go.sum
VERSION_LDFLAG := -X main.Version=$(shell git rev-parse HEAD)
# Intentionally kept separate to allow dynamic versioning
#LDFLAGS := ""
bin/audius-ctl-native: $(SRC)
@echo "Building audius-ctl for local platform and architecture..."
CGO_ENABLED=0 go build -ldflags "$(VERSION_LDFLAG) $(LDFLAGS)" -o bin/audius-ctl-native ./cmd/audius-ctl
bin/audius-ctl-arm64: $(SRC)
@echo "Building arm audius-ctl..."
CGO_ENABLED=0 GOOS=linux GOARCH=arm64 go build -ldflags "$(VERSION_LDFLAG) $(LDFLAGS)" -o bin/audius-ctl-arm64 ./cmd/audius-ctl
bin/audius-ctl-x86_64: $(SRC)
@echo "Building x86 audius-ctl..."
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags "$(VERSION_LDFLAG) $(LDFLAGS)" -o bin/audius-ctl-x86_64 ./cmd/audius-ctl
bin/audius-ctl-arm64-macos: $(SRC)
@echo "Building macos arm audius-ctl..."
CGO_ENABLED=0 GOOS=darwin GOARCH=arm64 go build -ldflags "$(VERSION_LDFLAG) $(LDFLAGS)" -o bin/audius-ctl-arm64-macos ./cmd/audius-ctl
bin/audius-ctl-x86_64-macos: $(SRC)
@echo "Building macos x86_64 audius-ctl..."
CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 go build -ldflags "$(VERSION_LDFLAG) $(LDFLAGS)" -o bin/audius-ctl-x86_64-macos ./cmd/audius-ctl
# Experimental statusbar feature
bin/audius-ctl-arm64-macos-experimental: $(SRC)
@echo "Building macos arm audius-ctl..."
GOOS=darwin GOARCH=arm64 go build -tags osx -ldflags "$(VERSION_LDFLAG) $(LDFLAGS)" -o bin/audius-ctl-arm64-macos ./cmd/audius-ctl
.PHONY: release-audius-ctl audius-ctl-production-build
release-audius-ctl:
bash scripts/github_release.sh
audius-ctl-production-build: VERSION_LDFLAG := -X main.Version=$(shell bash scripts/get_new_version.sh $(UPGRADE_TYPE))
audius-ctl-production-build: clean bin/audius-ctl-arm64 bin/audius-ctl-x86_64 bin/audius-ctl-arm64-macos bin/audius-ctl-x86_64-macos
.PHONY: regen-abis
regen-abis:
curl -s https://raw.githubusercontent.com/AudiusProject/audius-protocol/main/packages/libs/src/eth-contracts/ABIs/ERC20Detailed.json | jq '.abi' > $(ABI_DIR)/ERC20Detailed.json
curl -s https://raw.githubusercontent.com/AudiusProject/audius-protocol/main/packages/libs/src/eth-contracts/ABIs/Registry.json | jq '.abi' > $(ABI_DIR)/Registry.json
curl -s https://raw.githubusercontent.com/AudiusProject/audius-protocol/main/packages/libs/src/eth-contracts/ABIs/ServiceProviderFactory.json | jq '.abi' > $(ABI_DIR)/ServiceProviderFactory.json
.PHONY: build-docker-local build-push-docker
build-docker-local:
@echo "Building Docker image for local platform..."
docker buildx build --load -t audius/audius-d:$(AD_TAG) .
build-push-docker:
@echo "Building and pushing Docker images for all platforms..."
docker buildx build --platform linux/amd64,linux/arm64 --push -t audius/audius-d:$(AD_TAG) .
.PHONY: install uninstall
install:
bash scripts/install.sh
uninstall:
bash scripts/uninstall.sh
.PHONY: clean
clean:
rm -f bin/*