Makefile 1004 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. #
  2. # Copyright (C) 2009-2016 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. include $(INCLUDE_DIR)/package.mk
  11. define Package/spidev-test
  12. SECTION:=utils
  13. CATEGORY:=Utilities
  14. DEPENDS:=+kmod-spi-dev
  15. TITLE:=SPI testing utility
  16. VERSION:=$(LINUX_VERSION)
  17. URL:=http://www.kernel.org
  18. endef
  19. define Package/spidev-test/description
  20. SPI testing utility.
  21. endef
  22. ifeq ($(call kernel_patchver_ge,4.5.0),1)
  23. SPIDEV_TEST_C:=$(LINUX_DIR)/tools/spi/spidev_test.c
  24. else
  25. SPIDEV_TEST_C:=$(LINUX_DIR)/Documentation/spi/spidev_test.c
  26. endif
  27. define Build/Prepare
  28. endef
  29. define Build/Compile
  30. $(TARGET_CC) $(TARGET_CFLAGS) -o $(PKG_BUILD_DIR)/spidev_test \
  31. $(SPIDEV_TEST_C)
  32. endef
  33. define Package/spidev-test/install
  34. $(INSTALL_DIR) $(1)/sbin
  35. $(INSTALL_BIN) $(PKG_BUILD_DIR)/spidev_test $(1)/sbin/
  36. endef
  37. $(eval $(call BuildPackage,spidev-test))