summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorLibravatar Denton Liu <liu.denton@gmail.com>2019-09-16 12:23:08 -0700
committerLibravatar Junio C Hamano <gitster@pobox.com>2019-09-17 09:13:02 -0700
commitcf6a2d2557a5a50e0b1cf3a861a0df948e2782fc (patch)
tree4548ab0e07cdad7bdf2b54e1bc3e9f787c2badca /Makefile
parentcompat/*.[ch]: remove extern from function declarations using spatch (diff)
downloadtgif-cf6a2d2557a5a50e0b1cf3a861a0df948e2782fc.tar.xz
Makefile: strip leading ./ in $(LIB_H)
Currently, $(LIB_H) is generated from 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 results in $(CHK_HDRS) having to substitute out the leading `./` before it uses $(LIB_H). Unify the two possible values in $(LIB_H) by using patsubst to remove the `./` prefix at its definition. Signed-off-by: Denton Liu <liu.denton@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile6
1 files changed, 3 insertions, 3 deletions
diff --git a/Makefile b/Makefile
index f9255344ae..79ef221cd2 100644
--- a/Makefile
+++ b/Makefile
@@ -818,12 +818,12 @@ VCSSVN_LIB = vcs-svn/lib.a
GENERATED_H += command-list.h
-LIB_H := $(sort $(shell git ls-files '*.h' ':!t/' ':!Documentation/' 2>/dev/null || \
+LIB_H := $(sort $(patsubst ./%,%,$(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
@@ -2768,7 +2768,7 @@ EXCEPT_HDRS := $(GEN_HDRS) compat/% xdiff/%
ifndef GCRYPT_SHA256
EXCEPT_HDRS += sha256/gcrypt.h
endif
-CHK_HDRS = $(filter-out $(EXCEPT_HDRS),$(patsubst ./%,%,$(LIB_H)))
+CHK_HDRS = $(filter-out $(EXCEPT_HDRS),$(LIB_H))
HCO = $(patsubst %.h,%.hco,$(CHK_HDRS))
$(HCO): %.hco: %.h FORCE