[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: multiple prerequisites in pattern rules

From: Paul D. Smith
Subject: Re: multiple prerequisites in pattern rules
Date: Fri, 30 Jan 2004 13:20:00 -0500

%% Noel Yap <address@hidden> writes:

  ny> "Paul D. Smith" wrote:
  >> No other files other than the target(s) will ever be removed (how could
  >> they be, when make doesn't even know they were created?)

  ny> I see.  I had thought, probably naively, that make watched the
  ny> open calls.

How could it do that?  Make isn't in the kernel; it can't watch the
system calls of another process.  I guess it could so something bizarre
like run subcommands in strace and look for certain kinds of output.
Also someone suggested using LD_PRELOAD to load a shim library that
wraps open, etc. and writes out a makefile fragment.  Cool stuff, but
not very portable.

ClearCase's clearmake can do this, because ClearCase implements its own
filesystem (MVFS).  So, clearmake can communicate with the MVFS kernel
module and track all accesses of files that are made through that
filesystem (basically all files that are in ClearCase).  Even this
doesn't let clearmake track, for example, header files in /usr/include
because they're not in an MVFS filesystem.

  ny> Given that what you say is true, one way to fix the problem might
  ny> be to break apart the rule.  For example:

  ny> %.d: %.o
  ny>   $(MakeDependsAction)

  ny> %.o: %.C
  ny>   $(C++CompileAction)

Well, if you're using the advanced autodependency creation method this
won't work, because a critical feature of that method is that make
_doesn't_ know how to build the dependency file.  If it did, then when
you included the file make would try to rebuild it, then re-exec
itself.  That defeats the purpose of the advanced method.

 Paul D. Smith <address@hidden>          Find some GNU make tips at:            
 "Please remain calm...I may be mad, but I am a professional." --Mad Scientist

reply via email to

[Prev in Thread] Current Thread [Next in Thread]