forked from UMEP-dev/SuPy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
67 lines (47 loc) · 1.15 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
55
56
57
58
59
60
61
62
63
64
65
66
67
# -*- makefile -*-
.PHONY: main clean test pip supy docs
# OS-specific configurations
ifeq ($(OS),Windows_NT)
PYTHON_exe = python.exe
else
UNAME_S := $(shell uname -s)
ifeq ($(UNAME_S),Linux) # Linux
PYTHON_exe=python
endif
ifeq ($(UNAME_S),Darwin) # macOS
PYTHON_exe=python
endif
endif
src_dir = src
docs_dir = docs
PYTHON := $(if $(PYTHON_exe),$(PYTHON_exe),python)
# All the files which include modules used by other modules (these therefore
# need to be compiled first)
MODULE = supy
# default make options
main: test
$(MAKE) -C $(src_dir) main
$(MAKE) -C $(docs_dir) html
# build wheel
wheel:
python -m build src --wheel --outdir wheelhouse
# house cleaning
clean:
$(MAKE) -C $(src_dir) clean
$(MAKE) -C $(docs_dir) clean
# make supy and run test cases
test:
$(MAKE) -C $(src_dir) test
# make docs and open index
docs:
$(MAKE) -C $(docs_dir) html
open $(docs_dir)/build/html/index.html
# upload wheels to pypi using twine
upload:
$(MAKE) -C $(src_dir) upload
# make live docs for testing
livehtml:
$(MAKE) -C $(docs_dir) livehtml
# use cibuildwheel to build wheels for all platforms
cibuid:
pipx run cibuildwheel==2.9.0 --platform macos