summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2019-04-21 13:19:04 (GMT)
committerJunio C Hamano <gitster@pobox.com>2019-04-22 06:14:22 (GMT)
commit604a64641d874b0f00f1d1371f25be177972bcf2 (patch)
tree1051ae5886fd65e62c0c32014b3e5b00aa82511d /Makefile
parent14c0f8d3ab6c36672189cd2dd217f4617d12ccba (diff)
downloadgit-604a64641d874b0f00f1d1371f25be177972bcf2.zip
git-604a64641d874b0f00f1d1371f25be177972bcf2.tar.gz
git-604a64641d874b0f00f1d1371f25be177972bcf2.tar.bz2
Makefile: dedup list of files obtained from ls-files
Since 33533975 ("Makefile: ask "ls-files" to list source files if available", 2011-10-18), we optionally asked "ls-files" to list the source files that ought to exist, as a faster approximation for "find" on working tree files. This works reasonably well, except that it ends up listing the same path multiple times if the index is unmerged. Because the original use of this construct was to name files to run etags over, and the etags command happily takes the same filename multiple times without causing any harm, there was no problem (other than perhaps spending slightly more cycles, but who cares how fast the TAGS file gets updated). We however recently added a similar call to "ls-files" to list *.h files, instead of using "find", in 92b88eba ("Makefile: use `git ls-files` to list header files, if possible", 2019-03-04). In this new use of "ls-files", the resulting list $(LIB_H) is used for, among other things, generating the header files to run hdr-check target, and the duplicate unfortunately becomes a true problem. It causes $(MAKE) to notice that there are multiple %.hco targets and complain. Let the resulting list consumed by $(sort), which deduplicates, to fix this. Helped-by: Eric Sunshine <sunshine@sunshineco.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile4
1 files changed, 2 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index 9f1b6e8..c79e8ba 100644
--- a/Makefile
+++ b/Makefile
@@ -822,12 +822,12 @@ VCSSVN_LIB = vcs-svn/lib.a
GENERATED_H += command-list.h
-LIB_H := $(shell git ls-files '*.h' ':!t/' ':!Documentation/' 2>/dev/null || \
+LIB_H := $(sort $(shell git ls-files '*.h' ':!t/' ':!Documentation/' 2>/dev/null || \
$(FIND) . \
-name .git -prune -o \
-name t -prune -o \
-name Documentation -prune -o \
- -name '*.h' -print)
+ -name '*.h' -print))
LIB_OBJS += abspath.o
LIB_OBJS += advice.o