This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: problem with recent cplus-dem.o gcc/Makefile changes


   Date: Mon, 17 Aug 1998 23:38:45 -0700
   From: "David S. Miller" <davem@dm.cobaltmicro.com>

   The following change causes cplus-dem.o to not get built in the gcc
   build subdirectory:

	   * Makefile.in (cplus-dep.o): Use cplus-dem.c from libiberty.
	   * cplus-dem.c: Delete.

   I can't figure out why make refuses to built it, even with debugging
   turned on make says:

    Finished dependencies of target file `cplus-dem.o'.
   Must remake target `cplus-dem.o'.
   Successfully remade target file `cplus-dem.o'.
   make: Nothing to be done for `cplus-dem.o'.

   It never runs the build of cplus-dem.o, I even straced make and saw
   that it found ../libiberty/cplus-dem.c and that gcc/cplus-dem.o did
   not exist, funny.

This is because there is no rule explaining how to build cplus-dem.o.
It just looks like this in Makefile.in:

cplus-dem.o: $(srcdir)/../libiberty/cplus-dem.c $(DEMANGLE_H)

>From the make manual:

   Note that explicit dependencies do not influence implicit rule
   search.  For example, consider this explicit rule:

     foo.o: foo.p

   The dependency on `foo.p' does not necessarily mean that `make' will
   remake `foo.o' according to the implicit rule to make an object file, a
   `.o' file, from a Pascal source file, a `.p' file.  For example, if
   `foo.c' also exists, the implicit rule to make an object file from a C
   source file is used instead, because it appears before the Pascal rule
   in the list of predefined implicit rules (*note Catalogue of Implicit
   Rules: Catalogue of Rules.).

In other words, listing cplus-dem.c as a dependency has no affect on
how make builds cplus-dem.o.  Since libiberty is not on VPATH, make
will not find cplus-dem.c when doing an implicit rule search.  Since
no implicit rule matches, make can only execute the commands listed in
the Makefile, which is to say, make will do nothing.

The fix is to add an appropriate $(CC) line to build cplus-dem.o from
cplus-dem.c when it is out of date.

Ian


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]