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_BUILD_DIR:=$(LINUX_DIR)/tools/spi-$(TARGET_DIR_NAME)
  12. PKG_BUILD_PARALLEL:=1
  13. include $(INCLUDE_DIR)/package.mk
  14. define Package/spidev-test
  15. SECTION:=utils
  16. CATEGORY:=Utilities
  17. DEPENDS:=+kmod-spi-dev
  18. TITLE:=SPI testing utility
  19. VERSION:=$(LINUX_VERSION)-$(PKG_RELEASE)
  20. URL:=http://www.kernel.org
  21. endef
  22. define Package/spidev-test/description
  23. SPI testing utility.
  24. endef
  25. define Build/Prepare
  26. # For SDK: Sources are copied by target/sdk/Makefile's
  27. # USERSPACE_UTILS(_FILES)
  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))