build: fix find warning with SCAN_EXTRA
authorLeo Chung <gewalalb@gmail.com>
Thu, 31 Mar 2022 01:14:35 +0000 (09:14 +0800)
committerChristian 'Ansuel' Marangi <ansuelsmth@gmail.com>
Sun, 5 Jun 2022 13:38:27 +0000 (15:38 +0200)
If you change SCAN_EXTRA variable with "-path target/linux/xxxx" in
include/toplevel.mk for speed up scan, find will warn with:

find: warning: you have specified the global option -maxdepth after
the argument -path, but global options are not positional, i.e.,
-maxdepth affects tests specified before it as well as those specified
after it.  Please specify global options before other arguments.

The find option -mindepth -maxdepth are global options and must be
before any path option. Change order of $(SCAN_EXTRA) after -mindepth
and -maxdepth to fix this.

Signed-off-by: Leo Chung <gewalalb@gmail.com>
[capitalize Description, Author and Sob and minor description tweak]
Signed-off-by: Christian 'Ansuel' Marangi <ansuelsmth@gmail.com>
include/scan.mk

index aee24cb3e597dd75645de70cc996627a950cc52a..5032afa8186c83a61c1dcdfe88f24613f93fc294 100644 (file)
@@ -72,7 +72,7 @@ endif
 
 $(FILELIST): $(OVERRIDELIST)
        rm -f $(TMP_DIR)/info/.files-$(SCAN_TARGET)-*
-       find -L $(SCAN_DIR) $(SCAN_EXTRA) -mindepth 1 $(if $(SCAN_DEPTH),-maxdepth $(SCAN_DEPTH)) -name Makefile | xargs grep -aHE 'call $(GREP_STRING)' | sed -e 's#^$(SCAN_DIR)/##' -e 's#/Makefile:.*##' | uniq | awk -v of=$(OVERRIDELIST) -f include/scan.awk > $@
+       find -L $(SCAN_DIR) -mindepth 1 $(if $(SCAN_DEPTH),-maxdepth $(SCAN_DEPTH)) $(SCAN_EXTRA) -name Makefile | xargs grep -aHE 'call $(GREP_STRING)' | sed -e 's#^$(SCAN_DIR)/##' -e 's#/Makefile:.*##' | uniq | awk -v of=$(OVERRIDELIST) -f include/scan.awk > $@
 
 $(TMP_DIR)/info/.files-$(SCAN_TARGET).mk: $(FILELIST)
        ( \