summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorMasahiro Yamada <yamada.masahiro@socionext.com>2019-07-17 09:17:51 +0300
committerMasahiro Yamada <yamada.masahiro@socionext.com>2019-07-17 16:39:27 +0300
commite0e1b1ec397e153da10f90355545607d2fd13293 (patch)
treebf84584594ee696941784e549f3fc56c64626b0a /scripts
parent1bd9a468018dd318283c7c620729ddf1923f2024 (diff)
downloadlinux-e0e1b1ec397e153da10f90355545607d2fd13293.tar.xz
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>
Diffstat (limited to 'scripts')
-rw-r--r--scripts/Makefile.build9
1 files changed, 3 insertions, 6 deletions
diff --git a/scripts/Makefile.build b/scripts/Makefile.build
index 10e92a27ec20..be32a3752de4 100644
--- a/scripts/Makefile.build
+++ b/scripts/Makefile.build
@@ -423,13 +423,10 @@ endif # builtin-target
#
# Create commands to either record .ko file or cat modules.order from
# a subdirectory
-modorder-cmds = \
- $(foreach m, $(modorder), \
- $(if $(filter %/modules.order, $m), \
- cat $m;, echo $m;))
-
$(modorder-target): $(subdir-ym) FORCE
- $(Q)(cat /dev/null; $(modorder-cmds)) > $@
+ $(Q){ $(foreach m, $(modorder), \
+ $(if $(filter %/modules.order, $m), cat $m, echo $m);) :; } \
+ | $(AWK) '!x[$$0]++' - > $@
#
# Rule to compile a set of .o files into one .a file (with symbol table)