summaryrefslogtreecommitdiff
path: root/package/i2c-tools/i2c-tools.mk
diff options
context:
space:
mode:
authorPeter Korsgaard <jacmet@sunsite.dk>2008-06-24 09:55:37 +0000
committerPeter Korsgaard <jacmet@sunsite.dk>2008-06-24 09:55:37 +0000
commit32986b80d4aeca7c0295b134743e81f79e913486 (patch)
tree027d120e2d7c2c09ce31b29ab22704772251bd05 /package/i2c-tools/i2c-tools.mk
parentad348c0d7fe1a8e6ad008c06c225b88bd341646e (diff)
package/i2c-tools: I2C tools package
This package contains a heterogeneous set of I2C tools for Linux: a bus probing tool, a chip dumper, register-level access helpers, EEPROM decoding scripts, and more. Based on patch by Michel (BusError).
Diffstat (limited to 'package/i2c-tools/i2c-tools.mk')
-rw-r--r--package/i2c-tools/i2c-tools.mk53
1 files changed, 53 insertions, 0 deletions
diff --git a/package/i2c-tools/i2c-tools.mk b/package/i2c-tools/i2c-tools.mk
new file mode 100644
index 000000000..76c2d7a50
--- /dev/null
+++ b/package/i2c-tools/i2c-tools.mk
@@ -0,0 +1,53 @@
+#############################################################
+#
+# i2c-tools
+#
+#############################################################
+I2C_TOOLS_VERSION:=3.0.1
+I2C_TOOLS_SOURCE:=i2c-tools-$(I2C_TOOLS_VERSION).tar.bz2
+I2C_TOOLS_SITE:=http://dl.lm-sensors.org/i2c-tools/releases/
+I2C_TOOLS_DIR:=$(BUILD_DIR)/i2c-tools-$(I2C_TOOLS_VERSION)
+I2C_TOOLS_BINARY:=tools/i2cdetect
+I2C_TOOLS_TARGET_BINARY:=usr/bin/i2cdetect
+
+$(DL_DIR)/$(I2C_TOOLS_SOURCE):
+ $(WGET) -P $(DL_DIR) $(I2C_TOOLS_SITE)/$(I2C_TOOLS_SOURCE)
+
+$(I2C_TOOLS_DIR)/.unpacked: $(DL_DIR)/$(I2C_TOOLS_SOURCE)
+ $(BZCAT) $(DL_DIR)/$(I2C_TOOLS_SOURCE) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) -
+ toolchain/patch-kernel.sh $(I2C_TOOLS_DIR) package/i2c-tools/ i2c-tools-$(I2C_TOOLS_VERSION)\*.patch
+ touch $@
+
+$(I2C_TOOLS_DIR)/$(I2C_TOOLS_BINARY): $(I2C_TOOLS_DIR)/.unpacked
+ $(MAKE) $(TARGET_CONFIGURE_OPTS) -C $(I2C_TOOLS_DIR)
+
+$(TARGET_DIR)/$(I2C_TOOLS_TARGET_BINARY): $(I2C_TOOLS_DIR)/$(I2C_TOOLS_BINARY)
+ $(INSTALL) -m 755 -d $(@D)
+ for i in i2cdump i2cget i2cset i2cdetect; \
+ do \
+ $(INSTALL) -m 755 $(<D)/$$i $(@D); \
+ $(STRIPCMD) $(STRIP_STRIP_UNNEEDED) $(@D)/$$i; \
+ done
+
+i2c-tools: uclibc $(TARGET_DIR)/$(I2C_TOOLS_TARGET_BINARY)
+
+i2c-tools-source: $(DL_DIR)/$(I2C_TOOLS_SOURCE)
+
+i2c-tools-clean:
+ for i in i2cdump i2cget i2cset i2cdetect; \
+ do \
+ rm -f $(TARGET_DIR)/usr/bin/$$i; \
+ done
+ -$(MAKE) -C $(I2C_TOOLS_DIR) clean
+
+i2c-tools-dirclean:
+ rm -rf $(I2C_TOOLS_DIR)
+
+#############################################################
+#
+# Toplevel Makefile options
+#
+#############################################################
+ifeq ($(strip $(BR2_PACKAGE_I2C_TOOLS)),y)
+TARGETS+=i2c-tools
+endif