These environment variables are passed when invoking 'make', but if
running 'make -n' we need to pass them explicitly so they become part
of the printed command.

Signed-off-by: Vegard Nossum <[email protected]>
---
 Makefile | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/Makefile b/Makefile
index f09c036daf2f5..58f3843ccfac6 100644
--- a/Makefile
+++ b/Makefile
@@ -1165,7 +1165,10 @@ vmlinux: vmlinux.o $(KBUILD_LDS) modpost
 $(sort $(KBUILD_LDS) $(KBUILD_VMLINUX_OBJS) $(KBUILD_VMLINUX_LIBS)): . ;
 
 ifeq ($(origin KERNELRELEASE),file)
-filechk_kernel.release = $(srctree)/scripts/setlocalversion $(srctree)
+filechk_kernel.release = \
+       KERNELVERSION="$(KERNELVERSION)" \
+       LOCALVERSION="$(LOCALVERSION)" \
+       $(srctree)/scripts/setlocalversion $(srctree)
 else
 filechk_kernel.release = echo $(KERNELRELEASE)
 endif
-- 
2.34.1


Reply via email to