ar71xx/mikrotik: enable mikrotik platform driver
[openwrt/openwrt.git] / include / feeds.mk
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
9 -include $(TMP_DIR)/.packageauxvars
10
11 FEEDS_INSTALLED:=$(notdir $(wildcard $(TOPDIR)/package/feeds/*))
12 FEEDS_AVAILABLE:=$(sort $(FEEDS_INSTALLED) $(shell $(SCRIPT_DIR)/feeds list -n 2>/dev/null))
13
14 PACKAGE_SUBDIRS=$(PACKAGE_DIR)
15 ifneq ($(CONFIG_PER_FEED_REPO),)
16 PACKAGE_SUBDIRS += $(OUTPUT_DIR)/packages/$(ARCH_PACKAGES)/base
17 PACKAGE_SUBDIRS += $(foreach FEED,$(FEEDS_AVAILABLE),$(OUTPUT_DIR)/packages/$(ARCH_PACKAGES)/$(FEED))
18 endif
19
20 opkg_package_files = $(wildcard \
21 $(foreach dir,$(PACKAGE_SUBDIRS), \
22 $(foreach pkg,$(1), $(dir)/$(pkg)_*.ipk)))
23
24 # 1: package name
25 define FeedPackageDir
26 $(strip $(if $(CONFIG_PER_FEED_REPO), \
27 $(if $(Package/$(1)/subdir), \
28 $(abspath $(OUTPUT_DIR)/packages/$(ARCH_PACKAGES)/$(Package/$(1)/subdir)), \
29 $(PACKAGE_DIR)), \
30 $(PACKAGE_DIR)))
31 endef
32
33 # 1: destination file
34 define FeedSourcesAppend
35 ( \
36 echo 'src/gz %d_core %U/targets/%S/packages'; \
37 $(strip $(if $(CONFIG_PER_FEED_REPO), \
38 echo 'src/gz %d_base %U/packages/%A/base'; \
39 $(foreach feed,$(FEEDS_AVAILABLE), \
40 $(if $(CONFIG_FEED_$(feed)), \
41 echo '$(if $(filter m,$(CONFIG_FEED_$(feed))),# )src/gz %d_$(feed) %U/packages/%A/$(feed)';)))) \
42 ) >> $(1)
43 endef
44
45 # 1: package name
46 define GetABISuffix
47 $(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)))
48 endef