feeds.mk 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. #
  2. # Copyright (C) 2014 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 $(TMP_DIR)/.packagesubdirs
  8. FEEDS_AVAILABLE:=$(shell $(SCRIPT_DIR)/feeds list -n)
  9. FEEDS_INSTALLED:=$(notdir $(wildcard $(TOPDIR)/package/feeds/*))
  10. FEEDS_ENABLED:=$(foreach feed,$(FEEDS_INSTALLED),$(if $(CONFIG_FEED_$(feed)),$(feed)))
  11. FEEDS_DISABLED:=$(filter-out $(FEEDS_ENABLED),$(FEEDS_AVAILABLE))
  12. PKG_CONFIG_DEPENDS += \
  13. CONFIG_PER_FEED_REPO \
  14. CONFIG_PER_FEED_REPO_ADD_DISABLED \
  15. CONFIG_PER_FEED_REPO_ADD_COMMENTED \
  16. $(foreach feed,$(FEEDS_INSTALLED),CONFIG_FEED_$(feed))
  17. # 1: package name
  18. define FeedPackageDir
  19. $(strip $(if $(CONFIG_PER_FEED_REPO), \
  20. $(abspath $(PACKAGE_DIR)/$(if $(Package/$(1)/subdir),$(Package/$(1)/subdir),base)), \
  21. $(PACKAGE_DIR)))
  22. endef
  23. # 1: destination file
  24. define FeedSourcesAppend
  25. ( \
  26. $(strip $(if $(CONFIG_PER_FEED_REPO), \
  27. $(foreach feed,base kernel $(FEEDS_ENABLED),echo "src/gz %n_$(feed) %U/$(feed)";) \
  28. $(if $(CONFIG_PER_FEED_REPO_ADD_DISABLED), \
  29. $(foreach feed,$(FEEDS_DISABLED),echo "$(if $(CONFIG_PER_FEED_REPO_ADD_COMMENTED),# )src/gz %n_$(feed) %U/$(feed)";)) \
  30. , \
  31. echo "src/gz %n %U"; \
  32. )) \
  33. ) >> $(1)
  34. endef