Skip to content
Commit 397a479b authored by Masahiro Yamada's avatar Masahiro Yamada
Browse files

kbuild: simplify rustfmt target



There is no need to prune the rust/alloc directory because it was
removed by commit 9d0441ba ("rust: alloc: remove our fork of the
`alloc` crate").

There is no need to prune the rust/test directory because no '*.rs'
files are generated within it.

To avoid forking the 'grep -Fv generated' process, filter out generated
files using the option, ! -name '*generated*'.

Now that the '-path ... -prune' option is no longer used, there is no
need to use the absolute path. Searching in $(srctree), which can be
a relative path, is sufficient.

The comment mentions the use case where $(srctree) is '..', that is,
$(objtree) is a sub-directory of $(srctree). In this scenario, all
'*.rs' files under $(objtree) are generated files and filters out by
the '*generated*' pattern.

Add $(RCS_FIND_IGNORE) as a shortcut. Although I do not believe '*.rs'
files would exist under the .git directory, there is no need for the
'find' command to traverse it.

Signed-off-by: default avatarMasahiro Yamada <masahiroy@kernel.org>
Reviewed-by: default avatarNicolas Schier <n.schier@avm.de>
Acked-by: default avatarMiguel Ojeda <ojeda@kernel.org>
parent a49401be
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment