-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile.python_prj
89 lines (69 loc) · 2.3 KB
/
Makefile.python_prj
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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
# -*- coding: utf-8; mode: makefile-gmake -*-
include utils/makefile.include
include utils/makefile.python
include utils/makefile.sphinx
include utils/makefile.0
GIT_URL = https://github.com/return42/boilerplate.git
PYOBJECTS = xxxx
DOC = docs
SLIDES = $(DOC)/slides
API_DOC = $(DOC)/$(PYOBJECTS)-api
PYLINT_RC = .pylintrc
PY_SETUP_EXTRAS = \[develop,test\]
all: clean pylint pytest build docs
PHONY += help help-min help-all
help: help-min
@echo ''
@echo 'to get more help: make help-all'
help-min:
@echo ' build - build distribution packages ($(PYDIST))'
@echo ' docs - build documentation'
@echo ' docs-live - autobuild HTML documentation while editing'
@echo ' slides - build reveal.js slide presentation'
@echo ' clean - remove most generated files'
@echo ' rqmts - info about build requirements'
@echo ''
@echo ' install - developer install (./local)'
@echo ' uninstall - uninstall (./local)'
@echo ''
@echo ' project - rebuild generic project files (README, requirements.txt)'
@echo ''
$(Q)$(MAKE) -e -s make-help
help-all: help-min
@echo ''
$(Q)$(MAKE) -e -s docs-help
@echo ''
$(Q)$(MAKE) -e -s python-help
PHONY += build
build: $(PY_ENV) project pybuild
PHONY += project
project: $(PY_ENV) pyenvinstall $(API_DOC)
@echo ' PROJECT README.rst requirements.txt'
$(Q)- rm -f README.rst requirements.txt
$(Q)$(PY_ENV_BIN)/python -c "from xxxx.__pkginfo__ import *; print(README)" > ./README.rst
$(Q)$(PY_ENV_BIN)/python -c "from xxxx.__pkginfo__ import *; print(requirements_txt)" > ./requirements.txt
PHONY += install
install: pyenvinstall
PHONY += uninstall
uninstall: pyenvuninstall
PHONY += docs
docs: pyenvinstall slides
$(call cmd,sphinx,html,$(DOCS_FOLDER),$(DOCS_FOLDER))
PHONY += docs-live
docs-live: pyenvinstall
$(call cmd,sphinx_autobuild,html,$(DOCS_FOLDER),$(DOCS_FOLDER))
PHONY += slides
slides: pyenvinstall
$(call cmd,sphinx,html,$(SLIDES),$(SLIDES),slides)
PHONY += $(API_DOC)
$(API_DOC): $(PY_ENV)
$(Q)rm -rf ./$(API_DOC)
$(Q)$(PY_ENV_BIN)/sphinx-apidoc --separate --maxdepth=0 --private -o $(API_DOC) xxxx
$(Q)rm -f $(API_DOC)/modules.rst
PHONY += clean
clean: pyclean docs-clean
rm -rf ./$(API_DOC)
$(call cmd,common_clean)
PHONY += rqmts
rqmts: msg-python-exe msg-pip-exe msg-virtualenv-exe
.PHONY: $(PHONY)