Re: Help needed for writing a rule

Paul Smith <[email protected]>
Newsgroups gmane.comp.gnu.make.general
Organization GNU's Not UNIX!
Message-ID <[email protected]>
On Fri, 2022-11-25 at 17:12 +0100, Patrick Begou wrote:
> Of course this works because I am building a ".depends" file with all
> dependencies dynamically too for my application. In the provided 
> Makefile example, dependencies are added at the end of the makefile.

Oh, you didn't say this.

This is basically the same as my final note:

> you'll just have to create explicit rules for all your targets.

except instead of you doing it you're relying on your compiler to do
it, which is fine.

> May be this could have side effects I do not see

Make always parses all the makefiles and included makefiles first,
before it starts to build anything.  During parsing all the
prerequisites are gathered together, so this:

   foo: bar baz ; echo hi

is identical to this:

   foo: ; echo hi
   foo: bar
   foo: baz

Once the makefiles are parsed there's no way to know which of these was
actually seen.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.