Creating a new port, overriding a Makefile variable

2011-03-08 Thread David Demelier

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
___
freebsd-ports@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-ports
To unsubscribe, send any mail to freebsd-ports-unsubscr...@freebsd.org


Re: Creating a new port, overriding a Makefile variable

2011-03-08 Thread Chris Rees
On 8 March 2011 17:11, Chris Rees utis...@gmail.com wrote:

 On 8 Mar 2011 17:04, David Demelier demelier.da...@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@zeus]~% cat Makefile
HELLO=  hello, world
all:
@echo ${HELLO}
[crees@zeus]~% make
hello, world
[crees@zeus]~% env HELLO=hello make
hello, world
[crees@zeus]~% env HELLO=hello make -EHELLO
hello
[crees@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!
___
freebsd-ports@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-ports
To unsubscribe, send any mail to freebsd-ports-unsubscr...@freebsd.org


Re: Creating a new port, overriding a Makefile variable

2011-03-08 Thread Christian Weisgerber
Chris Rees utis...@gmail.com wrote:

  In the port Makefile I've tried to use MAKE_ENV= MANPREFIX=/man to
  override it, but it seems it's ignored.
 
 MAKE_ARGS= -EMANPREFIX
 MAKE_ENV= MANPREFIX=/man
 
 NB gmake doesn't have the -E flag, but the -e flag sets environment
 precedence on all variables. Sounds risky!

Just use

MAKE_ARGS= MANPREFIX=/man

Variables set on the command line override Makefile settings.
(So says POSIX.)

-- 
Christian naddy Weisgerber  na...@mips.inka.de

___
freebsd-ports@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-ports
To unsubscribe, send any mail to freebsd-ports-unsubscr...@freebsd.org