Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 21 May 2021 18:32:25 -0700
From:      Aleksandr Miroslav <alexmiroslav@gmail.com>
To:        freebsd-questions@freebsd.org
Subject:   bsd make: intermediate target? (BSD equivalent of GNU's .INTERMEDIATE)
Message-ID:  <CACcSE1yNEr%2B%2B4feiy9hiBXJvT=4b-cLxvNvz2i1EqzUR_DDebA@mail.gmail.com>

next in thread | raw e-mail | index | archive | help
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.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CACcSE1yNEr%2B%2B4feiy9hiBXJvT=4b-cLxvNvz2i1EqzUR_DDebA>