[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Exporting variable to $(shell).
From: |
Sergey Organov |
Subject: |
Exporting variable to $(shell). |
Date: |
Wed, 11 Jan 2017 17:49:24 +0300 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.4 (gnu/linux) |
Hello,
It looks like exporting variables to $(shell) function
doesn't work.
Here is a test to demonstrate the issue:
$ cat Makefile
override MY_VAR := OK
export MY_VAR
var := $(shell echo "Exported to shell in function: [$$MY_VAR]")
all:
@echo "In make: [$(MY_VAR)]"
@echo "Exported to shell in rule: [$$MY_VAR]"
@echo '$(var)'
$ make
In make: [OK]
Exported to shell in rule: [OK]
Exported to shell in function: []
$
Is it bug or feature?
If the latter, where is it documented (failed to find it), and what's
the rationale?
-- Sergey.
- Exporting variable to $(shell).,
Sergey Organov <=