'make clean' seemingly broken with FLAVORS

Jason E. Hale jhale at freebsd.org
Sat Jan 27 21:05:10 UTC 2018


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)


More information about the freebsd-ports mailing list