33#
44
55# PY[3] is the target Python interpreter. It must have pytest installed.
6- PY3 = python3
6+ PY3 ?= python3
77
88VERSION =$(shell $(PY3 ) -c 'exec(open("slip39/version.py") .read()); print( __version__ )')
99
1010# To see all pytest output, uncomment --capture=no
11- PYTESTOPTS = -vv # --capture=no --log-cli-level=INFO
11+ PYTESTOPTS = -vv # --capture=no --log-cli-level=INFO
1212
13- PY3TEST=TZ = $( TZ ) $(PY3 ) -m pytest $(PYTESTOPTS )
13+ PY3TEST = $(PY3 ) -m pytest $(PYTESTOPTS )
1414
15- .PHONY : all test clean upload
16- all : help
15+ .PHONY : all help test doctest analyze pylint build-check build install upload clean FORCE
16+
17+ all : help
1718
1819help :
1920 @echo " GNUmakefile for cpppo. Targets:"
2021 @echo " help This help"
2122 @echo " test Run unit tests under Python3"
22- @echo " build Build dist packages under Python3"
23+ @echo " build Build dist wheel and app under Python3"
2324 @echo " install Install in /usr/local for Python3"
2425 @echo " clean Remove build artifacts"
2526 @echo " upload Upload new version to pypi (package maintainer only)"
@@ -43,25 +44,39 @@ pylint:
4344
4445build-check :
4546 @$(PY3 ) -m build --version \
46- || ( echo " \n*** Missing Python modules; run:\n\n $( PY3) -m pip install --upgrade pip setuptools build\n" \
47+ || ( echo " \n*** Missing Python modules; run:\n\n $( PY3) -m pip install --upgrade pip setuptools wheel build\n" \
4748 && false )
4849
49- build : build-check clean
50+ build : wheel app
51+
52+ wheel : dist/slip39-$(VERSION ) -py3-none-any.whl
53+
54+ dist/slip39-$(VERSION ) -py3-none-any.whl : build-check FORCE
5055 $(PY3 ) -m build
5156 @ls -last dist
5257
53- dist/slip39-$(VERSION ) -py3-none-any.whl : build
58+ # Install from wheel, including all optional extra dependencies
59+ install : dist/slip39-$(VERSION ) -py3-none-any.whl FORCE
60+ $(PY3 ) -m pip install --force-reinstall $^ [gui,serial,json]
61+
62+ # Generate, Sign and Zip the App package TODO: Code signing w/ Apple Developer ID
63+ app : dist/SLIP39.app.zip
64+
65+ dist/SLIP39.app.zip : dist/SLIP39.app
66+ rm -f $@
67+ (cd dist; zip -r SLIP39.app.zip SLIP39.app)
68+ @ls -last dist
5469
55- install : dist/slip39- $( VERSION ) -py3-none-any.whl
56- $( PY3 ) -m pip install --force-reinstall $^
70+ dist/SLIP39.app : SLIP39.py FORCE
71+ pyinstaller --noconfirm --windowed --onefile --collect-data shamir_mnemonic $<
5772
5873
5974# Support uploading a new version of slip32 to pypi. Must:
6075# o advance __version__ number in slip32/version.py
6176# o log in to your pypi account (ie. for package maintainer only)
6277
63- upload : build
64- python3 -m twine upload --repository pypi dist/*
78+ upload : wheel
79+ python3 -m twine upload --repository pypi dist/slip39- $( VERSION ) *
6580
6681clean :
6782 @rm -rf MANIFEST * .png build dist auto * .egg-info $(shell find . -name '* .pyc' -o -name '__pycache__' )
0 commit comments