Inclusion of GMD breaks valid makefile
Brought to you by:
jgrahamc
This makefile breaks once you uncomment "include gmd/gmd" line:
SHELL := bash
include gmsl/gmsl
#include gmd/gmd
include config.mk
define F
$(info Inside $(SHELL))$(shell grep VARIABLE config.mk)
endef
$(info Outside $(SHELL))
$(info $(call F,VARIABLE))
$(if $(call F,VARIABLE),$(info Ok),$(error Error))
all:
echo all
Breakage is that it starts to try to use "valuebash" as command for shell instead of "bash". "value" is value of variable "VARIABLE" defined in config.mk:
➜ build make
Outside bash
Inside valuebash
make: valuebash: Command not found
Inside valuebash
make: valuebash: Command not found
Makefile:13: *** Error. Stop.
W/o inclusion of GMD it works well:
➜ build make
Outside bash
Inside bash
VARIABLE = value
Inside bash
Ok
echo all
all
The problem is somehow related to __BP_NEW_SHELL, but I wasn't able to properly investigate.
See attached archive for full example. I'm using GNU Make 3.81 on x86_64 Ubuntu 12.10.
Confirmed that this is a bug.
It occurs because SHELL is defined as $(call __BP_NEW_SHELL,$1) and was assuming that it controlled when $1 was set. Because you $(call) something that then used $(SHELL) $1 has been set and the error occurs. Fixing.
Fixed in 1 0 3.