File: Makefile

package info (click to toggle)
pdf2docx 0.5.8-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 4,632 kB
  • sloc: python: 6,692; makefile: 68
file content (40 lines) | stat: -rw-r--r-- 1,003 bytes parent folder | download
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