Makefile 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. #
  2. # Copyright (C) 2009 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. include $(INCLUDE_DIR)/kernel.mk
  9. PKG_NAME:=spidev-test
  10. PKG_RELEASE:=$(LINUX_VERSION)
  11. PKG_FLAGS:=nonshared
  12. PKG_BUILD_DIR:=$(LINUX_DIR)/tools/spi-$(TARGET_DIR_NAME)
  13. PKG_BUILD_PARALLEL:=1
  14. include $(INCLUDE_DIR)/package.mk
  15. define Package/spidev-test
  16. SECTION:=utils
  17. CATEGORY:=Utilities
  18. DEPENDS:=+kmod-spi-dev @!IN_SDK
  19. TITLE:=SPI testing utility
  20. VERSION:=$(LINUX_VERSION)-$(PKG_RELEASE)
  21. URL:=http://www.kernel.org
  22. MAINTAINER:=Florian Fainelli <florian@openwrt.org>
  23. endef
  24. define Package/spidev-test/description
  25. SPI testing utility.
  26. endef
  27. define Build/Prepare
  28. $(CP) $(LINUX_DIR)/tools/spi/* $(PKG_BUILD_DIR)/
  29. endef
  30. MAKE_FLAGS = \
  31. ARCH="$(LINUX_KARCH)" \
  32. CROSS_COMPILE="$(TARGET_CROSS)" \
  33. CC="$(TARGET_CC)" \
  34. LD="$(TARGET_CROSS)ld" \
  35. CFLAGS="$(TARGET_CFLAGS) $(TARGET_CPPFLAGS)" \
  36. LDFLAGS="$(TARGET_LDFLAGS)" \
  37. $(if $(findstring c,$(LIBRECMC_VERBOSE)),V=1,V='') \
  38. WERROR=0 \
  39. prefix=/usr
  40. define Build/Compile
  41. +$(MAKE_FLAGS) $(MAKE) $(PKG_JOBS) \
  42. -C $(PKG_BUILD_DIR) \
  43. -f Makefile \
  44. --no-print-directory
  45. endef
  46. define Package/spidev-test/install
  47. $(INSTALL_DIR) $(1)/sbin
  48. $(INSTALL_BIN) $(PKG_BUILD_DIR)/spidev_test $(1)/sbin/
  49. endef
  50. $(eval $(call BuildPackage,spidev-test))