.PHONY: all build test gui gui-dev gui-dist gui-deb gui-win gui-win-docker help clean gui-test
export BINARY
BINARY=modelrouter
export BUILD_DIR
BUILD_DIR=build
export GUI_DIR
GUI_DIR=cmd/gui
VERSION ?= $(shell git describe --tags --dirty 2>/dev/null || echo "0.1.0")
CLEAN_PACK_ENV = env -u LD_LIBRARY_PATH
all: build
build:
@mkdir -p $(BUILD_DIR)
CGO_ENABLED=1 go build -tags luajit -trimpath -o $(BUILD_DIR)/$(BINARY) ./cmd/modelrouter
@echo "Built: $(BUILD_DIR)/$(BINARY) ($(VERSION))"
core-dist:
./packaging/core-dist.sh $(VERSION)
.PHONY: core-dist
gui:
@cd $(GUI_DIR) && npm start
gui-dev:
@cd $(GUI_DIR) && npm run dev
gui-dist:
@cd $(GUI_DIR) && $(CLEAN_PACK_ENV) npm run dist:linux
./packaging/verify-dist.sh
gui-deb:
@cd $(GUI_DIR) && $(CLEAN_PACK_ENV) npm run dist:debian
gui-win:
@cd $(GUI_DIR) && $(CLEAN_PACK_ENV) npm run dist:win
gui-win-docker:
@cd $(GUI_DIR) && $(CLEAN_PACK_ENV) ./scripts/dist-win-docker.sh
./packaging/verify-dist.sh
gui-dist-dir:
@cd $(GUI_DIR) && $(CLEAN_PACK_ENV) npm run dist:dir
test:
go test ./...
gui-test:
@cd $(GUI_DIR) && node --test plugin-sync.test.js
clean:
rm -rf $(BUILD_DIR) cmd/build cmd/gui/dist cmd/gui/build/gui-dist cmd/gui/bin
help:
@echo "Targets:"
@echo " make build build core binary (luajit)"
@echo " make core-dist build core packages: deb + rpm + tar.gz (needs nfpm)"
@echo " make gui run desktop GUI (dev)"
@echo " make gui-dev run GUI with devtools"
@echo " make gui-dist build deb + rpm + AppImage (linux)"
@echo " make gui-test desktop shell unit tests (plugin tree seeding)"
@echo " make gui-deb build deb only"
@echo " make gui-win build Windows nsis (needs host mingw + wine)"
@echo " make gui-win-docker build Windows nsis all-in-docker (no host mingw needed)"
@echo " make test run go tests"
@echo " make clean remove build dirs and packaged installers (build/, cmd/build/, cmd/gui/dist/)"