Makefile 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. #
  2. # Copyright (C) 2008-2012 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:=gpio-button-hotplug
  10. PKG_RELEASE:=1
  11. include $(INCLUDE_DIR)/package.mk
  12. define KernelPackage/gpio-button-hotplug
  13. SUBMENU:=Other modules
  14. TITLE:=Simple GPIO Button Hotplug driver
  15. FILES:=$(PKG_BUILD_DIR)/gpio-button-hotplug.ko
  16. AUTOLOAD:=$(call AutoLoad,30,gpio-button-hotplug,1)
  17. KCONFIG:=
  18. endef
  19. define KernelPackage/gpio-button-hotplug/description
  20. This is a replacement for the following in-kernel drivers:
  21. 1) gpio_keys (KEYBOARD_GPIO)
  22. 2) gpio_keys_polled (KEYBOARD_GPIO_POLLED)
  23. Instead of generating input events (like in-kernel drivers do) it generates
  24. uevent-s and broadcasts them. This allows disabling input subsystem which is
  25. an overkill for OpenWrt simple needs.
  26. endef
  27. MAKE_OPTS:= \
  28. ARCH="$(LINUX_KARCH)" \
  29. CROSS_COMPILE="$(TARGET_CROSS)" \
  30. SUBDIRS="$(PKG_BUILD_DIR)"
  31. define Build/Prepare
  32. mkdir -p $(PKG_BUILD_DIR)
  33. $(CP) ./src/* $(PKG_BUILD_DIR)/
  34. endef
  35. define Build/Compile
  36. $(MAKE) -C "$(LINUX_DIR)" \
  37. $(MAKE_OPTS) \
  38. modules
  39. endef
  40. $(eval $(call KernelPackage,gpio-button-hotplug))