Makefile 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. #
  2. # Copyright (C) 2008 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:=spi-ks8995
  10. PKG_RELEASE:=1
  11. include $(INCLUDE_DIR)/package.mk
  12. define KernelPackage/spi-ks8995
  13. SUBMENU:=SPI Support
  14. TITLE:=Micrel/Kendin KS8995 Ethernet switch control
  15. FILES:=$(PKG_BUILD_DIR)/spi_ks8995.ko
  16. KCONFIG:=CONFIG_SPI=y \
  17. CONFIG_SPI_MASTER=y
  18. AUTOLOAD:=$(call AutoLoad,50,spi_ks8995)
  19. endef
  20. define KernelPackage/spi-ks8995/description
  21. Kernel module for Micrel/Kendin KS8995 ethernet switch
  22. endef
  23. EXTRA_KCONFIG:= \
  24. CONFIG_SPI_KS8995=m
  25. EXTRA_CFLAGS:= \
  26. $(patsubst CONFIG_%, -DCONFIG_%=1, $(patsubst %=m,%,$(filter %=m,$(EXTRA_KCONFIG)))) \
  27. $(patsubst CONFIG_%, -DCONFIG_%=1, $(patsubst %=y,%,$(filter %=y,$(EXTRA_KCONFIG)))) \
  28. MAKE_OPTS:= \
  29. ARCH="$(LINUX_KARCH)" \
  30. CROSS_COMPILE="$(TARGET_CROSS)" \
  31. SUBDIRS="$(PKG_BUILD_DIR)" \
  32. EXTRA_CFLAGS="$(EXTRA_CFLAGS)" \
  33. $(EXTRA_KCONFIG)
  34. define Build/Prepare
  35. mkdir -p $(PKG_BUILD_DIR)
  36. $(CP) ./src/* $(PKG_BUILD_DIR)/
  37. endef
  38. define Build/Compile
  39. $(MAKE) -C "$(LINUX_DIR)" \
  40. $(MAKE_OPTS) \
  41. modules
  42. endef
  43. $(eval $(call KernelPackage,spi-ks8995))