[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Reusing the result of a shell command
From: |
Paul D. Smith |
Subject: |
Re: Reusing the result of a shell command |
Date: |
Tue, 29 Jul 2003 15:24:45 -0400 |
%% Sébastien Hinderer <address@hidden> writes:
sh> I would like to know if it is possible to store the result of a
sh> shell command into a make variable (locally in a rule), or, let's
sh> say, is it a way to use the result of a shell command more than
sh> once. Keeping the result of the command in a shell variable
sh> wouldn't help much, since I'd like to be able to perform text
sh> operations make makes easy, such as substitution.
MAKEVAR := $(shell some command)
This isn't local to a rule, though, it's global to the makefile. If you
want to do it in a rule, you should just use the shell and not make.
It's not much harder to use sed or whatever to translate the results
than it is to use make functions.
--
-------------------------------------------------------------------------------
Paul D. Smith <address@hidden> Find some GNU make tips at:
http://www.gnu.org http://make.paulandlesley.org
"Please remain calm...I may be mad, but I am a professional." --Mad Scientist