Merge pull request #4853 from StevenHessing/noddos
[feed/packages.git] / utils / spi-tools / Makefile
1 #
2 # Copyright (C) 2014-2015 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7
8 include $(TOPDIR)/rules.mk
9
10 PKG_NAME:=spi-tools
11 PKG_VERSION:=1
12
13 PKG_RELEASE=$(PKG_SOURCE_VERSION)
14
15 PKG_SOURCE_PROTO:=git
16 PKG_SOURCE_URL:=https://github.com/cpb-/spi-tools.git
17 PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
18 PKG_SOURCE_VERSION:=cc6a41fdcec60610703ba6db488c621c64952898
19 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
20 PKG_MIRROR_HASH:=3c37fde79ab09e9a590f4cdb55751083017197d0037a7c0dce56fceef5e05a21
21
22 PKG_MAINTAINER:=John Crispin <blogic@openwrt.org>
23
24 PKG_LICENSE:=GPL-2.0
25 PKG_LICENSE_FILES:=
26
27 include $(INCLUDE_DIR)/package.mk
28
29 define Package/spi-tools
30 SECTION:=utils
31 CATEGORY:=Utilities
32 TITLE:=Command line SPI tools
33 endef
34
35 EXTRA_CFLAGS+=-DVERSION=\"$(PKG_SOURCE_VERSION)\"
36
37 define Build/Compile
38 cd $(PKG_BUILD_DIR) ; \
39 $(TARGET_CC) $(TARGET_CFLAGS) $(EXTRA_CFLAGS) -Wall -Werror -o spi-config src/spi-config.c ; \
40 $(TARGET_CC) $(TARGET_CFLAGS) $(EXTRA_CFLAGS) -Wall -Werror -o spi-pipe src/spi-pipe.c
41 endef
42
43 define Package/spi-tools/install
44 $(INSTALL_DIR) $(1)/usr/bin
45 $(INSTALL_BIN) $(PKG_BUILD_DIR)/spi-config $(1)/usr/bin
46 $(INSTALL_BIN) $(PKG_BUILD_DIR)/spi-pipe $(1)/usr/bin
47 endef
48
49 $(eval $(call BuildPackage,spi-tools))