tech-pkg archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Makefile PATH modification with -current 'make'?

>The problem with -current 'make' only showed up when I tried to build
>"/usr/pkgsrc/wip/moto4lin".  Prior to that, I built all packages in my
>usual complement without incident (modulo pkg/51266).

So the problem is _PATH_CMD in
which is apparently used rarely - according to the comment.

And your failing makefile uses it with :=
so will have been broken since

revision 1.201
date: 2016-01-08 16:55:17 -0800;  author: christos;  state: Exp;  lines:
+35 -27;  commitid: VJA69WRfu8Jb0cQy;
Preserve $$ in := assignments..


        echo ${FOO}
	echo ${BAR}
I added the .MAKE.SAVE_DOLLARS knob to be able to retain the previous
behavior which many makefiles depend on - especialy some really
important ones (to me and $work) like my

revision 1.205
date: 2016-02-19 17:19:03 -0800;  author: sjg;  state: Exp;  lines: +19
-5;  commitid: Y7B9A8fKvRsLMAVy;
Add a knob .MAKE.SAVE_DOLLARS to control the behavior of $$ during :=

If TRUE '$$' are not consumed (saved).
If FALSE '$$' becomes '$' just like normal expansion rules.

default is TRUE.

Here's a little test makefile to demo:

ECHO= echo
PREPEND_PATH= ${HOME}/some/where

# This is very Special.  Because PREPEND_PATH is set with += in reverse order,
# this command reverses the order again (since bootstrap bmake doesn't
# yet support the :[-1..1] construct).
	path=${_PATH_ORIG:Q};						\
	for i in ${PREPEND_PATH}; do path="$$i:$$path"; done;		\
	${ECHO} "$$path"
PATH=	${_PATH_CMD:sh} # DOES NOT use :=, to defer evaluation

# FAIL will work or not depending on .MAKE.SAVE_DOLLARS
# default true - it fails, if false (traditional behavor) it works

	@echo OK=${OK}
	@echo FAIL=${FAIL}


$ PATH=/bin:/usr/bin make -r -f that
$ PATH=/bin:/usr/bin make -r -f that .MAKE.SAVE_DOLLARS=no

Options are to

a/ avoid :=


Home | Main Index | Thread Index | Old Index