Makefile 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. #
  2. # Copyright (C) 2008-2010 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:=button-hotplug
  10. PKG_RELEASE:=3
  11. include $(INCLUDE_DIR)/package.mk
  12. define KernelPackage/button-hotplug
  13. SUBMENU:=Other modules
  14. TITLE:=Button Hotplug driver
  15. DEPENDS:=+kmod-input-core
  16. FILES:=$(PKG_BUILD_DIR)/button-hotplug.ko
  17. AUTOLOAD:=$(call AutoLoad,30,button-hotplug,1)
  18. KCONFIG:=
  19. endef
  20. define KernelPackage/button-hotplug/description
  21. Kernel module to generate button uevent-s from input subsystem events.
  22. If your device uses GPIO buttons, see gpio-button-hotplug.
  23. endef
  24. EXTRA_KCONFIG:= \
  25. CONFIG_BUTTON_HOTPLUG=m
  26. EXTRA_CFLAGS:= \
  27. $(patsubst CONFIG_%, -DCONFIG_%=1, $(patsubst %=m,%,$(filter %=m,$(EXTRA_KCONFIG)))) \
  28. $(patsubst CONFIG_%, -DCONFIG_%=1, $(patsubst %=y,%,$(filter %=y,$(EXTRA_KCONFIG)))) \
  29. MAKE_OPTS:= \
  30. ARCH="$(LINUX_KARCH)" \
  31. CROSS_COMPILE="$(TARGET_CROSS)" \
  32. SUBDIRS="$(PKG_BUILD_DIR)" \
  33. EXTRA_CFLAGS="$(EXTRA_CFLAGS)" \
  34. $(EXTRA_KCONFIG)
  35. define Build/Prepare
  36. mkdir -p $(PKG_BUILD_DIR)
  37. $(CP) ./src/* $(PKG_BUILD_DIR)/
  38. endef
  39. define Build/Compile
  40. $(MAKE) -C "$(LINUX_DIR)" \
  41. $(MAKE_OPTS) \
  42. modules
  43. endef
  44. $(eval $(call KernelPackage,button-hotplug))