11# Variables
22GO_BIN_DIR := ~/go/bin
33CLI_DIR := ./cmd/main/...
4+ AUTO_UPDATE_DIR := ./cmd/auto-update/...
45WALLET_DIR := ./cmd/rpc/web/wallet
56EXPLORER_DIR := ./cmd/rpc/web/explorer
67DOCKER_DIR := ./.docker/compose.yaml
1617 @sed -n ' s/^##//p' ${MAKEFILE_LIST} | column -t -s ' :' | sed -e ' s/^/ /'
1718
1819# Targets, this is a list of all available commands which can be executed using the make command.
19- .PHONY : build/canopy build/canopy-full build/wallet build/explorer test/all dev/deps docker/up \
20+ .PHONY : build/canopy build/canopy-full build/wallet build/explorer build/auto-update build/auto-update-local run/auto-update run/auto-update-build run/auto-update-test test/all dev/deps docker/up \
2021 docker/down docker/build docker/up-fast docker/down docker/logs \
2122 build/plugin build/kotlin-plugin build/go-plugin build/all-plugins docker/plugin \
2223 docker/run docker/run-kotlin docker/run-go docker/run-typescript docker/run-python docker/run-csharp
@@ -40,6 +41,23 @@ build/wallet:
4041build/explorer :
4142 npm install --prefix $(EXPLORER_DIR ) && npm run build --prefix $(EXPLORER_DIR )
4243
44+ # # build/auto-update: build the canopy auto-update binary into the GO_BIN_DIR
45+ build/auto-update :
46+ go build -o $(GO_BIN_DIR ) /canopy-auto-update $(AUTO_UPDATE_DIR )
47+
48+ # # build/auto-update-local: build canopy CLI to ./cli and auto-update binary for local development
49+ build/auto-update-local :
50+ go build -o ./cli $(CLI_DIR )
51+ go build -o $(GO_BIN_DIR ) /canopy-auto-update $(AUTO_UPDATE_DIR )
52+
53+ # # run/auto-update: run the canopy auto-update binary with 'start' command (requires ./cli to exist)
54+ run/auto-update :
55+ BIN_PATH=./cli go run $(AUTO_UPDATE_DIR ) start
56+
57+ # # run/auto-update-build: build canopy CLI to ./cli and then run auto-update
58+ run/auto-update-build : build/auto-update-local
59+ BIN_PATH=./cli go run $(AUTO_UPDATE_DIR ) start
60+
4361# ==================================================================================== #
4462# TESTING
4563# ==================================================================================== #
@@ -105,13 +123,13 @@ build/plugin:
105123ifeq ($(PLUGIN ) ,kotlin)
106124 cd plugin/kotlin && ./gradlew fatJar --no-daemon
107125else ifeq ($(PLUGIN),go)
108- $(MAKE) -C plugin/go build
126+ cd plugin/go && go build -o go-plugin .
109127else ifeq ($(PLUGIN),typescript)
110- cd plugin/typescript && npm ci && npm run build
128+ cd plugin/typescript && npm ci && npm run build:all
111129else ifeq ($(PLUGIN),python)
112- cd plugin/python && pip install -e ".[ dev]" 2>/dev/null || true
130+ cd plugin/python && make dev
113131else ifeq ($(PLUGIN),csharp)
114- cd plugin/csharp && dotnet publish -c Release -o out
132+ cd plugin/csharp && rm -rf bin && dotnet publish -c Release -r linux-x64 --self-contained true -o bin
115133else ifeq ($(PLUGIN),all)
116134 $(MAKE) build/plugin PLUGIN=go
117135 $(MAKE) build/plugin PLUGIN=kotlin
0 commit comments