Menu

#3 Inclusion of GMD breaks valid makefile

v1.0_(example)
closed
nobody
None
5
2014-08-02
2014-03-26
No

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.

1 Attachments

Discussion

  • John Graham-Cumming

    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.

     
  • John Graham-Cumming

    Fixed in 1 0 3.

     
  • John Graham-Cumming

    • status: open --> closed
     

Log in to post a comment.

MongoDB Logo MongoDB