From patchwork Mon Aug 30 16:34:07 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: gengtype improvements for plugins. What is missing??? From: Paolo Bonzini X-Patchwork-Id: 63074 Message-Id: <4C7BDD7F.3010908@gnu.org> To: basile@starynkevitch.net Cc: jeremie.salvucci@free.fr, gcc-patches@gcc.gnu.org, iant@google.com, dnovillo@google.com, laurynas.biveinis@gmail.com Date: Mon, 30 Aug 2010 18:34:07 +0200 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) \