Creating a new port, overriding a Makefile variable

Chris Rees utisoft at gmail.com
Tue Mar 8 17:27:37 UTC 2011


On 8 March 2011 17:11, Chris Rees <utisoft at gmail.com> wrote:
>
> On 8 Mar 2011 17:04, "David Demelier" <demelier.david at gmail.com> wrote:
>>
>> Hello,
>>
>> I'm writing a port for a game, I setup a MANPREFIX= /share/man for almost
>> all the systems to install in the correct place.
>>
>> In the port Makefile I've tried to use MAKE_ENV= MANPREFIX=/man to
>> override it, but it seems it's ignored.
>>
>> Can I solve this without creating a files/patch-Makefile?
>>
>> Cheers,
>>
>> --
>> David Demelier
>>
>
> If It's hard set in the Makefile, I'd use REINPLACE_CMD.
>
> Chris
>

or

MAKE_ARGS= -EMANPREFIX
MAKE_ENV= MANPREFIX=/man

I tested this with:

[crees at zeus]~% cat Makefile
HELLO=  "hello, world"
all:
        @echo ${HELLO}
[crees at zeus]~% make
hello, world
[crees at zeus]~% env HELLO=hello make
hello, world
[crees at zeus]~% env HELLO=hello make -EHELLO
hello
[crees at zeus]~%

Try it out!

Though I still think the usual response is to use REINPLACE_CMD on the Makefile.

Chris

NB gmake doesn't have the -E flag, but the -e flag sets environment
precedence on all variables. Sounds risky!


More information about the freebsd-ports mailing list