Skip to content

Commit e0e1b1e

Browse files
committed
kbuild: remove duplication from modules.order in sub-directories
Currently, only the top-level modules.order drops duplicated entries. The modules.order files in sub-directories potentially contain duplication. To list out the paths of all modules, I want to use modules.order instead of parsing *.mod files in $(MODVERDIR). To achieve this, I want to rip off duplication from modules.order of external modules too. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
1 parent 1bd9a46 commit e0e1b1e

1 file changed

Lines changed: 3 additions & 6 deletions

File tree

‎scripts/Makefile.build‎

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -423,13 +423,10 @@ endif # builtin-target
423423
#
424424
# Create commands to either record .ko file or cat modules.order from
425425
# a subdirectory
426-
modorder-cmds = \
427-
$(foreach m, $(modorder), \
428-
$(if $(filter %/modules.order, $m), \
429-
cat $m;, echo $m;))
430-
431426
$(modorder-target): $(subdir-ym) FORCE
432-
$(Q)(cat /dev/null; $(modorder-cmds)) > $@
427+
$(Q){ $(foreach m, $(modorder), \
428+
$(if $(filter %/modules.order, $m), cat $m, echo $m);) :; } \
429+
| $(AWK) '!x[$$0]++' - > $@
433430

434431
#
435432
# Rule to compile a set of .o files into one .a file (with symbol table)

0 commit comments

Comments
 (0)