feeds.mk 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. #
  2. # Copyright (C) 2014 OpenWrt.org
  3. # Copyright (C) 2016 LEDE Project
  4. #
  5. # This is free software, licensed under the GNU General Public License v2.
  6. # See /LICENSE for more information.
  7. #
  8. -include $(TMP_DIR)/.packagesubdirs
  9. FEEDS_INSTALLED:=$(notdir $(wildcard $(TOPDIR)/package/feeds/*))
  10. FEEDS_AVAILABLE:=$(sort $(FEEDS_INSTALLED) $(shell $(SCRIPT_DIR)/feeds list -n))
  11. PACKAGE_SUBDIRS=$(PACKAGE_DIR)
  12. ifneq ($(CONFIG_PER_FEED_REPO),)
  13. PACKAGE_SUBDIRS += $(OUTPUT_DIR)/packages/$(ARCH_PACKAGES)/base
  14. PACKAGE_SUBDIRS += $(foreach FEED,$(FEEDS_AVAILABLE),$(OUTPUT_DIR)/packages/$(ARCH_PACKAGES)/$(FEED))
  15. endif
  16. opkg_package_files = $(wildcard \
  17. $(foreach dir,$(PACKAGE_SUBDIRS), \
  18. $(foreach pkg,$(1), $(dir)/$(pkg)_*.ipk)))
  19. # 1: package name
  20. define FeedPackageDir
  21. $(strip $(if $(CONFIG_PER_FEED_REPO), \
  22. $(if $(Package/$(1)/subdir), \
  23. $(abspath $(OUTPUT_DIR)/packages/$(ARCH_PACKAGES)/$(Package/$(1)/subdir)), \
  24. $(PACKAGE_DIR)), \
  25. $(PACKAGE_DIR)))
  26. endef
  27. # 1: destination file
  28. define FeedSourcesAppend
  29. ( \
  30. echo 'src/gz %d_core %U/targets/%S/packages'; \
  31. $(strip $(if $(CONFIG_PER_FEED_REPO), \
  32. echo 'src/gz %d_base %U/packages/%A/base'; \
  33. $(foreach feed,$(FEEDS_AVAILABLE), \
  34. $(if $(CONFIG_FEED_$(feed)), \
  35. echo '$(if $(filter m,$(CONFIG_FEED_$(feed))),# )src/gz %d_$(feed) %U/packages/%A/$(feed)';)))) \
  36. ) >> $(1)
  37. endef