forked from OpenZWave/python-openzwave
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile.archive
176 lines (147 loc) · 5.82 KB
/
Makefile.archive
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
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
# Makefile for python-openzwave
#
# You can set these variables from the command line.
ARCHBASE = archive
BUILDDIR = build
DISTDIR = dists
-include CONFIG.make
ifndef PYTHON_EXEC
PYTHON_EXEC=python
endif
ifdef VIRTUAL_ENV
python_version_full := $(wordlist 2,4,$(subst ., ,$(shell ${VIRTUAL_ENV}/bin/${PYTHON_EXEC} --version 2>&1)))
else
python_version_full := $(wordlist 2,4,$(subst ., ,$(shell ${PYTHON_EXEC} --version 2>&1)))
endif
python_openzwave_version := $(shell ${PYTHON_EXEC} pyozw_version.py)
python_version_major = $(word 1,${python_version_full})
python_version_minor = $(word 2,${python_version_full})
python_version_patch = $(word 3,${python_version_full})
PIP_EXEC=pip
ifeq (${python_version_major},3)
PIP_EXEC=pip3
endif
ARCHNAME = python-openzwave-${python_openzwave_version}
ARCHDIR = ${ARCHBASE}/${ARCHNAME}
.PHONY: help clean build install uninstall deps install-lib install-api
help:
@echo "Please use \`make <target>' where <target> is one of"
@echo " build : build python-openzwave and openzwave"
@echo " install : install python-openzwave"
@echo " install-api : install python-openzwave (API only)"
@echo " uninstall : uninstall python-openzwave"
@echo " deps : install needed dependencies"
deps: python-deps
install-lib:
${PYTHON_EXEC} setup-lib.py install
@echo
@echo "Installation of lib finished."
install-api: install-lib
${PYTHON_EXEC} setup-api.py install
@echo
@echo "Installation of API finished."
install: install-api
${PYTHON_EXEC} setup-manager.py install
${PYTHON_EXEC} setup-web.py install
@echo
@echo "Installation for users finished."
clean:
-rm -rf $(ARCHBASE)
-rm -rf $(BUILDDIR)
-find . -name \*.pyc -delete
-cd openzwave && make clean
${PYTHON_EXEC} setup-lib.py clean --all --build-base $(BUILDDIR)/lib
${PYTHON_EXEC} setup-api.py clean --all --build-base $(BUILDDIR)/api
${PYTHON_EXEC} setup-manager.py clean --all --build-base $(BUILDDIR)/manager
${PYTHON_EXEC} setup-web.py clean --all --build-base $(BUILDDIR)/web
cp -f openzwave.vers.cpp openzwave/cpp/src/vers.cpp
openzwave openzwave/.lib/:
sed -i -e '253s/.*//' openzwave/cpp/src/value_classes/ValueID.h
cd openzwave && make
###This part is a copy/paste from the original Makefile
###
uninstall:
-rm -rf $(BUILDDIR)
-rm -rf $(DISTDIR)
-yes | ${PIP_EXEC} uninstall python-openzwave-lib
-yes | ${PIP_EXEC} uninstall python-openzwave-api
-yes | ${PIP_EXEC} uninstall libopenzwave
-yes | ${PIP_EXEC} uninstall openzwave
-yes | ${PIP_EXEC} uninstall pyozwman
-yes | ${PIP_EXEC} uninstall pyozwweb
${PYTHON_EXEC} setup-lib.py develop --uninstall
${PYTHON_EXEC} setup-api.py develop --uninstall
${PYTHON_EXEC} setup-manager.py develop --uninstall
${PYTHON_EXEC} setup-web.py develop --uninstall
-rm -f libopenzwave.so
-rm -f src-lib/libopenzwave.so
-rm -f libopenzwave/liopenzwave.so
-rm -Rf python_openzwave_api.egg-info/
-rm -Rf src-api/python_openzwave_api.egg-info/
-rm -Rf src-api/openzwave.egg-info/
-rm -Rf src-manager/pyozwman.egg-info/
-rm -Rf src-lib/python_openzwave_lib.egg-info/
-rm -Rf src-lib/libopenzwave.egg-info/
-rm -Rf src-web/pyozwweb.egg-info/
-rm -Rf /usr/local/lib/python${python_version_major}.${python_version_minor}/dist-packages/python-openzwave*
-rm -Rf /usr/local/lib/python${python_version_major}.${python_version_minor}/dist-packages/python_openzwave*
-rm -Rf /usr/local/lib/python${python_version_major}.${python_version_minor}/dist-packages/libopenzwave*
-rm -Rf /usr/local/lib/python${python_version_major}.${python_version_minor}/dist-packages/openzwave*
-rm -Rf /usr/local/lib/python${python_version_major}.${python_version_minor}/dist-packages/pyozwman*
-rm -Rf /usr/local/lib/python${python_version_major}.${python_version_minor}/dist-packages/pyozwweb*
-rm -Rf /usr/local/share/python-openzwave
-rm -Rf /usr/local/share/openzwave
developer-deps: common-deps cython-deps tests-deps pip-deps doc-deps
@echo
@echo "Dependencies for developers of python-openzwave installed (python ${python_version_full})"
autobuild-deps: common-deps cython-deps tests-deps pip-deps
apt-get install --force-yes -y git
@echo
@echo "Dependencies for autobuilders (docker, travis, ...) installed (python ${python_version_full})"
arch-deps: common-deps pip-deps
@echo
@echo "Dependencies for users installed (python ${python_version_full})"
python-deps:
ifeq (${python_version_major},2)
apt-get install --force-yes -y python2.7 python2.7-dev python2.7-minimal libyaml-dev
endif
ifeq (${python_version_major},3)
-apt-get install --force-yes -y python3 python3-dev python3-minimal libyaml-dev
endif
cython-deps:
ifeq (${python_version_major},2)
apt-get install --force-yes -y cython
endif
ifeq (${python_version_major},3)
-apt-get install --force-yes -y cython3
endif
common-deps:
@echo Installing dependencies for python : ${python_version_full}
ifeq (${python_version_major},2)
apt-get install --force-yes -y python-pip python-dev python-docutils python-setuptools python-louie
endif
ifeq (${python_version_major},3)
-apt-get install --force-yes -y python3-pip python3-docutils python3-dev python3-setuptools
endif
apt-get install --force-yes -y build-essential libudev-dev g++
tests-deps:
${PIP_EXEC} install nose-html
${PIP_EXEC} install nose-progressive
${PIP_EXEC} install coverage
${PIP_EXEC} install nose
${PIP_EXEC} install pylint
doc-deps:
-apt-get install --force-yes -y python-sphinx
${PIP_EXEC} install sphinxcontrib-blockdiag sphinxcontrib-actdiag sphinxcontrib-nwdiag sphinxcontrib-seqdiag
pip-deps:
#${PIP_EXEC} install docutils
#${PIP_EXEC} install setuptools
#The following line crashes with a core dump
#${PIP_EXEC} install "Cython==0.22"
###
###This part is a copy/paste from the original Makefile
###This part is a copy/paste from the original Makefile
###
build: openzwave openzwave/.lib/
###
###This part is a copy/paste from the original Makefile