Re: [PATCH 2/3] Makefile: use `find` to determine static header dependencies

2 messages, 2 authors, 2016-06-15 · open the first message on its own page

Re: [PATCH 2/3] Makefile: use `find` to determine static header dependencies

From: Junio C Hamano <hidden>
Date: 2016-06-15 23:02:21

Jonathan Nieder [off-list ref] writes:
Jeff King wrote:
quoted
It is unfortunately easy for our static header list to grow
stale, as none of the regular developers make use of it.
Instead of trying to keep it up to date, let's invoke "find"
to generate the list dynamically.
Yep, I like this.

It does mean that people who run "make pot" have to be a little more
vigilant about not keeping around extra .h files by mistake.  But I
trust them.

[...]
quoted
+LIB_H = $(shell $(FIND) . \
+	-name .git -prune -o \
+	-name t -prune -o \
+	-name Documentation -prune -o \
+	-name '*.h' -print)
Tiny nit: I might use

	$(shell $(FIND) * \
		-name . -o
		-name '.*' -prune -o \
		-name t -prune -o \
		-name Documentation -prune -o \
		-name '*.h' -print)

or

	$(shell $(FIND) * \
		-name '.?*' -prune -o \
		-name t -prune -o \
		-name Documentation -prune -o \
		-name '*.h' -print)

to avoid spending time looking in other dot-directories like .svn,
.hg, or .snapshot.
Wouldn't it be sufficient to start digging not from "*" but from
"??*"?  That is, something like

	find ??* \( -name Documentation -o -name .\?\* \) -prune -o -name \*.h

;-)
With or without such a change,
Reviewed-by: Jonathan Nieder <redacted>
Thanks.

Re: [PATCH 2/3] Makefile: use `find` to determine static header dependencies

From: Jonathan Nieder <hidden>
Date: 2016-06-15 23:02:21

Junio C Hamano wrote:
Jonathan Nieder [off-list ref] writes:
quoted
Tiny nit: I might use

	$(shell $(FIND) * \
		-name . -o
		-name '.*' -prune -o \
		-name t -prune -o \
		-name Documentation -prune -o \
		-name '*.h' -print)

or

	$(shell $(FIND) * \
		-name '.?*' -prune -o \
		-name t -prune -o \
		-name Documentation -prune -o \
		-name '*.h' -print)

to avoid spending time looking in other dot-directories like .svn,
.hg, or .snapshot.
Wouldn't it be sufficient to start digging not from "*" but from
"??*"?
Gah, the * was supposed to be . in my examples (though it doesn't
hurt).
	find ??* \( -name Documentation -o -name .\?\* \) -prune -o -name \*.h
Heh.  Yeah, that would work. ;-)
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help