forked from ArtifexSoftware/pdf2docx
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
40 lines (33 loc) · 1003 Bytes
/
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
# Project makefile
# working directories and files
#
TOPDIR :=$(shell pwd)
SRC :=$(TOPDIR)/pdf2docx
BUILD :=$(TOPDIR)/build
DOCSRC :=$(TOPDIR)/doc
TEST :=$(TOPDIR)/test
CLEANDIRS :=.pytest_cache pdf2docx.egg-info dist
# pip install sphinx_rtd_theme
.PHONY: src doc test clean
src:
@python setup.py sdist --formats=gztar,zip && \
python setup.py bdist_wheel
doc:
@if [ -f "$(DOCSRC)/Makefile" ] ; then \
( cd "$(DOCSRC)" && make html MODULEDIR="$(SRC)" BUILDDIR="$(BUILD)" ) || exit 1 ; \
fi
test:
@if [ -f "$(TEST)/Makefile" ] ; then \
( cd "$(TEST)" && make test SOURCEDIR="$(SRC)" ) || exit 1 ; \
fi
clean:
@if [ -e "$(DOCSRC)/Makefile" ] ; then \
( cd "$(DOCSRC)" && make $@ BUILDDIR="$(BUILD)" ) || exit 0 ; \
fi
@for p in $(CLEANDIRS) ; do \
if [ -d "$(TOPDIR)/$$p" ]; then rm -rf "$(TOPDIR)/$$p" ; fi ; \
done
@if [ -d "$(BUILD)" ]; then rm -rf "$(BUILD)" ; fi
@if [ -e "$(TEST)/Makefile" ] ; then \
( cd "$(TEST)" && make $@ ) || exit 0 ; \
fi