External Build Tool explicit directory not passed by IDE

I have an external build target. It's a Make-based target, very simple:


all: foo.txt


foo.txt:

echo $(PWD) > foo.txt


The directory containing the Makefile is selected as the contents of the Directory field in the External Build Tool Configuration panel of the target's Info tab, and "Pass build settings in environment" is also checked.


If the Xcode project containing this as its sole target is build with the IDE, a blank foo.txt file appears.


If built from the command line with xcodebuild, a foo.txt file with the directory selected in the Directory field, as noted above, appears.


I recently upgraded to Xcode11.0 (11A420a) from the last available Xcode 10 version. I was using the latter when I used to compile real projects that depended on the setting of $(PWD) when the Makefile runs.


-=-=-=-


I can change the 'Arguments' field of the target to $(ACTION) FALLBACK_PWD=$(SRCROOT)/test_dir and change the Makefile to add three lines at the top:


ifeq ($(PWD),)

PWD=$(FALLBACK_PWD)

endif


all: foo.txt


foo.txt:

echo $(PWD) > foo.txt


but this is grotesque. Have others seen this issue as well?


And could this be related to https://forums.developer.apple.com/thread/124104 perhaps?