From patchwork Sun Nov 14 18:28:29 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joern Rennecke X-Patchwork-Id: 71143 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id 28132B711E for ; Mon, 15 Nov 2010 05:28:28 +1100 (EST) Received: (qmail 12229 invoked by alias); 14 Nov 2010 18:28:27 -0000 Received: (qmail 12217 invoked by uid 22791); 14 Nov 2010 18:28:26 -0000 X-SWARE-Spam-Status: No, hits=-2.5 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_LOW X-Spam-Check-By: sourceware.org Received: from c60.cesmail.net (HELO c60.cesmail.net) (216.154.195.49) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sun, 14 Nov 2010 18:27:40 +0000 Received: from unknown (HELO webmail2) ([192.168.1.183]) by c60.cesmail.net with ESMTP; 14 Nov 2010 13:27:38 -0500 Received: from 89.241.153.155 ([89.241.153.155]) by webmail.spamcop.net (Horde MIME library) with HTTP; Sun, 14 Nov 2010 13:28:29 -0500 Message-ID: <20101114132829.05yt062q8cg8swwo-nzlynne@webmail.spamcop.net> Date: Sun, 14 Nov 2010 13:28:29 -0500 From: Joern Rennecke To: Ralf Wildenhues Cc: Paolo Bonzini , gcc-patches@gcc.gnu.org, DJ Delorie , Alexandre Oliva , Nathanael Nerode Subject: RFA: avoid circular dependency (using doc/../doc) (Was: Re: copying a timestamp) References: <20101104090834.yzg2549rks8o84wg-nzlynne@webmail.spamcop.net> <20101112091310.xfc3pvh9ogw0sskg-nzlynne@webmail.spamcop.net> <4CDD502D.9060405@gnu.org> <20101112100204.lhw5uyhrpcswogo8-nzlynne@webmail.spamcop.net> <4CDD5805.8040708@gnu.org> <20101112110038.qzd8l0pbgo4swgs8-nzlynne@webmail.spamcop.net> <20101114094629.21cjtbpj8gogcogg-nzlynne@webmail.spamcop.net> <20101114152721.GE3399@gmx.de> <20101114103502.1kyi9jus6ooo0o4c-nzlynne@webmail.spamcop.net> <20101114154631.GH3399@gmx.de> In-Reply-To: <20101114154631.GH3399@gmx.de> MIME-Version: 1.0 User-Agent: Internet Messaging Program (IMP) H3 (4.1.4) Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Quoting Ralf Wildenhues : > * Joern Rennecke wrote on Sun, Nov 14, 2010 at 04:35:02PM CET: >> I just realized there is a third alternative: we could exploit the fact >> that the same file is handled by make as different targets if named >> with different pathnames, i.e. >> [$(srcdir)/doc/]tm.texi and $(srcdir)/doc/../doc/tm.texi are >> different make targets. >> I'm not sure if that would be exploiting a stable feature or a >> bug/limitation >> that might disappear from GNU make before the FSF GPL/GFDL problems >> are resolved. > > It's not likely that this will disappear, but code like that will jump > out at the casual reader months from now as likely-buggy. So that would > definitely deserve a comment. OK, I've added some. Bootstrapped on i686-pc-linux-gnu. > Maybe also a make-time (or > configure-time) test that this feature/bug has not changed? That sounds hard to get right, and hopefully it will be moot when we get a proper resolution of the GPL / GFDL issues. At any rate, the expected failure mode is that make will go back to complain about a circular dependency. 2010-11-14 Joern Rennecke * Makefile.in (tm.texi): Replace with rule for: ($(srcdir)/doc/tm.texi). (s-tm-texi): Depend on $(srcdir)/doc/../doc/tm.texi instead of on $(srcdir)/doc/tm.texi . (TEXI_GCCINT_FILES): Depend on $(srcdir)/doc/tm.texi instead of on tm.texi . Index: Makefile.in =================================================================== --- Makefile.in (revision 166609) +++ Makefile.in (working copy) @@ -3688,7 +3688,8 @@ s-constrs-h: $(MD_DEPS) build/genpreds$( $(STAMP) s-constrs-h target-hooks-def.h: s-target-hooks-def-h; @true -tm.texi: s-tm-texi; @true +# make sure that when we build info files, the used tm.texi is up to date. +$(srcdir)/doc/tm.texi: s-tm-texi; @true s-target-hooks-def-h: build/genhooks$(build_exeext) $(RUN_GEN) build/genhooks$(build_exeext) > tmp-target-hooks-def.h @@ -3697,7 +3698,8 @@ s-target-hooks-def-h: build/genhooks$(bu $(STAMP) s-target-hooks-def-h # check if someone mistakenly only changed tm.texi. -s-tm-texi: $(srcdir)/doc/tm.texi +# We use a different pathname here to avoid a circular dependency. +s-tm-texi: $(srcdir)/doc/../doc/tm.texi s-tm-texi: build/genhooks$(build_exeext) $(srcdir)/doc/tm.texi.in $(RUN_GEN) build/genhooks$(build_exeext) \ @@ -4198,10 +4200,14 @@ TEXI_GCC_FILES = gcc.texi gcc-common.tex fdl.texi contrib.texi cppenv.texi cppopts.texi \ implement-c.texi implement-cxx.texi arm-neon-intrinsics.texi +# we explicitly use $(srcdir)/doc/tm.texi here to avoid confusion with +# the generated tm.texi; the latter might have a more recent timestamp, +# but we don't want to rebuild the info files unless the contents of +# the *.texi files have changed. TEXI_GCCINT_FILES = gccint.texi gcc-common.texi gcc-vers.texi \ contribute.texi makefile.texi configterms.texi options.texi \ - portability.texi interface.texi passes.texi \ - rtl.texi md.texi tm.texi hostconfig.texi fragments.texi \ + portability.texi interface.texi passes.texi rtl.texi md.texi \ + $(srcdir)/doc/tm.texi hostconfig.texi fragments.texi \ configfiles.texi collect2.texi headerdirs.texi funding.texi \ gnu.texi gpl_v3.texi fdl.texi contrib.texi languages.texi \ sourcebuild.texi gty.texi libgcc.texi cfg.texi tree-ssa.texi \