Re: [PATCH/RFC] Makefile: dedup list of files obtained from ls-files
Eric Sunshine <sunshine@sunshineco.com> writes:
Show 15 quoted lines
> On Sun, Apr 21, 2019 at 9:19 AM Junio C Hamano <gitster@pobox.com> wrote:
>> diff --git a/Makefile b/Makefile
>> @@ -822,12 +822,12 @@ VCSSVN_LIB = vcs-svn/lib.a
>> -LIB_H := $(shell git ls-files '*.h' ':!t/' ':!Documentation/' 2>/dev/null || \
>> +LIB_H := $(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) | sort -u)
>
> GNU make's "sort" function also de-dups, so an alternative is:
>
> LIB_H := $(sort $(shell ...))
That is a much better solution. Let me use that.
Thanks.