diff --git a/Makefile b/Makefile index 0af2ce6..e433bdb 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,5 @@ PYTHON ?= python3 +PIP ?= $(PYTHON) -m pip SRC_DIR := $(CURDIR)/src ENTRYPOINT := src/flow/__main__.py DIST_DIR := dist @@ -7,16 +8,21 @@ SPEC_FILE := flow.spec BINARY := $(DIST_DIR)/flow INSTALL_DIR ?= $(HOME)/.local/bin -.PHONY: build install-local check-binary clean help +.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" -build: +deps: + $(PIP) install -e ".[build]" + +build: deps $(PYTHON) -m PyInstaller --noconfirm --clean --onefile --name flow --paths "$(SRC_DIR)" "$(ENTRYPOINT)" install-local: build @@ -24,6 +30,8 @@ install-local: build install -m 755 "$(BINARY)" "$(INSTALL_DIR)/flow" @printf "Installed flow to $(INSTALL_DIR)/flow\n" +install: deps build install-local + check-binary: "./$(BINARY)" --help