mingw make vs shell vs pwd -W

Started by Andrew Dunstanabout 15 years ago1 messages
#1Andrew Dunstan
andrew@dunslane.net

On my new Mingw setup, the following makefile fails:

foo := $(shell pwd -W)
all:
@echo foo: $(foo)

with output looking like:

pwd: invalid option -- W
Try `pwd --help' for more information.
foo:

while the following works:

foo := $(shell sh -c "pwd -W")
all:
@echo foo: $(foo)

and produces as expected:

foo: C:/Mingw/msys/1.0/home/andrew

My working theory is that this is because "pwd -W" is a shell builtin
and the current version of mingw make is not invoking "sh" with $(shell).

I thought might have screwed up my setup, but the same results occurred
on a different machine with a completely fresh Mingw installation.

This failure is causing a regression failure as can be seen here:
<http://www.pgbuildfarm.org/cgi-bin/show_log.pl?nm=frogmouth&amp;dt=2010-12-17%2018%3A26%3A11&gt;

Luckily, we have got rid of almost all the uses of "pwd -W", and since
vpath builds don't work on Mingw (or at least on mine) I believe the
only one that actually matters at all right now is the one in 8.2's
/src/test/regress/GNUmakefile.

I'm going to fix that one. My inclination is to let these others be,
sort of like a vermiform appendix.

pg_8_2/src/interfaces/ecpg/test/Makefile
pg_8_2/src/pl/plpython/Makefile
pg_8_2/src/pl/tcl/Makefile
pg_8_2/src/pl/plperl/GNUmakefile
pg_8_3/src/interfaces/ecpg/test/Makefile
pg_8_3/src/pl/plpython/Makefile
pg_8_3/src/pl/tcl/Makefile
pg_8_3/src/pl/plperl/GNUmakefile
pg_8_3/src/test/regress/GNUmakefile
pg_8_4/src/interfaces/ecpg/test/Makefile
pg_9_0/src/interfaces/ecpg/test/Makefile
pg_head/src/interfaces/ecpg/test/Makefile

Thoughts?

cheers

andrew