make clean preceding make all

Lawrence Velázquez larryv at macports.org
Sun Oct 12 18:11:47 PDT 2014


On Oct 12, 2014, at 4:53 PM, Rainer Müller <raimue at macports.org> wrote:

> On 2014-10-12 22:16, Mark Brethen wrote:
>> How does one setup a portfile to do a 'make clean' before a 'make all'? I thought of using
>> 
>>    pre-build {        
>>        system -W ${somedir} "${build.cmd} clean"
>>    }
> 
> You can just give make both targets:
> 
> build.target clean all

Note that, as Ryan and I found out in #45274, GNU Make (at least) doesn't sequentially run command-line goals to completion if it's told to operate in parallel. So there's no guarantee that the "clean" target will finish before the "all" target starts.

https://trac.macports.org/ticket/45274

A somewhat uglier (but more reliable) fix would be to patch the makefile to make "clean" a dependency of "all".

vq


More information about the macports-dev mailing list