aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@nbd.name>2022-09-27 13:39:12 +0200
committerFelix Fietkau <nbd@nbd.name>2022-09-27 13:45:03 +0200
commit25d8b9cad6f141104a1065880efe21b8c292d8c6 (patch)
tree5946d0f8fec279f03e5113d2e9ff1108c46a9c07
parent74eeee1698e8ee2031ab882174b1a07d2c553409 (diff)
downloadupstream-25d8b9cad6f141104a1065880efe21b8c292d8c6.tar.gz
upstream-25d8b9cad6f141104a1065880efe21b8c292d8c6.tar.bz2
upstream-25d8b9cad6f141104a1065880efe21b8c292d8c6.zip
build: fix issues with targets installed via feeds
- fix including modules.mk when a target is being replaced - fix calling make targets from target/linux Signed-off-by: Felix Fietkau <nbd@nbd.name> (cherry-picked from commit 3a8825ad6acbf18b2b472ace56be58868af78be7)
-rw-r--r--include/target.mk2
-rw-r--r--package/kernel/linux/Makefile7
-rw-r--r--target/linux/Makefile2
3 files changed, 6 insertions, 5 deletions
diff --git a/include/target.mk b/include/target.mk
index a2c8b7bdbf..708ba395c6 100644
--- a/include/target.mk
+++ b/include/target.mk
@@ -68,7 +68,7 @@ endif
target_conf=$(subst .,_,$(subst -,_,$(subst /,_,$(1))))
ifeq ($(DUMP),)
- PLATFORM_DIR:=$(TOPDIR)/target/linux/$(BOARD)
+ PLATFORM_DIR:=$(firstword $(wildcard $(TOPDIR)/target/linux/feeds/$(BOARD) $(TOPDIR)/target/linux/$(BOARD)))
SUBTARGET:=$(strip $(foreach subdir,$(patsubst $(PLATFORM_DIR)/%/target.mk,%,$(wildcard $(PLATFORM_DIR)/*/target.mk)),$(if $(CONFIG_TARGET_$(call target_conf,$(BOARD)_$(subdir))),$(subdir))))
else
PLATFORM_DIR:=${CURDIR}
diff --git a/package/kernel/linux/Makefile b/package/kernel/linux/Makefile
index ad68bde9b3..ff91760270 100644
--- a/package/kernel/linux/Makefile
+++ b/package/kernel/linux/Makefile
@@ -12,7 +12,9 @@ PKG_NAME:=kernel
PKG_FLAGS:=hold
PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/packages
-SCAN_DEPS=modules/*.mk $(TOPDIR)/target/linux/*/modules.mk $(TOPDIR)/target/linux/*/*/modules.mk $(TOPDIR)/include/netfilter.mk
+SUBTARGETS = $(sort $(filter-out feeds,$(notdir $(wildcard $(TOPDIR)/target/linux/* $(TOPDIR)/target/linux/feeds/*))))
+SUBTARGET_MODULES = $(foreach t,$(SUBTARGETS),$(firstword $(wildcard $(TOPDIR)/target/linux/feeds/$(t)/modules.mk $(TOPDIR)/target/linux/$(t)/modules.mk)))
+SCAN_DEPS=modules/*.mk $(SUBTARGET_MODULES) $(TOPDIR)/include/netfilter.mk
PKG_LICENSE:=GPL-2.0
PKG_LICENSE_FILES:=
@@ -63,5 +65,4 @@ endef
$(eval $(if $(DUMP),,$(call BuildPackage,kernel)))
include $(sort $(wildcard ./modules/*.mk))
--include $(TOPDIR)/target/linux/*/modules.mk
--include $(TOPDIR)/target/linux/*/*/modules.mk
+-include $(SUBTARGET_MODULES)
diff --git a/target/linux/Makefile b/target/linux/Makefile
index a939d42bc0..8eea40ee18 100644
--- a/target/linux/Makefile
+++ b/target/linux/Makefile
@@ -8,4 +8,4 @@ include $(INCLUDE_DIR)/target.mk
export TARGET_BUILD=1
prereq clean download prepare compile install oldconfig menuconfig nconfig xconfig update refresh: FORCE
- @+$(NO_TRACE_MAKE) -C $(BOARD) $@
+ @+$(NO_TRACE_MAKE) -C $(firstword $(wildcard feeds/$(BOARD) $(BOARD))) $@