Re: [PATCH v2 2/3] Makefile: strip leading ./ in $(FIND_SOURCE_FILES)
From: SZEDER Gábor <hidden>
Date: 2019-09-13 12:05:26
On Thu, Sep 12, 2019 at 10:28:32AM -0700, Denton Liu wrote:
quoted hunk ↗ jump to hunk
Currently, $(FIND_SOURCE_FILES) has two modes: if `git ls-files` is present, it will use that to enumerate the files in the repository; else it will use `$(FIND) .` to enumerate the files in the directory. There is a subtle difference between these two methods, however. With ls-files, filenames don't have a leading `./` while with $(FIND), they do. This does not currently pose a problem but in a future patch, we will be using `filter-out` to process the list of files with the assumption that there is no prefix. Unify the two possible invocations in $(FIND_SOURCE_FILES) by using sed to remove the `./` prefix in the $(FIND) case. Signed-off-by: Denton Liu <redacted> --- Makefile | 1 + 1 file changed, 1 insertion(+)diff --git a/Makefile b/Makefile index b88b42d7ed..e2c693440b 100644 --- a/Makefile +++ b/Makefile@@ -2610,6 +2610,7 @@ FIND_SOURCE_FILES = ( \ -o \( -name 'trash*' -type d -prune \) \ -o \( -name '*.[hcS]' -type f -print \) \ -o \( -name '*.sh' -type f -print \) \ + | sed -e 's|^\./||' \
Ramsay pointed out to me (in an off-list email) that the list of library header files is generated in a similar way, and then those leading './' have to be removed later. See how the LIB_H and CHK_HDRS variables are assigned. I think it would be great to apply the same treatment there, too, to eliminate those './' prefixes right at the source.