Re: [PATCH] Support for GNU make dependency generation
Eric Blake <[email protected]> Tue, 26 Oct 2010 07:56:46 -0600
| Newsgroups | gmane.comp.gnu.m4.patches |
|---|---|
| Organization | Red Hat |
| Message-ID | <[email protected]> |
On 10/26/2010 07:41 AM, David M. Warme wrote: > 2. By creating both the dependency file and the actual m4 target > file in one step, you wind up being in danger of "circular > dependencies" -- running make twice in a row causes stuff to > be remade the second time. In certain cases, even an endless > succession of "make" invocations causes stuff to get remade > every time. Single commands that update two or more targets > at once are the usual cause of this behavior. The fix is to > have two separate rules in your Makefile: I'm reluctant to have to require to run m4 twice per file. Dependencies as a side effect of compilation is the most efficient way to generate dependencies, and running twice defeats this. There's a reason that automake prefers to generate dependencies during compilation, and if automake can write portable makefiles with gcc dependencies generated during compilation, then I see no reason why m4 can't be hooked up to do the same. -- Eric Blake [email protected] +1-801-349-2682 Libvirt virtualization library http://libvirt.org