Have you tried the export directive yourself (assuming you are using GNU Make)?
export PATH := bin:$(PATH) test all: x
Also, in your example there is an error:
test all: PATH=bin:${PATH} @echo $(PATH) x
First, the value echo ed is an extension of the PATH variable executed by Make, not the shell. If it prints the expected value, then I think you set the PATH variable somewhere earlier in the Makefile or in the shell that Make calls. To prevent this behavior, you should avoid the dollar:
test all: PATH=bin:$$PATH @echo $$PATH x
Secondly, in any case, this will not work, because Make executes each line of the recipe in a separate shell . This can be changed by writing the recipe in one line:
test all: export PATH=bin:$$PATH; echo $$PATH; x
Eldar Abusalimov Jan 20 '12 at 13:35 2012-01-20 13:35
source share