Download your favorite Linux distribution at LQ ISO.
Go Back > Forums > Linux Forums > Linux - Software
User Name
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.


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

Rep: Reputation: 30
Shell commands in GNU make?


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)?




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 03:32 PM
make c-program that accepts shell commands and execute them boeroe Programming 4 02-18-2005 09:41 AM
'make' & 'make install commands not recognised by shell gilbertt Linux - Software 4 05-04-2004 09:04 AM
'make' and 'make install' commands dont work on my system? ginda Linux - Newbie 9 04-18-2004 12:17 PM
Shell commands in GNU make MadCactus Programming 2 02-19-2004 05:36 AM > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 08:27 AM.

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