Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 27 Jan 2018 16:05:08 -0500
From:      "Jason E. Hale" <jhale@freebsd.org>
To:        FreeBSD Ports <freebsd-ports@freebsd.org>
Cc:        FreeBSD Ports Management Team <portmgr@freebsd.org>
Subject:   'make clean' seemingly broken with FLAVORS
Message-ID:  <CAJE75NG5PeVShnVCdJ-saA7vPPLwiuz65DufbOfgzqzyQ=WSDQ@mail.gmail.com>

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

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>.

-Jason (jhale)



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAJE75NG5PeVShnVCdJ-saA7vPPLwiuz65DufbOfgzqzyQ=WSDQ>