From 4f13b76dddebd5c4e14da5bce6274fa2869cdbc9 Mon Sep 17 00:00:00 2001 From: Jean Delvare Date: Mon, 19 Jan 2009 14:48:23 +0000 Subject: [PATCH] Integrate py-smbus into the build system. Patch from Mike Frysinger. git-svn-id: http://lm-sensors.org/svn/i2c-tools/trunk@5608 7894878c-1315-0410-8ee3-d5d059ff63e0 --- Makefile | 8 ++++---- README | 5 +++++ py-smbus/Module.mk | 31 +++++++++++++++++++++++++++++++ 3 files changed, 40 insertions(+), 4 deletions(-) create mode 100644 py-smbus/Module.mk diff --git a/Makefile b/Makefile index 8816020..57bc175 100644 --- a/Makefile +++ b/Makefile @@ -34,7 +34,7 @@ KERNELVERSION := $(shell uname -r) all: -include eeprom/Module.mk -include include/Module.mk -include stub/Module.mk -include tools/Module.mk +EXTRA := +#EXTRA += py-smbus +SRCDIRS := eeprom include stub tools $(EXTRA) +include $(SRCDIRS:%=%/Module.mk) diff --git a/README b/README index 700bf88..f2e58ca 100644 --- a/README +++ b/README @@ -50,6 +50,11 @@ Optionally, you can run "make strip" prior to "make install" if you want smaller binaries. However, be aware that this will prevent any further attempt to debug the programs. +If you wish to include sub-directories that are not enabled by default, then +just set them via the EXTRA make variable. For example, to build py-smbus, +do: + $ make EXTRA="py-smbus" + DOCUMENTATION ------------- diff --git a/py-smbus/Module.mk b/py-smbus/Module.mk new file mode 100644 index 0000000..1baea51 --- /dev/null +++ b/py-smbus/Module.mk @@ -0,0 +1,31 @@ +# Python bindings for Linux SMBus access through i2c-dev +# +# Copyright (C) 2009 Mike Frysinger +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. + +PY_SMBUS_DIR := py-smbus + +PYTHON ?= python +DISTUTILS := \ + cd $(PY_SMBUS_DIR) && \ + CPPFLAGS="$(CPPFLAGS) -I../include" $(PYTHON) setup.py + +all-python: + $(DISTUTILS) build + +clean-python: + $(DISTUTILS) clean + rm -rf py-smbus/build + +install-python: + $(DISTUTILS) install + +all: all-python + +clean: clean-python + +install: install-python