-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
69 lines (57 loc) · 2.66 KB
/
Makefile
File metadata and controls
69 lines (57 loc) · 2.66 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
.PHONY: clean build install all dist test icons pypi-build pypi-upload
code-check: code-format-check code-lint
code-format-check:
black --check src
cd rust-src && cargo fmt --check
code-lint:
flake8 src
code-format:
black src
cd rust-src && cargo fmt
print-version:
@python -c "from importlib.metadata import version; print(version('vfmc'))"
version=
set-version:
[[ "$(version)" != "" ]] || exit 1
cat pyproject.toml | sed -e 's/^version *= *"[^"]*"/version = "$(version)"/g' | sed -e 's/"vfmc_core==.*"/"vfmc_core==$(version)"/' > pyproject.toml.tmp && mv pyproject.toml.tmp pyproject.toml
cat rust-src/Cargo.toml | sed -e 's/^version *= *"[^"]*"/version = "$(version)"/g' > rust-src/Cargo.toml.tmp && mv rust-src/Cargo.toml.tmp rust-src/Cargo.toml
cat rust-src/pyproject.toml | sed -e 's/^version *= *"[^"]*"/version = "$(version)"/g' > rust-src/pyproject.toml.tmp && mv rust-src/pyproject.toml.tmp rust-src/pyproject.toml
current_version=$(shell grep '^version' pyproject.toml | cut -d\" -f 2)
push-version:
git tag --force v$(current_version)
git push --force origin v$(current_version)
all: build
icons:
@echo "Generating icon files from resources/vfmc-icon.png..."
# Create macOS icns file
rm -rf IconSet.iconset
mkdir -p IconSet.iconset
sips -z 16 16 resources/vfmc-icon.png --out IconSet.iconset/icon_16x16.png
sips -z 32 32 resources/vfmc-icon.png --out IconSet.iconset/icon_16x16@2x.png
sips -z 32 32 resources/vfmc-icon.png --out IconSet.iconset/icon_32x32.png
sips -z 64 64 resources/vfmc-icon.png --out IconSet.iconset/icon_32x32@2x.png
sips -z 128 128 resources/vfmc-icon.png --out IconSet.iconset/icon_128x128.png
sips -z 256 256 resources/vfmc-icon.png --out IconSet.iconset/icon_128x128@2x.png
sips -z 256 256 resources/vfmc-icon.png --out IconSet.iconset/icon_256x256.png
sips -z 512 512 resources/vfmc-icon.png --out IconSet.iconset/icon_256x256@2x.png
sips -z 512 512 resources/vfmc-icon.png --out IconSet.iconset/icon_512x512.png
sips -z 1024 1024 resources/vfmc-icon.png --out IconSet.iconset/icon_512x512@2x.png
iconutil -c icns IconSet.iconset -o resources/vfmc.icns
rm -rf IconSet.iconset
#
# Create Windows ico file
magick convert -background transparent resources/vfmc-icon.png -define icon:auto-resize=16,32,48,64,128,256 resources/vfmc.ico
#
@echo "Icon files created:"
@echo " - resources/vfmc.icns (macOS)"
@echo " - resources/vfmc.ico (Windows)"
@echo " - resources/vfmc-icon.png (Linux)"
clean:
cd rust-src && cargo clean
.venv:
python3.9 -m venv .venv
. .venv/bin/activate && \
pip install ".[dev]"
dev: .venv
. .venv/bin/activate && \
cd rust-src && maturin develop --release --target aarch64-apple-darwin