The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
.
google unix.com



UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
ifndef erros in makefile firetree UNIX and Linux Applications 1 07-03-2009 02:25 AM
ifndef erros in makefile firetree OS X (Apple) 0 07-02-2009 02:59 AM
Makefile problem - How to run module load in a Makefile hernandinho UNIX for Advanced & Expert Users 2 04-13-2009 10:20 AM
about the makefile ligerdave High Level Programming 2 01-31-2006 01:21 AM
checking for erros chinog UNIX for Dummies Questions & Answers 1 10-27-2005 12:56 AM

Reply
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 07-02-2009
firetree firetree is offline
Registered User
  
 

Join Date: Jul 2009
Posts: 4
ifndef erros in makefile

I know if-condition clause is available in makefile.
But when I try to use it inside a macro definition, bugs come out!
Any replies would be apreciated !


code:

define child
echo "child has one parameter: $1"
ifndef $2
echo "but child can also see parent's second parameter: $2!"
else
echo "and child cannot see parent's second parameter !"
endif
endef

erros:

child has one parameter: one
make: ifndef: Command not found
make: *** [scoping_issue] Error 127
  #2 (permalink)  
Old 07-03-2009
otheus's Avatar
otheus otheus is offline Forum Staff  
Moderator ala Mode
  
 

Join Date: Feb 2007
Location: Innsbruck, Austria
Posts: 1,864
if-else clauses in makefiles are dependent on the make program used to process them. Is this GNU make? the fabled dmake? Sun xpg tools?

Also, USE CODE TAGS please. I can't tell from your post whether this is a badly formatted makefile or just vbulletin munging your post's whitespace.
  #3 (permalink)  
Old 07-06-2009
firetree firetree is offline
Registered User
  
 

Join Date: Jul 2009
Posts: 4
3ks for your replies.
I'm using GNU make, under mac os x
here is the whole codes:
Code:
define parent
	echo "parent has two parameters: $1, $2"
	$(call child,$1)
endef

define child
	echo "child has one parameter: $1"
 	ifndef $2
		echo "but child can also see parent's second parameter: $2!"
	else
		echo "and child cannot see parent's second parameter !"
	endif
endef

scoping_issue:
	@$(call parent,one, two)

Last edited by otheus; 07-06-2009 at 01:53 AM.. Reason: add code tags
Sponsored Links
Reply

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -4. The time now is 08:25 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language translation by Google.
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0