-
Notifications
You must be signed in to change notification settings - Fork 199
/
Makefile
56 lines (44 loc) · 1.17 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
include common.mk
PYDIR=finquant
DATADIR=data
EXAMPLEDIR=example
EXAMPLEFILES=$(wildcard example/Example*.py)
TESTDIR=tests
DOCDIR=docs
DISTDIR=dist
BUILDDIR=build
AUTODOCEXAMPLES=autodoc-examples.sh
CLEANDIRS = $(PYDIR:%=clean-%) \
$(EXAMPLEDIR:%=clean-%) \
$(TESTDIR:%=clean-%) \
$(DOCDIR:%=clean-%)
SEARCH=
.PHONY: test
.PHONY: doc
.PHONY: EXAMPLEFILES $(EXAMPLEFILES)
.PHONY: cleandirs $(CLEANDIRS)
.PHONY: clean
.PHONY: dirclean
all: clean
test:copyexamples
@echo "Running tests"
@$(MAKE) -C $(TESTDIR)
copyexamples: $(EXAMPLEFILES)
$(EXAMPLEFILES):
@cp $(@) $(subst example/,tests/test_,$(@))
pypi:
@$(PYTHON) setup.py sdist bdist_wheel
@$(PYTHON) -m twine upload dist/FinQuant-*
doc:
@$(MAKE) -C $(DOCDIR) clean
@$(MAKE) -C $(DOCDIR) html
clean: dirclean
clean:
-@rm -rf .pytest_cache FinQuant.egg-info $(BUILDDIR)/ $(DISTDIR)/
dirclean: $(CLEANDIRS)
$(CLEANDIRS):
@echo "cleaning directory $(@:clean-%=%):"
-@$(MAKE) -C $(@:clean-%=%) clean
search:
@echo "searching all python files for $(SEARCH):"
@find . \( -name "*.py" -o -name "README.tex.md" \) -not -path "./*/bkup-files/*" -not -path "./docs/build/*" -not -path "./build/*" | xargs grep -i --color=auto $(SEARCH)