Files
flow/Makefile
2026-02-25 15:49:40 +02:00

40 lines
1.1 KiB
Makefile

PYTHON ?= python3
PIP ?= $(PYTHON) -m pip
SRC_DIR := $(CURDIR)/src
ENTRYPOINT := src/flow/__main__.py
DIST_DIR := dist
BUILD_DIR := build
SPEC_FILE := flow.spec
BINARY := $(DIST_DIR)/flow
INSTALL_DIR ?= $(HOME)/.local/bin
.PHONY: deps build install install-local check-binary clean help
help:
@printf "Targets:\n"
@printf " make deps Install build dependencies\n"
@printf " make build Build standalone binary at dist/flow\n"
@printf " make install Build and install to ~/.local/bin/flow\n"
@printf " make install-local Install binary to ~/.local/bin/flow\n"
@printf " make check-binary Run dist/flow --help\n"
@printf " make clean Remove build artifacts\n"
deps:
$(PIP) install -e ".[build]"
build: deps
$(PYTHON) -m PyInstaller --noconfirm --clean --onefile --name flow --paths "$(SRC_DIR)" "$(ENTRYPOINT)"
install-local: build
mkdir -p "$(INSTALL_DIR)"
install -m 755 "$(BINARY)" "$(INSTALL_DIR)/flow"
@printf "Installed flow to $(INSTALL_DIR)/flow\n"
install: deps build install-local
check-binary:
"./$(BINARY)" --help
clean:
rm -rf "$(BUILD_DIR)" "$(DIST_DIR)" "$(SPEC_FILE)"