help-make
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

HELP! Can I construct individial shell commands using a function


From: chenjun
Subject: HELP! Can I construct individial shell commands using a function
Date: Sun, 27 Feb 2011 08:39:40 +0800
User-agent: RoundCube Webmail/0.3.1

Using make 3.82 

Check the following makefile please, 

========
define _ExecuteShcmdArray
        @$(foreach c,$1,$($c);) # Not what I desire, how can I???
endef

shellcmd1 = cd .. ; pwd
shellcmd2 = cd .. ; pwd

all:
        $(call _ExecuteShcmdArray,shellcmd1 shellcmd2)
========

It outputs somthing like

=========
G:/w/makingsys/GMU-addons
G:/w/makingsys
=========

But what I disire is
=========
G:/w/makingsys/GMU-addons
G:/w/makingsys/GMU-addons
=========

To clarify, the question is, I want to write a function called
_ExecuteShcmdArray, and it can execute variable number of shell commands
according to parameter($1) given. In that above example, I hope shellcmd1
and shellcmd2 can be executed in different shell process, but how to write
_ExecuteShcmdArray function to accomplish that goal?

Can $(eval ) help this?

Thank you in advance.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]