threads / patch / 25409

patchMakefile: dependencies for vcs-svn tests

Subject: [PATCH] Makefile: dependencies for vcs-svn tests

## tl;dr

3 messages between Oct 10, 2010 and Dec 4, 2010. Diffs are folded; open one to read it.

replies: 2people: 2as markdown or json

Jonathan Nieder· Oct 10, 2010, 05:50 UTC · lore

The vcs-svn tests (test-treap.o et al) depend on the vcs-svn headers for declarations and inline functions. Declare the dependency. While at it, declare a dependency of the vcs-svn objects (vcs-svn/string_pool.o et al) on $(LIB_H) to reflect use within the vcs-svn library of git-compat-util.h and cache.h.

Without this change, tweaks to inline functions in those headers do not provoke rebuilds of the corresponding tests[*], making such changes unnecessarily difficult to test.

Before:
 $ touch vcs-svn/*.h && make test-treap
 $
After:
 $ touch vcs-svn/*.h && make test-treap
 CC test-treap.o
 LINK test-treap
 $
[*] unless COMPUTE_HEADER_DEPENDENCIES is enabled
Detected with "make CHECK_HEADER_DEPENDENCIES=1".
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
---
Sorry I missed this before.
 Makefile |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)
Show changes to Makefile +5 −1
diff --git a/Makefile b/Makefile
index d3dcfb1..1bd1823 100644
--- a/Makefile
+++ b/Makefile
@@ -1762,6 +1762,8 @@ XDIFF_OBJS = xdiff/xdiffi.o xdiff/xprepare.o xdiff/xutils.o xdiff/xemit.o \
 	xdiff/xmerge.o xdiff/xpatience.o
 VCSSVN_OBJS = vcs-svn/string_pool.o vcs-svn/line_buffer.o \
 	vcs-svn/repo_tree.o vcs-svn/fast_export.o vcs-svn/svndump.o
+VCSSVN_TEST_OBJS = test-obj-pool.o test-string-pool.o \
+	test-line-buffer.o test-treap.o
 OBJECTS := $(GIT_OBJS) $(XDIFF_OBJS) $(VCSSVN_OBJS)
 
 dep_files := $(foreach f,$(OBJECTS),$(dir $f).depend/$(notdir $f).d)
@@ -1885,10 +1887,12 @@ xdiff-interface.o $(XDIFF_OBJS): \
 	xdiff/xinclude.h xdiff/xmacros.h xdiff/xdiff.h xdiff/xtypes.h \
 	xdiff/xutils.h xdiff/xprepare.h xdiff/xdiffi.h xdiff/xemit.h
 
-$(VCSSVN_OBJS): \
+$(VCSSVN_OBJS) $(VCSSVN_TEST_OBJS): $(LIB_H) \
 	vcs-svn/obj_pool.h vcs-svn/trp.h vcs-svn/string_pool.h \
 	vcs-svn/line_buffer.h vcs-svn/repo_tree.h vcs-svn/fast_export.h \
 	vcs-svn/svndump.h
+
+test-svn-fe.o: vcs-svn/svndump.h
 endif
 
 exec_cmd.s exec_cmd.o: EXTRA_CPPFLAGS = \
-- 
1.7.2.3
Junio C Hamano· Oct 12, 2010, 23:22 UTC · re: Jonathan Nieder · lore

Re: [PATCH] Makefile: dependencies for vcs-svn tests

Jonathan Nieder <jrnieder@gmail.com> writes:
Show 5 quoted lines
> The vcs-svn tests (test-treap.o et al) depend on the vcs-svn
> headers for declarations and inline functions.  Declare the
> dependency.  While at it, declare a dependency of the vcs-svn
> objects (vcs-svn/string_pool.o et al) on $(LIB_H) to reflect use
> within the vcs-svn library of git-compat-util.h and cache.h.
Thanks.
Show 33 quoted lines
>
>  Makefile |    6 +++++-
>  1 files changed, 5 insertions(+), 1 deletions(-)
>
> diff --git a/Makefile b/Makefile
> index d3dcfb1..1bd1823 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -1762,6 +1762,8 @@ XDIFF_OBJS = xdiff/xdiffi.o xdiff/xprepare.o xdiff/xutils.o xdiff/xemit.o \
>  	xdiff/xmerge.o xdiff/xpatience.o
>  VCSSVN_OBJS = vcs-svn/string_pool.o vcs-svn/line_buffer.o \
>  	vcs-svn/repo_tree.o vcs-svn/fast_export.o vcs-svn/svndump.o
> +VCSSVN_TEST_OBJS = test-obj-pool.o test-string-pool.o \
> +	test-line-buffer.o test-treap.o
>  OBJECTS := $(GIT_OBJS) $(XDIFF_OBJS) $(VCSSVN_OBJS)
>  
>  dep_files := $(foreach f,$(OBJECTS),$(dir $f).depend/$(notdir $f).d)
> @@ -1885,10 +1887,12 @@ xdiff-interface.o $(XDIFF_OBJS): \
>  	xdiff/xinclude.h xdiff/xmacros.h xdiff/xdiff.h xdiff/xtypes.h \
>  	xdiff/xutils.h xdiff/xprepare.h xdiff/xdiffi.h xdiff/xemit.h
>  
> -$(VCSSVN_OBJS): \
> +$(VCSSVN_OBJS) $(VCSSVN_TEST_OBJS): $(LIB_H) \
>  	vcs-svn/obj_pool.h vcs-svn/trp.h vcs-svn/string_pool.h \
>  	vcs-svn/line_buffer.h vcs-svn/repo_tree.h vcs-svn/fast_export.h \
>  	vcs-svn/svndump.h
> +
> +test-svn-fe.o: vcs-svn/svndump.h
>  endif
>  
>  exec_cmd.s exec_cmd.o: EXTRA_CPPFLAGS = \
> -- 
> 1.7.2.3
Jonathan Nieder· Dec 4, 2010, 19:23 UTC · re: Junio C Hamano · lore

Re: [PATCH] Makefile: dependencies for vcs-svn tests

Junio C Hamano wrote:
> Jonathan Nieder <jrnieder@gmail.com> writes:
Show 7 quoted lines
>> The vcs-svn tests (test-treap.o et al) depend on the vcs-svn
>> headers for declarations and inline functions.  Declare the
>> dependency.  While at it, declare a dependency of the vcs-svn
>> objects (vcs-svn/string_pool.o et al) on $(LIB_H) to reflect use
>> within the vcs-svn library of git-compat-util.h and cache.h.
>
> Thanks.

What happened with this patch? It doesn't seem to be applied in pu.

← back to recent threads