-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathMakefile
54 lines (41 loc) · 1.97 KB
/
Makefile
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
PY_EXT_SUFFIX=$(shell python3 -c "import sysconfig; print(sysconfig.get_config_var('EXT_SUFFIX'))")
TARGET=cryosparc/dataset/core$(PY_EXT_SUFFIX)
all: $(TARGET)
# -----------------------------------------------------------------------------
# Primary build target
# -----------------------------------------------------------------------------
$(TARGET): cryosparc/include/cryosparc-tools/*.h cryosparc/dataset/dataset.c cryosparc/dataset/*.pyx cryosparc/dataset/*.pxd setup.py pyproject.toml
python3 -m setup build_ext -i
# -----------------------------------------------------------------------------
# Docs
# -----------------------------------------------------------------------------
docs:
jupyter-book build docs
# -----------------------------------------------------------------------------
# Vercel deployment-related targets
# -----------------------------------------------------------------------------
/usr/local/bin/micromamba:
curl -Ls https://micro.mamba.pm/api/micromamba/linux-64/latest | tar -xvj -C /usr/local bin/micromamba
.venv:
micromamba create -p ./.venv -y -c conda-forge python=3.10 pip wheel cython numpy jupyter-book autodocsumm
micromamba run -p ./.venv pip install -e ".[build]"
.vercel/output/config.json:
mkdir -p .vercel/output
echo '{"version":3,"cache":["/usr/local/bin/micromamba", ".venv/**","build/**","docs/_build/**"]}' > .vercel/output/config.json
vercelinstall: /usr/local/bin/micromamba .venv
echo "Install complete"
vercelbuild: .vercel/output/config.json .venv
micromamba run -p ./.venv jupyter-book build docs
rm -rf .vercel/output/static && cp -R docs/_build/html .vercel/output/static
# -----------------------------------------------------------------------------
# Cleanup
# -----------------------------------------------------------------------------
clean:
rm -f $(TARGET)
rm -f *.tgz *.tar.gz
rm -f cryosparc/*.so
rm -rf build
rm -rf dist
rm -rf *.egg-info
rm -rf .venv
.PHONY: clean all docs vercelinstall vercelbuild