Makefile 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  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. include $(TOPDIR)/rules.mk
  8. PKG_NAME:=spi-tools
  9. PKG_VERSION:=1
  10. PKG_RELEASE=$(PKG_SOURCE_VERSION)
  11. PKG_SOURCE_PROTO:=git
  12. PKG_SOURCE_URL:=https://github.com/cpb-/spi-tools.git
  13. PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
  14. PKG_SOURCE_VERSION:=cc6a41fdcec60610703ba6db488c621c64952898
  15. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
  16. PKG_MAINTAINER:=John Crispin <blogic@openwrt.org>
  17. PKG_LICENSE:=GPL-2.0
  18. PKG_LICENSE_FILES:=
  19. include $(INCLUDE_DIR)/package.mk
  20. define Package/spi-tools
  21. SECTION:=utils
  22. CATEGORY:=Utilities
  23. TITLE:=Command line SPI tools
  24. endef
  25. EXTRA_CFLAGS+=-DVERSION=\"$(PKG_SOURCE_VERSION)\"
  26. define Build/Compile
  27. cd $(PKG_BUILD_DIR) ; \
  28. $(TARGET_CC) $(TARGET_CFLAGS) $(EXTRA_CFLAGS) -Wall -Werror -o spi-config src/spi-config.c ; \
  29. $(TARGET_CC) $(TARGET_CFLAGS) $(EXTRA_CFLAGS) -Wall -Werror -o spi-pipe src/spi-pipe.c
  30. endef
  31. define Package/spi-tools/install
  32. $(INSTALL_DIR) $(1)/usr/bin
  33. $(INSTALL_BIN) $(PKG_BUILD_DIR)/spi-config $(1)/usr/bin
  34. $(INSTALL_BIN) $(PKG_BUILD_DIR)/spi-pipe $(1)/usr/bin
  35. endef
  36. $(eval $(call BuildPackage,spi-tools))