PYTHON ?= python3 PROJECT_ROOT := $(abspath ..) ENTRYPOINT := __main__.py DIST_DIR := dist BUILD_DIR := build SPEC_FILE := flow.spec BINARY := $(DIST_DIR)/flow INSTALL_DIR ?= $(HOME)/.local/bin .PHONY: build install-local check-binary clean help help: @printf "Targets:\n" @printf " make build Build standalone binary at dist/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" build: $(PYTHON) -m PyInstaller --noconfirm --clean --onefile --name flow --paths "$(PROJECT_ROOT)" "$(ENTRYPOINT)" install-local: build mkdir -p "$(INSTALL_DIR)" install -m 755 "$(BINARY)" "$(INSTALL_DIR)/flow" @printf "Installed flow to $(INSTALL_DIR)/flow\n" check-binary: "./$(BINARY)" --help clean: rm -rf "$(BUILD_DIR)" "$(DIST_DIR)" "$(SPEC_FILE)"