diff --git a/Makefile b/Makefile index a52fa98..e7ef518 100644 --- a/Makefile +++ b/Makefile @@ -3,5 +3,9 @@ all: cec.so cec.so: build/lib.linux-x86_64-2.7/cec.so cp $< $@ -build/lib.linux-x86_64-2.7/cec.so: cec.cpp +build/lib.linux-x86_64-2.7/cec.so: cec.cpp setup.py python setup.py build + +test: all + ./test.py +.PHONY: test diff --git a/setup.py b/setup.py index ec91a9c..f7fadbd 100644 --- a/setup.py +++ b/setup.py @@ -2,7 +2,7 @@ from distutils.core import setup, Extension -python_cec = Extension('cec', sources = [ 'cec.cpp' ]) +python_cec = Extension('cec', sources = [ 'cec.cpp' ], libraries = [ 'cec' ]) setup(name='cec', version='0.1', description="Python bindings for libcec", diff --git a/test.py b/test.py new file mode 100755 index 0000000..78d4547 --- /dev/null +++ b/test.py @@ -0,0 +1,7 @@ +#!/usr/bin/env python + +import cec + +adapters = cec.list_adapters() + +print adapters