ifndef erros in makefile

 
Thread Tools Search this Thread
Special Forums UNIX and Linux Applications ifndef erros in makefile
# 1  
Old 07-02-2009
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  
Old 07-03-2009
Bumping up posts or double posting is not permitted in these forums.

Please read the rules, which you agreed to when you registered, if you have not already done so.

You may receive an infraction for this. If so, don't worry, just try to follow the rules more carefully. The infraction will expire in the near future

Thank You.

The UNIX and Linux Forums.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. SCO

"Unexpected EOF within #IF, #ifdef or #ifndef" error when rebuilding / relinking SCO OpenServer 5

Hi, I am a new Unix Guru with very little experience but have the task of P2Ving an old HP Proliant ML370 G5 server to VMware ESX 4.1 or ESXi 5.5. System seems to boots fine but when trying to remove HP software, configure TCP/IP or a driver, I am receiving: -------- ... (7 Replies)
Discussion started by: dj_Italian
7 Replies

2. UNIX for Dummies Questions & Answers

Help with MakeFile

I'm really confused how to use a makefile. Are you supposed to be make a file from emacs called MakeFile and put code in there to compile? I am trying to create a makefile to compile two .cpp files in my current directory to produce two .o files and then link them... What I did was make a... (1 Reply)
Discussion started by: jzhang172
1 Replies

3. Solaris

zpool status -v erros message

# zpool status -v pool: pool1 state: ONLINE status: One or more devices has experienced an error resulting in data corruption. Applications may be affected. action: Restore the file in question if possible. Otherwise restore the entire pool from backup. see:... (0 Replies)
Discussion started by: beginner
0 Replies

4. Homework & Coursework Questions

Help with Simple Multi-Level Makefile (Extremely New at Makefile)

Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted! 1. The problem statement, all variables and given/known data: Basically, the prompt is make a makefile with various sub makefiles in their respective subdirectories. All code... (1 Reply)
Discussion started by: Tatl
1 Replies

5. UNIX for Advanced & Expert Users

Makefile executing another Makefile first?

I have 2 libraries in 2 different directories that I build with Makefiles. library B depends on library A. If I modify a .cpp file in library A and run lib B's Makefile can I have B's makefile to automatically rebuild library A? I am now rebuilding A, followed by B... but I'd like B to... (0 Replies)
Discussion started by: wwuster
0 Replies

6. UNIX for Dummies Questions & Answers

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... (2 Replies)
Discussion started by: firetree
2 Replies

7. OS X (Apple)

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!"... (0 Replies)
Discussion started by: firetree
0 Replies

8. UNIX for Advanced & Expert Users

Makefile problem - How to run module load in a Makefile

Hi, I'm trying to run the module load command in a Makefile and i'm getting the following error: make: module: command not found Why is this? Is there any way to run this command in a Makefile? NOTE: command - module load msjava/sunjdk/1.5.0 works fine outside of the Makefile (2 Replies)
Discussion started by: hernandinho
2 Replies

9. Programming

about the makefile

can anyone well explain how to create a makefile? especially those commands in the makefile? BTW, what is CFLAG? (2 Replies)
Discussion started by: ligerdave
2 Replies

10. UNIX for Dummies Questions & Answers

checking for erros

I have he following command and I will like o test for errors. Due that the command has several command how do I know what one fail. zcat $user | (cd /data/oracle00/faasat1/;tar -xvf -) (1 Reply)
Discussion started by: chinog
1 Replies
Login or Register to Ask a Question