Makefile 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. #
  2. # Copyright (C) 2017 Chris Blake <chrisrblake93@gmail.com>
  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:=leds-apu2
  10. PKG_RELEASE:=1
  11. PKG_MAINTAINER:=Chris Blake <chrisrblake93@gmail.com>
  12. PKG_LICENSE:=GPL-2.0
  13. include $(INCLUDE_DIR)/package.mk
  14. define KernelPackage/leds-apu2
  15. SUBMENU:=LED modules
  16. TITLE:= PC Engines APU2/APU3 LED support
  17. DEPENDS:= @GPIO_SUPPORT @TARGET_x86
  18. FILES:=$(PKG_BUILD_DIR)/leds-apu2.ko
  19. AUTOLOAD:=$(call AutoLoad,41,leds-apu2,1)
  20. KCONFIG:=
  21. endef
  22. define KernelPackage/leds-apu2/description
  23. Driver for the PC Engines APU2/APU3 LEDs & Reset Button.
  24. endef
  25. EXTRA_KCONFIG:= \
  26. CONFIG_LEDS_APU2=m
  27. EXTRA_CFLAGS:= \
  28. $(patsubst CONFIG_%, -DCONFIG_%=1, $(patsubst %=m,%,$(filter %=m,$(EXTRA_KCONFIG)))) \
  29. $(patsubst CONFIG_%, -DCONFIG_%=1, $(patsubst %=y,%,$(filter %=y,$(EXTRA_KCONFIG)))) \
  30. MAKE_OPTS:= \
  31. ARCH="$(LINUX_KARCH)" \
  32. CROSS_COMPILE="$(TARGET_CROSS)" \
  33. SUBDIRS="$(PKG_BUILD_DIR)" \
  34. EXTRA_CFLAGS="$(EXTRA_CFLAGS)" \
  35. $(EXTRA_KCONFIG)
  36. define Build/Compile
  37. $(MAKE) -C "$(LINUX_DIR)" \
  38. $(MAKE_OPTS) \
  39. modules
  40. endef
  41. $(eval $(call KernelPackage,leds-apu2))