make.conf options based on DESTDIR?

Mel Flynn mel.flynn+fbsd.questions at mailing.thruhere.net
Thu May 14 17:53:31 UTC 2009


On Wednesday 13 May 2009 20:16:47 David Wassman wrote:
> I have setup several jails that use a master template similar to the
> advanced jail configuration in the handbook. Currently, I build the master
> jail with several build options turned off using a separate make.conf file
> and setting __MAKE_CONF to it.
>
> I was wondering if there is a way to set /etc/make.conf up so that if
> DESTDIR is set to the master jail location, make would use those options
> but not use them during a standard build process with DESTDIR not defined
> or pointed somewhere else.
>
> I have read through the man pages on make and make.conf, and have tried:
>
> .if DESTDIR=/usr/Jail/master
> WITHOUT_ACPI=YES
> WITHOUT_BOOT=YES
> ...
> .endif

Almost:
# head -3 /etc/make.conf
.if defined(DESTDIR) && (${DESTDIR:M/usr/jails/tpl} != "")
WITH_FOO=yes
.endif

# cat Makefile
all:
        @echo "WITH_FOO=${WITH_FOO}"

# make
WITH_FOO=

# make DESTDIR=/usr/jails/tpl
WITH_FOO=yes

-- 
Mel


More information about the freebsd-questions mailing list