Sponsored Content
Full Discussion: Using the Make command
Homework and Emergencies Homework & Coursework Questions Using the Make command Post 302564969 by bakunin on Saturday 15th of October 2011 06:20:23 PM
Old 10-15-2011
Maybe a short explanation will get you up to speed faster.

The "make" utility is intended for repetitive tasks (like compiling/linking). It works rule-based. In its input file there is a collection of such rules laid out.

Rules consist of target files, source files and actions. When a source file is changed (=has a time stamp younger than the target file) the action is carried out. Usually carrying out the action creates the target file. The big advantage of using a make-file instead of a script with all the compiler/linker commands is that "make" will skip all the files which are already up to date and only execute the rules necessary to update the files which aren't. It will also stop if one of the commands carried out will return a non-zero error level (compilers do that when encountering severe errors).

You should now be able to understand the manual and work out your little makefile.

I hope this helps.

bakunin
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

make command

Dear Guys , Kindly note that i have sun solaries 8 intel machine . i installed apache and it is working fine . i am installing perl5 , MD5 and CGI . but whenever i execute the commands , make , make test and make install i get error message : not found # make make: not found also i... (2 Replies)
Discussion started by: tamemi
2 Replies

2. UNIX for Dummies Questions & Answers

make command

hi i tried to search for the "make" command but to no avail. this is what happens: when i try to type the "make" command, it prompt me the error " csh:make:not found ***error code 1 make:Fatal error: command fail for target 'all' " i have just freshly install solaris 9 on my server.... (8 Replies)
Discussion started by: legato
8 Replies

3. Solaris

C compiler and make command

Hey Guys.... I installed Solaris 10 (10/08) on _X86 platform, I need install any software of load balance. I find the pen-0.18.0-sol10-x86-local software. I cant finish the install process , i dont find the make command, I think this command is associated to the C compiler process. But... (2 Replies)
Discussion started by: aggadtech08
2 Replies

4. Solaris

make command failure

Hi After downloading and compiling new ntp source for Solaris 10 I used the make command on the ntp directory. I received the following output: bash-3.00# make (bk version) >/dev/null 2>&1 && \ cd . && \ x=`bk -R prs -hr+ -nd:I: ChangeSet` && \ y=`cat version... (2 Replies)
Discussion started by: shaife720
2 Replies

5. UNIX for Advanced & Expert Users

problem with make command

hi guys would u clarify me how to use make command , how to write rules of make command and to execute . (1 Reply)
Discussion started by: chinakampalli p
1 Replies

6. Solaris

make command problem

hi, I'was trying to compile a simple game , just for testing the system, but the make command gave me problems, so I read that it was best to have a gnu make package installed so I made pkgrm SUNWgmake and installed the gnu make from sunfreesoftware, the problem is that now when I run make... (9 Replies)
Discussion started by: freeware
9 Replies

7. Solaris

how to make all of this in one command

dears what i need to make is cp -irp file_name filename tar cvf filename.tar filename gzip filename.tar in one commane using exec it that prossible and how can i do that (4 Replies)
Discussion started by: xxmasrawy
4 Replies

8. Homework & Coursework Questions

Utilizing the Make Command

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: Compile cpp2html.c to produce cpp2html.o. ( Important: the source code in these files is C, not C++, and so... (8 Replies)
Discussion started by: lamentofking
8 Replies

9. Homework & Coursework Questions

Utilizing the Make Command

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: ]Compile cpp2html.c to produce cpp2html.o. ( Important: the source code in these files is C, not C++, and so... (1 Reply)
Discussion started by: bgnaranjo1
1 Replies

10. UNIX for Beginners Questions & Answers

How to make df command?

in RHEL 6.10, how can we make the the df -k return the output without wrapping. And wihout using the df -Pk option. After we patched a Linux server from 6.5 to 6.10: The df -k on RHAT 6.10 it wraps the line for ex: 6.10: /dev/mapper/vgapp01-vendor ... (2 Replies)
Discussion started by: mrn6430
2 Replies
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)
All times are GMT -4. The time now is 03:34 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy