# 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 ' where 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 developper-deps: common-deps cython-deps tests-deps pip-deps doc-deps @echo @echo "Dependencies for developpers 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