bsd make: intermediate target? (BSD equivalent of GNU's .INTERMEDIATE)

Aleksandr Miroslav alexmiroslav at gmail.com
Sat May 22 01:32:38 UTC 2021


I'm looking for the FreeBSD make equivalent of the following GNU Makefile:


all: foo

foo: bar
        cp bar foo
        rm -f bar

bar:
        echo foo > bar

.INTERMEDIATE: bar

Without that ".INTERMEDIATE: bar" line, GNU make would
recreate bar every single time. With it, once foo is created, it is left
alone, even if bar is deleted.

Is there a way to do such a thing with FreeBSD make? The only way I can
think of is to put it all under one target foo.


More information about the freebsd-questions mailing list