This repository has been archived by the owner on Jun 18, 2019. It is now read-only.
/
Makefile
72 lines (57 loc) · 1.89 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
.PHONY: help prepare prepare-prereq odfpy clean mrproper run poc poc-json
# User configuration
export GDS_PREFIX=/Users/andybennett/git/odf-prototype
# No more user configuration below this line!
export GDS_PYTHON_MODULES=${GDS_PREFIX}/lib
export PYTHONPATH=${GDS_PYTHON_MODULES}/lib/python2.7/site-packages
help:
@echo "Edit the user configuration in the Makefile and then run \`make prepare\`"
@echo "to install the dependencies."
@echo "Use \`make run\` to invoke the tool with the correct environment."
prepare: prepare-prereq odfpy
prepare-prereq:
if [ -d ${GDS_PREFIX} ]; then \
exit 0; \
else \
echo "\n\nERROR: ${GDS_PREFIX}/ does not exist!"; \
echo "ERROR: Please configure the Makefile and try again!\n"; \
exit 1; \
fi
${GDS_PYTHON_MODULES}:
mkdir $@/
${PYTHONPATH}: ${GDS_PYTHON_MODULES}
mkdir -p ${PYTHONPATH}/
odfpy: prepare-prereq ${PYTHONPATH}
if [ -d tmp.prepare/ ]; then \
echo "\n\nERROR: tmp.prepare/ already exists!\n"; \
exit 1; \
else \
mkdir tmp.prepare/; \
cd tmp.prepare/; \
git clone http://github.com/eea/odfpy.git; \
cd odfpy/ ; \
python setup.py build; \
python setup.py install --prefix=${GDS_PYTHON_MODULES}; \
mkdir manual/out/; \
cd manual/out; \
python ../buildmanual.py; \
python ../htmlmanual.py; \
cd -; \
mv manual/out ${GDS_PYTHON_MODULES}/odfpy.manual ; \
mv examples ${GDS_PYTHON_MODULES}/odfpy.manual/; \
mv doc ${GDS_PYTHON_MODULES}/odfpy.manual/; \
mv api-for-odfpy.odt ${GDS_PYTHON_MODULES}/odfpy.manual/; \
cd ../../ ; \
rm -fr tmp.prepare/; \
fi
clean:
rm -f *.pyc
mrproper: clean
rm -f *~
rm -fr tmp.prepare/
rm -fr ${GDS_PYTHON_MODULES}/
run: poc
poc:
python poc.py
poc-json:
python poc-json.py