Makefile 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  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:=w1-gpio-custom
  10. PKG_RELEASE:=3
  11. include $(INCLUDE_DIR)/package.mk
  12. define KernelPackage/w1-gpio-custom
  13. SUBMENU:=W1 support
  14. TITLE:=Custom GPIO-based 1-wire device
  15. DEPENDS:=kmod-w1 +kmod-w1-master-gpio
  16. FILES:=$(PKG_BUILD_DIR)/w1-gpio-custom.ko
  17. KCONFIG:=
  18. endef
  19. define KernelPackage/w1-gpio-custom/description
  20. Kernel module to register a custom w1-gpio platform device.
  21. endef
  22. EXTRA_KCONFIG:= \
  23. CONFIG_W1_MASTER_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. ARCH="$(LINUX_KARCH)" \
  29. CROSS_COMPILE="$(TARGET_CROSS)" \
  30. SUBDIRS="$(PKG_BUILD_DIR)" \
  31. EXTRA_CFLAGS="$(EXTRA_CFLAGS)" \
  32. $(EXTRA_KCONFIG)
  33. define Build/Prepare
  34. mkdir -p $(PKG_BUILD_DIR)
  35. $(CP) ./src/* $(PKG_BUILD_DIR)/
  36. endef
  37. define Build/Compile
  38. $(MAKE) -C "$(LINUX_DIR)" \
  39. $(MAKE_OPTS) \
  40. modules
  41. endef
  42. $(eval $(call KernelPackage,w1-gpio-custom))