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