-
-
Notifications
You must be signed in to change notification settings - Fork 11
/
Makefile
113 lines (88 loc) · 3.81 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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
# A GNU Makefile to run various tasks - compatibility for us old-timers.
# Note: This makefile include remake-style target comments.
# These comments before the targets start with #:
# remake --tasks to shows the targets and the comments
GIT2CL ?= admin-tools/git2cl
MATHICS_CHARACTER_ENCODING ?= ASCII
PYTHON ?= python
PIP ?= pip3
RM ?= rm
MATHICS3_MODULE_OPTION ?= --load-module pymathics.graph,pymathics.natlang
.PHONY: all build \
check clean \
develop \
dist \
doc \
doctest-data \
djangotest \
docker \
gstest pytest \
rmChangeLog \
runserver \
runserver-debug \
test
THREEJS=mathics_django/web/media/js/mathics-threejs-backend/index.js mathics_django/web/media/js/mathics-threejs-backend/version.json
SANDBOX ?=
ifeq ($(OS),Windows_NT)
SANDBOX = t
else
UNAME_S := $(shell uname -s)
ifeq ($(UNAME_S),Darwin)
SANDBOX = t
endif
endif
#: Default target - same as "develop".
all: develop
#: Build everything needed to install.
build: $(THREEJS)
$(PYTHON) ./setup.py build
check: djangotest doctest-workaround
#: Remove derived files.
clean:
@rm $(THREEJS) || true;
#: Set up to run from the source tree.
develop: $(THREEJS)
$(PIP) install -e .
#: Make distribution: wheels, eggs, tarball.
dist: $(THREEJS)
./admin-tools/make-dist.sh
#: Run Django tests.
djangotest: $(THREEJS)
cd mathics_django && $(PYTHON) manage.py test test_django
#: Run tests that appear in docstring in the code.
doctest-workaround:
MATHICS_CHARACTER_ENCODING=$(MATHICS_CHARACTER_ENCODING) SANDBOX=$(SANDBOX) $(PYTHON) mathics_django/docpipeline.py --exclude=NIntegrate,MaxRecursion,PythonCProfileEvaluation
MATHICS_CHARACTER_ENCODING=$(MATHICS_CHARACTER_ENCODING) SANDBOX=$(SANDBOX) $(PYTHON) mathics_django/docpipeline.py --sections=NIntegrate,MaxRecursion,
#: Run tests that appear in docstring in the code.
doctest: $(THREEJS)
MATHICS_CHARACTER_ENCODING=$(MATHICS_CHARACTER_ENCODING) SANDBOX=$(SANDBOX) $(PYTHON) mathics_django/docpipeline.py $o
#: Create doctest test data and test results that is used in online documentation
doctest-data:
MATHICS_CHARACTER_ENCODING="UTF-8" $(PYTHON) mathics_django/docpipeline.py --output --keep-going $(MATHICS3_MODULE_OPTION)
#: Install Mathics-Django
install: $(THREEJS)
$(PYTHON) setup.py install
#: Run Django-based server in development mode. Use environment variable "o" for manage options
runserver: $(THREEJS)
$(PYTHON) mathics_django/manage.py runserver $o
#: Run Django-based server in development mode. Use environment variable "o" for manage options
runserver-debug: $(THREEJS)
MATHICS_DJANGO_DISPLAY_EXCEPTIONS=true MATHICS_DJANGO_LOG_ON_CONSOLE=true $(PYTHON) mathics_django/manage.py runserver $o
#: Remove ChangeLog
rmChangeLog:
$(RM) ChangeLog || true
#: Run Django-based server in testserver mode. Use environment variable "o" for manage options
testserver: $(THREEJS)
$(PYTHON) mathics_django/manage.py testserver $o
#: Create a ChangeLog from git via git log and git2cl
ChangeLog: rmChangeLog
git log --pretty --numstat --summary | $(GIT2CL) >$@
patch ChangeLog < ChangeLog-spell-corrected.diff
node_modules/\@mathicsorg/mathics-threejs-backend/package.json node_modules/@mathicsorg/mathics-threejs-backend/package.json:
npm install @mathicsorg/mathics-threejs-backend --loglevel=error
#: Install mathics-threejs-backend with npm and copy the necessary files to the right place.
build_mathics-threejs-backend: node_modules/\@mathicsorg/mathics-threejs-backend/package.json
cp node_modules/\@mathicsorg/mathics-threejs-backend/docs/build.js mathics_django/web/media/js/mathics-threejs-backend/index.js; \
cp node_modules/\@mathicsorg/mathics-threejs-backend/package.json mathics_django/web/media/js/mathics-threejs-backend/version.json
$(THREEJS): node_modules/@mathicsorg/mathics-threejs-backend/package.json package.json
$(MAKE) build_mathics-threejs-backend