Skip to content

Commit 34420cb

Browse files
haryvensmfrench
authored andcommitted
smb/client: ensure smb2_mapping_table rebuild on cmd changes
The current rule for smb2_mapping_table.c uses `$(call cmd,...)`, which fails to track command line modifications in the Makefile (e.g., modifying the command to `perl -d` or `perl -w` for debug will not trigger a rebuild) and does not generate the required .cmd file for Kbuild. Fix this by transitioning to the standard `$(call if_changed,...)` macro. This includes adding the `FORCE` prerequisite and appending the output file to the `targets` variable so Kbuild can track it properly. As a result, Kbuild now automatically handles the cleaning of the generated file, allowing us to safely drop the redundant `clean-files` assignment. Fixes: c527e13 ("cifs: Autogenerate SMB2 error mapping table") Signed-off-by: Huiwen He <[email protected]> Reviewed-by: ChenXiaoSong <[email protected]> Signed-off-by: Steve French <[email protected]>
1 parent c369299 commit 34420cb

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

fs/smb/client/Makefile

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@ cifs-$(CONFIG_CIFS_COMPRESSION) += compress.o compress/lz77.o
4848
# Build the SMB2 error mapping table from smb2status.h
4949
#
5050
$(obj)/smb2_mapping_table.c: $(src)/../common/smb2status.h \
51-
$(src)/gen_smb2_mapping
52-
$(call cmd,gen_smb2_mapping)
51+
$(src)/gen_smb2_mapping FORCE
52+
$(call if_changed,gen_smb2_mapping)
5353

5454
$(obj)/smb2maperror.o: $(obj)/smb2_mapping_table.c
5555

@@ -58,4 +58,5 @@ quiet_cmd_gen_smb2_mapping = GEN $@
5858

5959
obj-$(CONFIG_SMB_KUNIT_TESTS) += smb2maperror_test.o
6060

61-
clean-files += smb2_mapping_table.c
61+
# Let Kbuild handle tracking and cleaning
62+
targets += smb2_mapping_table.c

0 commit comments

Comments
 (0)