aboutsummaryrefslogtreecommitdiff
path: root/utils/spi-tools/Makefile
diff options
context:
space:
mode:
authorJohn Crispin <blogic@openwrt.org>2015-10-01 17:11:12 +0200
committerJohn Crispin <blogic@openwrt.org>2015-10-02 14:00:25 +0200
commit6205d6d3380e8c1ee863537c2eed41c811e39d5f (patch)
tree10065691e4ee995d85a98d214dfcf8153da3e01c /utils/spi-tools/Makefile
parentc527219c9dd2b6ebfb0a4633bcd07388ffeb065c (diff)
spi-tools: add new package
this package adds 2 tools that can be used to control spidev devices from userland Signed-off-by: John Crispin <blogic@openwrt.org>
Diffstat (limited to 'utils/spi-tools/Makefile')
-rw-r--r--utils/spi-tools/Makefile48
1 files changed, 48 insertions, 0 deletions
diff --git a/utils/spi-tools/Makefile b/utils/spi-tools/Makefile
new file mode 100644
index 000000000..ca4da885e
--- /dev/null
+++ b/utils/spi-tools/Makefile
@@ -0,0 +1,48 @@
+#
+# Copyright (C) 2014-2015 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=spi-tools
+PKG_VERSION:=1
+
+PKG_RELEASE=$(PKG_SOURCE_VERSION)
+
+PKG_SOURCE_PROTO:=git
+PKG_SOURCE_URL:=https://github.com/cpb-/spi-tools.git
+PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
+PKG_SOURCE_VERSION:=cc6a41fdcec60610703ba6db488c621c64952898
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
+
+PKG_MAINTAINER:=John Crispin <blogic@openwrt.org>
+
+PKG_LICENSE:=GPL-2.0
+PKG_LICENSE_FILES:=
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/spi-tools
+ SECTION:=utils
+ CATEGORY:=Utilities
+ TITLE:=Command line SPI tools
+endef
+
+EXTRA_CFLAGS+=-DVERSION=\"$(PKG_SOURCE_VERSION)\"
+
+define Build/Compile
+ cd $(PKG_BUILD_DIR) ; \
+ $(TARGET_CC) $(TARGET_CFLAGS) $(EXTRA_CFLAGS) -Wall -Werror -o spi-config src/spi-config.c ; \
+ $(TARGET_CC) $(TARGET_CFLAGS) $(EXTRA_CFLAGS) -Wall -Werror -o spi-pipe src/spi-pipe.c
+endef
+
+define Package/spi-tools/install
+ $(INSTALL_DIR) $(1)/usr/bin
+ $(INSTALL_BIN) $(PKG_BUILD_DIR)/spi-config $(1)/usr/bin
+ $(INSTALL_BIN) $(PKG_BUILD_DIR)/spi-pipe $(1)/usr/bin
+endef
+
+$(eval $(call BuildPackage,spi-tools))