Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Makefile: setting variables to output of commands

Status
Not open for further replies.

tCarls

Programmer
Dec 26, 2006
13
US
I'm trying to run a command that is dependent on all files within a directory. I could do something like this:

Code:
test : dir/* dir/dir2/* dir/dir3/* ... etc
   run command

But it would be much easier if I could do this (it doesn't work):

Code:
files = `find dir/`
test : $(files)
   run command

Is there a way to set a variable in a Makefile to the output of a shell command?

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top