feeds.mk 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  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)/.packageauxvars
  9. FEEDS_INSTALLED:=$(notdir $(wildcard $(TOPDIR)/package/feeds/*))
  10. FEEDS_AVAILABLE:=$(sort $(FEEDS_INSTALLED) $(shell $(SCRIPT_DIR)/feeds list -n 2>/dev/null))
  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
  38. # 1: package name
  39. define GetABISuffix
  40. $(if $(filter-out kmod-%,$(1)),$(if $(Package/$(1)/abiversion),$(if $(filter %0 %1 %2 %3 %4 %5 %6 %7 %8 %9,$(1)),-)$(Package/$(1)/abiversion)))
  41. endef