From: Paul Spooren Date: Mon, 12 Feb 2024 15:59:50 +0000 (+0100) Subject: build: align SOURCE path for build system and SDK X-Git-Tag: v23.05.5~1 X-Git-Url: http://git.openwrt.org/?a=commitdiff_plain;h=10cc5fcd00c648b1a3b4043734c49c18f294041f;p=openwrt%2Fstaging%2Fpepe2k.git build: align SOURCE path for build system and SDK Building a package in the build system or the SDK results in different values for the `SOURCE` property, it's either `packages/` or `feeds/base/`. The reason is that the SDK handles `openwrt.git` as an external feed called while the build system contains the *base* packages directly. Since packages created with either method are (ideally) the same (bit for bit), align the content of SOURCE. To do so this commit creates a symlink from `feeds/base` to `$(TOPDIR)/package` and adopts the SOURCE when building from inside the build system. Signed-off-by: Paul Spooren --- diff --git a/include/package-defaults.mk b/include/package-defaults.mk index 2cff26b531..af92d4acd7 100644 --- a/include/package-defaults.mk +++ b/include/package-defaults.mk @@ -20,7 +20,7 @@ define Package/Default PROVIDES:= EXTRA_DEPENDS:= MAINTAINER:=$(PKG_MAINTAINER) - SOURCE:=$(patsubst $(TOPDIR)/%,%,$(CURDIR)) + SOURCE:=$(patsubst $(TOPDIR)/%,%,$(patsubst $(TOPDIR)/package/%,feeds/base/%,$(CURDIR))) ifneq ($(PKG_VERSION),) ifneq ($(PKG_RELEASE),) VERSION:=$(PKG_VERSION)-$(PKG_RELEASE) diff --git a/include/toplevel.mk b/include/toplevel.mk index 328214be1b..f377933949 100644 --- a/include/toplevel.mk +++ b/include/toplevel.mk @@ -77,7 +77,8 @@ _ignore = $(foreach p,$(IGNORE_PACKAGES),--ignore $(p)) prepare-tmpinfo: FORCE @+$(MAKE) -r -s $(STAGING_DIR_HOST)/.prereq-build $(PREP_MK) - mkdir -p tmp/info + mkdir -p tmp/info feeds + [ -e $(TOPDIR)/feeds/base ] || ln -sf $(TOPDIR)/package $(TOPDIR)/feeds/base $(_SINGLE)$(NO_TRACE_MAKE) -j1 -r -s -f include/scan.mk SCAN_TARGET="packageinfo" SCAN_DIR="package" SCAN_NAME="package" SCAN_DEPTH=5 SCAN_EXTRA="" $(_SINGLE)$(NO_TRACE_MAKE) -j1 -r -s -f include/scan.mk SCAN_TARGET="targetinfo" SCAN_DIR="target/linux" SCAN_NAME="target" SCAN_DEPTH=3 SCAN_EXTRA="" SCAN_MAKEOPTS="TARGET_BUILD=1" for type in package target; do \