'make clean' seemingly broken with FLAVORS

Mathieu Arnold mat at FreeBSD.org
Mon Jan 29 12:31:52 UTC 2018


On Sat, Jan 27, 2018 at 04:05:08PM -0500, Jason E. Hale wrote:
> Just looking for some insight here as I was working on FLAVOR-ifying a
> port and have run into a problem with the PHB information and the
> behavior of 'make clean'.
> 
> According to PHB 7.2 at the top it recommends:
> 
> Tip:
> It can help simplify the logic of the Makefile to also define FLAVOR as:
> FLAVOR?= ${FLAVORS:[1]}
> 
> I have found setting this to be problematic when it comes to running
> 'make clean'. If a non-default flavor has been built, the work
> directory of the non-default flavor is left behind after running the
> clean target. I think the expected behavior of the clean target is to
> clean everything.
> 
> The reason given for setting FLAVOR?= ${FLAVORS:[1]} in an individual
> port Makefile is to simplify the logic, i.e. using:
> 
> .if ${FLAVOR} == x11
> instead of:
> .if ${FLAVOR:U} == x11

No, instead of:

.if ${FLAVOR:U${FLAVORS:[1]}} == x11

> However, leaving FLAVOR empty in the port Makefile allows for the
> simpler logic and allows the clean target to work as expected:
> 
> FLAVOR?= #empty
> 
> It seems silly to have to set an empty variable, but without it, the
> only way I could achieve the desired behavior of 'make clean' was to
> either keep the :U modifier or put the FLAVOR logic after
> <bsd.port.options.mk>.

Mmmm, maybe make clean with the default flavor could clean all flavors.

-- 
Mathieu Arnold
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 949 bytes
Desc: not available
URL: <http://lists.freebsd.org/pipermail/freebsd-ports/attachments/20180129/c87c2535/attachment.sig>


More information about the freebsd-ports mailing list