Re: Keeping intermediate files

2021-05-20 Thread Dmitry Goncharov via Bug reports and discussion for GNU make
On Thu, May 20, 2021 at 4:29 PM Frank Heckenbach
 wrote:

>- just ".SECONDARY:" with no prerequisites which makes all
>  targets secondary (like I want), but also makes all targets
>  immediate, e.g. with this Makefile, if y exists and x doesn't,
>  it will remake x, but not y, which is not what I want:

You also do not want this, because this hurts performance badly.

> Am I missing a way to do it without adverse side-effects?

No. This is the state of affairs.

There is a proposed solution
.NOTINTERMEDIATE:

You can use it like this
.NOTINTERMEDIATE: %.h %.d hello.z
This will cause %.d %.h and hello.z files to not be treated as intermediate.

See https://savannah.gnu.org/bugs/?60297.
If you can build make yourself you can apply the patch attached to
this proposal.

regards, Dmitry



Re: Keeping intermediate files

2021-05-20 Thread Frank Heckenbach
Jeffrey Walton wrote:

> Related, you usually ask the compiler to save the intermediate files.
> For GCC the option is -save-temps. Also see
> https://gcc.gnu.org/onlinedocs/gcc/Overall-Options.html.

Indeed, as far as compiler-intermediates are concerned. I know this
option and it works well.

Here I was referring to other kinds of intermediate files, such as
Bison generated sources, or other kinds of files in multi-step build
processes.



Re: Keeping intermediate files

2021-05-20 Thread Jeffrey Walton
On Thu, May 20, 2021 at 4:29 PM Frank Heckenbach
 wrote:
>
> Is there are way to completely stop GNU make from removing
> intermediate files?

Related, you usually ask the compiler to save the intermediate files.
For GCC the option is -save-temps. Also see
https://gcc.gnu.org/onlinedocs/gcc/Overall-Options.html.

Jeff