LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
Search this Thread
Old 02-17-2004, 03:11 PM   #1
MadCactus
Member
 
Registered: Jul 2003
Distribution: Slackware 9.1
Posts: 195

Rep: Reputation: 30
Shell commands in GNU make?


Hi,

Was wondering, how can you put say a for loop into a makefile so it works?

Something like:

sub: $(HEADERS)
for dir in $(SUBDIRS) do cd $dir && make

I've seen $() used to contain shell commands e.g. $(shell pwd), and other times without "shell". The GNU make manual seems to suggest that its valid just to write the command without the $()...

Also i'm not sure about using shell variables - if I write a for loop like above - is it valid to refer to $dir, or should I write $(dir)?

Cheers,

M
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
what is GNU and what are the commands? anjum Linux - Software 9 08-03-2005 02:32 PM
make c-program that accepts shell commands and execute them boeroe Programming 4 02-18-2005 08:41 AM
'make' & 'make install commands not recognised by shell gilbertt Linux - Software 4 05-04-2004 08:04 AM
'make' and 'make install' commands dont work on my system? ginda Linux - Newbie 9 04-18-2004 11:17 AM
Shell commands in GNU make MadCactus Programming 2 02-19-2004 04:36 AM


All times are GMT -5. The time now is 05:12 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration