History

kbuild: install-extmod-build: Fix when given dir outside the build dir

Commit b5e395653546 ("kbuild: install-extmod-build: Fix build when specifying KBUILD_OUTPUT") tried to address the "build" variable expecting a relative path by using `realpath --relative-base=.`, but this only works when the given directory is below the current directory. `realpath --relative-to=.` will return a relative path in all cases.

James Le Cuirot committed 1 year ago

Commit 5ff90d41 parent dfab6781 file · +1 −1Browse files

Showing the changes to scripts (1 of 1 file). Show all

Unified · Split

scripts/package/install-extmod-build+1−1
@@ -63,7 +63,7 @@ if [ "${CC}" != "${HOSTCC}" ]; then · 62 unmodified lines
6363 # Clear VPATH and srcroot because the source files reside in the output
6464 # directory.
6565 # shellcheck disable=SC2016 # $(MAKE) and $(build) will be expanded by Make
66− "${MAKE}" run-command KBUILD_RUN_COMMAND='+$(MAKE) HOSTCC='"${CC}"' VPATH= srcroot=. $(build)='"$(realpath --relative-base=. "${destdir}")"/scripts
66+ "${MAKE}" run-command KBUILD_RUN_COMMAND='+$(MAKE) HOSTCC='"${CC}"' VPATH= srcroot=. $(build)='"$(realpath --relative-to=. "${destdir}")"/scripts
6767
6868 rm -f "${destdir}/scripts/Kbuild"
6969 fi