Makefile 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  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:=i2c-gpio-custom
  10. PKG_RELEASE:=3
  11. include $(INCLUDE_DIR)/package.mk
  12. define KernelPackage/i2c-gpio-custom
  13. SUBMENU:=I2C support
  14. TITLE:=Custom GPIO-based I2C device
  15. DEPENDS:=@GPIO_SUPPORT +kmod-i2c-core +kmod-i2c-gpio @!LINUX_4_19
  16. FILES:=$(PKG_BUILD_DIR)/i2c-gpio-custom.ko
  17. KCONFIG:=
  18. endef
  19. define KernelPackage/i2c-gpio-custom/description
  20. Kernel module for register a custom i2c-gpio platform device.
  21. endef
  22. EXTRA_KCONFIG:= \
  23. CONFIG_I2C_GPIO_CUSTOM=m
  24. EXTRA_CFLAGS:= \
  25. $(patsubst CONFIG_%, -DCONFIG_%=1, $(patsubst %=m,%,$(filter %=m,$(EXTRA_KCONFIG)))) \
  26. $(patsubst CONFIG_%, -DCONFIG_%=1, $(patsubst %=y,%,$(filter %=y,$(EXTRA_KCONFIG)))) \
  27. MAKE_OPTS:= \
  28. $(KERNEL_MAKE_FLAGS) \
  29. SUBDIRS="$(PKG_BUILD_DIR)" \
  30. EXTRA_CFLAGS="$(EXTRA_CFLAGS)" \
  31. $(EXTRA_KCONFIG)
  32. define Build/Compile
  33. $(MAKE) -C "$(LINUX_DIR)" \
  34. $(MAKE_OPTS) \
  35. modules
  36. endef
  37. $(eval $(call KernelPackage,i2c-gpio-custom))