From patchwork Mon Aug 30 16:34:07 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 63074 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 BAFEBB70D2 for ; Tue, 31 Aug 2010 02:34:49 +1000 (EST) Received: (qmail 7772 invoked by alias); 30 Aug 2010 16:34:47 -0000 Received: (qmail 7762 invoked by uid 22791); 30 Aug 2010 16:34:46 -0000 X-SWARE-Spam-Status: No, hits=-2.0 required=5.0 tests=AWL, BAYES_00, DKIM_SIGNED, DKIM_VALID, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: sourceware.org Received: from mail-qy0-f182.google.com (HELO mail-qy0-f182.google.com) (209.85.216.182) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 30 Aug 2010 16:34:12 +0000 Received: by qyk4 with SMTP id 4so5950302qyk.20 for ; Mon, 30 Aug 2010 09:34:10 -0700 (PDT) Received: by 10.224.28.77 with SMTP id l13mr3015843qac.222.1283186050597; Mon, 30 Aug 2010 09:34:10 -0700 (PDT) Received: from yakj.usersys.redhat.com (nat-pool-brq-t.redhat.com [209.132.186.34]) by mx.google.com with ESMTPS id t4sm8504918qcs.16.2010.08.30.09.34.08 (version=TLSv1/SSLv3 cipher=RC4-MD5); Mon, 30 Aug 2010 09:34:10 -0700 (PDT) Message-ID: <4C7BDD7F.3010908@gnu.org> Date: Mon, 30 Aug 2010 18:34:07 +0200 From: Paolo Bonzini User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.10) Gecko/20100621 Fedora/3.0.5-1.fc13 Lightning/1.0b2pre Mnenhy/0.8.3 Thunderbird/3.0.5 MIME-Version: 1.0 To: basile@starynkevitch.net CC: jeremie.salvucci@free.fr, gcc-patches@gcc.gnu.org, iant@google.com, dnovillo@google.com, laurynas.biveinis@gmail.com Subject: Re: gengtype improvements for plugins. What is missing??? References: <1283012591.3067.17.camel@glinka> <20100828170603.GA1108@gmx.de> <1283016347.3067.43.camel@glinka> <1283062592.3067.50.camel@glinka> <1283063995.3067.63.camel@glinka> <1283077287.3067.78.camel@glinka> <1283077418.3067.79.camel@glinka> <1283081687.3067.86.camel@glinka> <1283101940.3067.103.camel@glinka> <1283109809.3067.132.camel@glinka> In-Reply-To: <1283109809.3067.132.camel@glinka> 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 On 08/29/2010 09:23 PM, Basile Starynkevitch wrote: > > > See http://gcc.gnu.org/ml/gcc-patches/2010-08/msg02058.html > +ifdef REVISION_c > +build/version.o: version.c version.h $(REVISION) $(DATESTAMP) $(BASEVER) $(DEVPHASE) > +else > +build/version.o: version.c version.h $(DATESTAMP) $(BASEVER) $(DEVPHASE) > +endif Instead include something like this: and use $(REVISION) unconditionally in your rule just like I'm doing above. > +## The build/version.o is compiled by the $(COMPILER_FOR_BUILD) so > +build/version.o: BUILD_CPPFLAGS += \ > + -DBASEVER=$(BASEVER_s) -DDATESTAMP=$(DATESTAMP_s) \ > + -DREVISION=$(REVISION_s) \ > + -DDEVPHASE=$(DEVPHASE_s) -DPKGVERSION=$(PKGVERSION_s) \ > + -DBUGURL=$(BUGURL_s) -c $(srcdir)/version.c $(OUTPUT_OPTION) Adding the -c option to build/version.o's value of BUILD_CPPFLAGS is a cut-and-paste error from version.o's rule. Please use the whole rule, as in build/version.o: version.c version.h $(REVISION) $(DATESTAMP) $(BASEVER) $(DEVPHASE) $(COMPILER_FOR_BUILD) -c $(BUILD_COMPILERFLAGS) \ $(BUILD_CPPFLAGS) ... other flags above ... \ -o $@ $< > Ian Taylor, Diego Novillo, Paolo Bonzini and others, is that slicing in > several pieces enough for you? I hope yes! Yes, looks good to me in principle, though I only reviewed the minor build changes you have. Paolo Index: Makefile.in =================================================================== --- Makefile.in (revision 162940) +++ Makefile.in (working copy) @@ -834,6 +834,7 @@ DATESTAMP_c := $(shell cat $(DATESTAMP)) ifeq (,$(wildcard $(REVISION))) REVISION_c := +REVISION := else REVISION_c := $(shell cat $(REVISION)) endif @@ -2238,11 +2239,7 @@ gcc-options.o: options.c $(CONFIG_H) $(S dumpvers: dumpvers.c -ifdef REVISION_c version.o: version.c version.h $(REVISION) $(DATESTAMP) $(BASEVER) $(DEVPHASE) -else -version.o: version.c version.h $(DATESTAMP) $(BASEVER) $(DEVPHASE) -endif $(COMPILER) $(ALL_COMPILERFLAGS) $(ALL_CPPFLAGS) \ -DBASEVER=$(BASEVER_s) -DDATESTAMP=$(DATESTAMP_s) \ -DREVISION=$(REVISION_s) \