ifndef erros in makefile

 
Thread Tools Search this Thread
Operating Systems OS X (Apple) 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
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. UNIX and Linux Applications

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... (1 Reply)
Discussion started by: firetree
1 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
mkmf(1) 						      General Commands Manual							   mkmf(1)

NAME
mkmf - make a makefile SYNOPSIS
makefile] template] language] [macroname=value ...] DESCRIPTION
The command creates a makefile that informs the command how to construct and maintain programs and libraries (see make(1)). After gather- ing up all source code file names in the current working directory and inserting them into the makefile, scans source code files for included files and generates dependency information that is appended to the makefile. Source code files are identified by their file name suffixes. recognizes the following suffixes: C C++ FORTRAN Include files Pascal include files Lex or Lisp Object files Pascal Ratfor Assembler Yacc The command checks for an existing makefile before creating one. If no option is present, tries the makefiles and respectively. After the makefile has been created, arbitrary changes can be made using a text editor. can also be used to re-edit the macro definitions in the makefile, regardless of changes that may have been made since it was created. By default, creates a program makefile. To create a makefile that handles libraries, the option must be used. Make Requests Given a makefile created by recognizes the following requests: Compile and load a program or library. Remove all object and core files. Remove all files that can be regenerated. Update included file dependencies in a makefile. List the names of the source code files on standard output. Extract all object files from the library and place them in the same directory as the source code files. The library is not altered. Print an index of functions on standard output. Compile and load the program or library and move it to its destination directory. Print source code files on standard output. Create a tags file for the editor (see ex(1) and ctags(1)), for C, Pascal, and Fortran source code files. Recompile only if there are source code files that are newer than the program or library, link and install the program or library. Several requests can be given simultaneously. For example, to (1) compile and link a program, (2) move the program to its destination directory, and (3) remove any unnecessary object files, use: Macro Definitions understands the following macro definitions: C compiler flags. After searching for included files in the directory currently being processed, searches in directories named in com- piler options and then in the directory. Location of If the macro or environment variable is defined, searches for included files in instead of C++ compiler flags. After searching for included files in the directory currently being processed, searches in directories named in com- piler options and then in the directory, followed by the directory. Directory where the program or library is to be installed. List of included files external to the current directory. automatically updates this macro definition in the makefile if dependency information is being generated. Fortran compiler flags. After searching for included files in the directory currently being processed, searches in directories named in com- piler options, then in the directory. List of included files in the current directory. automatically updates this macro definition in the makefile. Installation program name. Link editor name. Link editor flags. Library name. This macro also implies the option. List of libraries needed by the link editor to resolve external references. Makefile name. List of object files. automatically updates this macro definition in the makefile. Program name. List of source code files. automatically updates this macro definition in the makefile. List of additional file name suffixes for to know about. List of included files found in the directory hierarchy. automatically updates this macro definition in the makefile if dependency information is being generated. If is omitted from the makefile, does not generate dependencies. Both these and any other macro definitions already within the makefile can be replaced by definitions on the command line in the form For example, to change the C compiler flags and the program name, type the following line: Note that macro definitions such as with blanks in them must be enclosed in double quote (") marks. Environment The environment is read by All variables are assumed to be macro definitions with the exception of and Environment variables are processed after command line macro definitions and the macro definitions in a makefile. The option forces the environment to override the macro def- initions in a makefile. File Name Suffixes can recognize additional file name suffixes, or ignore ones that it already recognizes, by specifying suffix descriptions in the macro def- inition. Each suffix description takes the form where t is a character indicating the contents of the file = source file, = object file, = header file, = executable file) and I is an optional character indicating the include syntax for header files = C syntax, = C syntax plus the addition of as a standard search directory, = Fortran and Ratfor syntax, = Pascal syntax). The following list shows the default con- figuration for C C++ Fortran Include files Pascal include files Lex or Lisp Object files Pascal Ratfor Assembler Yacc For example, to change the object file suffix to undefine the Pascal include file suffix, and prevent Fortran files from being scanned for included files, the macro definition could be: Include Statement Syntax The syntax of include statements for C, C++, Fortran, and Pascal source code are of the form: C/C++: where must be the first character in the line. Fortran: where must be the first character in the line. Alternatively, the can be omitted if the include statement starts in column 7. In either case the trailing can be omitted. Pascal: where must be the first character in the line and the trailing is optional. User-defined Templates If cannot find a makefile within the current directory, it normally uses one of the standard makefile templates, or in unless the user has alternative or template files in a directory where is the absolute path name of the directory assigned to the environment variable. Options recognizes the following options: Include source files beginning with a in the makefile. Suppress `` makefile message. Turn off scanning of source code for files. Old dependency information is left untouched in the makefile. Environment variables override macro definitions within makefiles. Specify an alternative makefile file name. The default file name is Prompt the user for the name of the program or library and the directory where it is to be installed. If a carriage-return is typed in response to each of these queries, assumes that the default program name is or the default library name is and the destination directory is the current directory. Force the makefile to be a library makefile. Specify an alternative makefile template path name. The path name can be relative or absolute. Specify an alternative language-specific makefile template. The default language is C and the corresponding program and library makefile templates are and respectively. looks for these templates in or DIAGNOSTICS
Exit status 0 is normal. Exit status 1 indicates an error. WARNINGS
The name of the makefile is included as a macro definition within the makefile and must be changed if the makefile is renamed. Since executable files are dependent on libraries, standard library abbreviations must be expanded to full path names within the macro def- inition in the makefile. Generated dependency information appears after a line in the makefile beginning with This line must not be removed, nor must any other information be inserted in the makefile below this line. The name of a program or library must not conflict with any predefined target names in a makefile. It is especially important to avoid the the name to prevent from recursively executing itself an infinite number of times. AUTHOR
was developed by the University of California, Berkeley. FILES
Standard program makefile template Standard library makefile template User-defined program makefile template User-defined library makefile template SEE ALSO
ar(1), ctags(1), ld(1), make(1). "Automatic Generation of Make Dependencies", Walden, K., vol. 14, no. 6, pp. 575-585, June 1984. mkmf(1)