Patchwork possible tm.texi confusion (was: Re: Update^5: Fix PR other/44034)

mail settings
Submitter Joern Rennecke
Date June 28, 2010, 8:09 p.m.
Message ID <>
Download mbox | patch
Permalink /patch/57187/
State New
Headers show


Joern Rennecke - June 28, 2010, 8:09 p.m.
Quoting Alexandre Oliva <>:

> I assume you're Cc:ing me as maintainer of the build machinery.

Yes.  Thanks for the review.

> The
> changes to gcc/ are fine, although I think it would be better
> for the message that follows to be sent to stderr rather than stdout:

Done - see my other message to gcc-patches.

I don't want to scupper the big patch for a small detail, but it occurred to
me that there is another possible developer error that the Makefile should
try to diagnose.  Namely, when someone puts new documentation into tm.texi,
no check is done.  And when this file gets checked in and someone else then
changes or target.def, or even if the checkout just happens to
leave a newer timestamp on one of the two latter files, the other developer
will be asked to overwrite the tm.texi in the source directory.
So, dirst, I add a new dependency of the stamp file on tm.texi, and second,
if tm.texi is newer than both of the source files, the error message is

I've tested the attached sur-patchlet with 'make info' with various
combinations of timestamps of the input file while tm.texi was out-of-sync.
2010-06-28  Joern Rennecke  <>

	* (s-tm-texi): Also depend on $(srcdir)/doc/tm.texi.
	When comparison fails and $(srcdir)/doc/tm.texi is newer
	than $(srcdir)/doc/ and $(srcdir)/doc/target.def,
	emit error message advising to edit $(srcdir)/doc/


---	2010-06-28 20:05:07.126139991 +0100
+++	2010-06-28 20:52:21.110383212 +0100
@@ -3682,12 +3682,21 @@  s-target-hooks-def-h: build/genhooks$(bu
 	$(SHELL) $(srcdir)/../move-if-change tmp-target-hooks-def.h \
 	$(STAMP) s-target-hooks-def-h
+# check if someone mistakenly only changed tm.texi.
+s-tm-texi: $(srcdir)/doc/tm.texi
 s-tm-texi: build/genhooks$(build_exeext) $(srcdir)/doc/
 	$(RUN_GEN) build/genhooks$(build_exeext) \
 			$(srcdir)/doc/ > tmp-tm.texi
 	$(SHELL) $(srcdir)/../move-if-change tmp-tm.texi tm.texi
 	@if cmp -s $(srcdir)/doc/tm.texi tm.texi; then \
 	  $(STAMP) $@; \
+	elif test $(srcdir)/doc/tm.texi -nt $(srcdir)/doc/ \
+	  && test $(srcdir)/doc/tm.texi -nt $(srcdir)/doc/target.def; then \
+	  echo >&2 ; \
+	  echo You should edit $(srcdir)/doc/ rather than $(srcdir)/doc/tm.texi . >&2 ; \
+	  false; \
 	else \
 	  echo >&2 ; \
 	  echo Verify that you have permission to grant a GFDL license for all >&2 ; \