diff mbox series

[RFC,10/11] kbuild: don't test for file presence in --dry-run mode

Message ID 20240819160309.2218114-11-vegard.nossum@oracle.com (mailing list archive)
State New
Headers show
Series output a valid shell script when running 'make -n' | expand

Commit Message

Vegard Nossum Aug. 19, 2024, 4:03 p.m. UTC
I'm not really sure if this is correct as I'm not sure under which
circumstances the files tested for with $(wildcard) would NOT be
present. I'm not even sure if this is the right approach to take.

However, it _should_ keep working the same as before for regular
'make' invocations and is necessary for 'make --dry-run' to work.

Signed-off-by: Vegard Nossum <vegard.nossum@oracle.com>
---
 scripts/Makefile.modpost | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/scripts/Makefile.modpost b/scripts/Makefile.modpost
index 65f2bdc702369..139fa0b087b6d 100644
--- a/scripts/Makefile.modpost
+++ b/scripts/Makefile.modpost
@@ -99,7 +99,7 @@  modpost-args += -t $(addprefix -u , $(ksym-wl))
 modpost-deps += $(ksym-wl)
 endif
 
-ifeq ($(wildcard vmlinux.o),)
+ifeq ($(or $(wildcard vmlinux.o), $(dry_run)),)
 missing-input := vmlinux.o
 output-symdump := modules-only.symvers
 else
@@ -119,7 +119,7 @@  include $(kbuild-file)
 
 output-symdump := $(KBUILD_EXTMOD)/Module.symvers
 
-ifeq ($(wildcard Module.symvers),)
+ifeq ($(or $(wildcard Module.symvers), $(dry_run)),)
 missing-input := Module.symvers
 else
 modpost-args += -i Module.symvers