The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
Google UNIX.COM


Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
read arguments from shell DNAx86 High Level Programming 1 05-11-2008 08:56 AM
Make new arguments for echo command Panteras Shell Programming and Scripting 0 11-29-2007 11:43 AM
read number of arguments in c shell skumar11 Shell Programming and Scripting 1 09-07-2007 01:11 PM
how to make root user read all frankkahle UNIX for Advanced & Expert Users 4 08-30-2007 02:04 PM
get whole command arguments in ps -ef? usfrog HP-UX 17 04-04-2007 09:11 AM

Reply
 
Submit Tools LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 06-12-2008
Registered User
 

Join Date: Dec 2007
Posts: 42
Stumble this Post!
How to read arguments to make command

In the make file

update updateq:
-------------------
----------

i want the makefile to display some messages when user gives "make update", but totally quite wehn user enters "make updateq". Can u tell me how to read these argument in makefile.
$1 doesnt work
Reply With Quote
Forum Sponsor
  #2 (permalink)  
Old 06-12-2008
era era is offline
Herder of Useless Cats
 

Join Date: Mar 2008
Location: /there/is/only/bin/sh
Posts: 3,650
Stumble this Post!
GNU make has $(MAKECMDGOALS) but I don't think that's portable.

Why don't you write two different goals for update and updateq?
Reply With Quote
  #3 (permalink)  
Old 06-12-2008
Registered User
 

Join Date: Dec 2007
Posts: 42
Stumble this Post!
Quote:
Originally Posted by era View Post
GNU make has $(MAKECMDGOALS) but I don't think that's portable.

Why don't you write two different goals for update and updateq?
its because most of the code is same. Just a 2 messages on screen. if i write two goals that will mean duplicating the whole code minus those two statement.

I triesd.. $@ works but then i only need to check the first argument
Reply With Quote
  #4 (permalink)  
Old 06-12-2008
era era is offline
Herder of Useless Cats
 

Join Date: Mar 2008
Location: /there/is/only/bin/sh
Posts: 3,650
Stumble this Post!
So how about running make -s versus running just make? If the verbosity is really the only difference.

As a purely theoretical remark, it's valid to say make update updateq although of course resolving the paradox isn't exactly a critical issue for you I guess.
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 11:48 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008 The CEP Blog All Rights Reserved -Ad Management by RedTyger Visit The Global Fact Book

Content Relevant URLs by vBSEO 3.2.0