# 默认版本号
DEFAULT_VERSION := 1.0.0
VERSION ?= $(DEFAULT_VERSION)

# 镜像源与依赖文件
PIP_INDEX := https://mirrors.cloud.tencent.com/pypi/simple
REQ_FILE := requirements.txt

# pyinstaller 参数
PYI_FLAGS := -F --noconsole

.PHONY: all install build clean

all: install build clean

install:
	uv pip install -i $(PIP_INDEX) -r $(REQ_FILE)

build:
	@echo "version: $(VERSION)"
	pyinstaller $(PYI_FLAGS) -n tools_gui_$(VERSION).exe tool_gui.py
	pyinstaller $(PYI_FLAGS) -n super_gui_$(VERSION).exe super_gui.py
	pyinstaller $(PYI_FLAGS) -n price_gui_$(VERSION).exe price_gui.py

build_super:
	@echo "version: $(VERSION)"
	pyinstaller $(PYI_FLAGS) -n super_gui_$(VERSION).exe super_gui.py

build_tools:
	@echo "version: $(VERSION)"
	pyinstaller $(PYI_FLAGS) -n tools_gui_$(VERSION).exe tool_gui.py

build_price:
	@echo "version: $(VERSION)"
	pyinstaller $(PYI_FLAGS) -n price_gui_$(VERSION).exe price_gui.py

clean:
	rm -f *.spec
