Welcome to Linux Knowledge Base and Tutorial
"The place where you learn linux"

 Create an AccountHome | Submit News | Your Account  

Tutorial Menu
Linux Tutorial Home
Table of Contents

· Introduction to Operating Systems
· Linux Basics
· Working with the System
· Shells and Utilities
· Editing Files
· Basic Administration
· The Operating System
· The X Windowing System
· The Computer Itself
· Networking
· System Monitoring
· Solving Problems
· Security
· Installing and Upgrading
· Linux and Windows

Man Pages
Linux Topics
Test Your Knowledge

Site Menu
Site Map
Copyright Info
Terms of Use
Privacy Info
Masthead / Impressum
Your Account

Private Messages

News Archive
Submit News
User Articles
Web Links


The Web

Who's Online
There are currently, 60 guest(s) and 0 member(s) that are online.

You are an Anonymous user. You can register for free by clicking here




       make [ -f makefile ] [ option ] ...  target ...


       This  man  page  is an extract of the documentation of GNU
       make .  It is updated only occasionally, because  the  GNU
       project  does  not use nroff.  For complete, current docu­
       mentation, refer to the Info file make.info which is  made
       from the Texinfo source file make.texinfo.


       The  purpose of the make utility is to determine automati­
       cally which pieces of a large program need  to  be  recom­
       piled, and issue the commands to recompile them.  The man­
       ual describes the GNU implementation of  make,  which  was
       written by Richard Stallman and Roland McGrath.  Our exam­
       ples show C programs, since they are most common, but  you
       can  use make with any programming language whose compiler
       can be run with a shell command.  In  fact,  make  is  not
       limited  to programs.  You can use it to describe any task
       where some files must be updated automatically from others
       whenever the others change.

       To  prepare  to use make, you must write a file called the
       makefile that describes the relationships among  files  in
       your  program,  and  the  states the commands for updating
       each file.  In a program, typically the executable file is
       updated  from object files, which are in turn made by com­
       piling source files.

       Once a suitable makefile exists, each time you change some
       source files, this simple shell command:


       suffices  to  perform  all  necessary recompilations.  The
       make program uses the makefile data base and the last-mod­
       ification  times of the files to decide which of the files
       need to be updated.  For each of those  files,  it  issues
       the commands recorded in the data base.

       make  executes  commands  in the makefile to update one or
       more target names, where name is typically a program.   If
       no  -f option is present, make will look for the makefiles
       GNUmakefile, makefile, and Makefile, in that order.

       Normally you should call your makefile either makefile  or
       Makefile.   (We  recommend  Makefile  because  it  appears
       prominently near the beginning  of  a  directory  listing,
       right  near  other  important  files such as README.)  The
       first name checked, GNUmakefile, is  not  recommended  for
       most  makefiles.   You  should use this name if you have a
       -C dir
            Change  to directory dir before reading the makefiles
            or doing anything else.  If multiple -C  options  are
            specified, each is interpreted relative to the previ­
            ous one: -C / -C etc is equivalent to -C /etc.   This
            is typically used with recursive invocations of make.

       -d   Print debugging information  in  addition  to  normal
            processing.   The  debugging  information  says which
            files are being considered for remaking, which  file-
            times are being compared and with what results, which
            files actually need  to  be  remade,  which  implicit
            rules  are  considered and which are applied---every­
            thing interesting about how make decides what to  do.

       -e   Give  variables taken from the environment precedence
            over variables from makefiles.

       -f file
            Use file as a makefile.

       -i   Ignore all errors  in  commands  executed  to  remake

       -I dir
            Specifies  a  directory  dir  to  search for included
            makefiles.  If several -I options are used to specify
            several  directories, the directories are searched in
            the order specified.  Unlike the arguments  to  other
            flags  of  make,  directories given with -I flags may
            come directly after the flag: -Idir  is  allowed,  as
            well  as -I dir.  This syntax is allowed for compati­
            bility with the C preprocessor's -I flag.

       -j jobs
            Specifies the number of jobs (commands) to run simul­
            taneously.   If there is more than one -j option, the
            last one is effective.  If the  -j  option  is  given
            without  an  argument, make will not limit the number
            of jobs that can run simultaneously.

       -k   Continue as much as possible after an  error.   While
            the  target that failed, and those that depend on it,
            cannot be remade, the  other  dependencies  of  these
            targets can be processed all the same.


       -l load
            Specifies  that  no  new  jobs  (commands)  should be
            started if there are others jobs running and the load
            average  is  at least load (a floating-point number).
            the  version  information given by the -v switch (see
            below).  To print the data  base  without  trying  to
            remake any files, use make -p -f/dev/null.

       -q   ``Question mode''.  Do not run any commands, or print
            anything; just return an exit status that is zero  if
            the specified targets are already up to date, nonzero

       -r   Eliminate use of the built-in implicit  rules.   Also
            clear  out  the  default  list of suffixes for suffix

       -s   Silent operation; do not print the commands  as  they
            are executed.

       -S   Cancel  the  effect  of the -k option.  This is never
            necessary except in a recursive make where  -k  might
            be inherited from the top-level make via MAKEFLAGS or
            if you set -k in MAKEFLAGS in your environment.

       -t   Touch files (mark them  up  to  date  without  really
            changing  them)  instead  of  running their commands.
            This is used to pretend that the commands were  done,
            in order to fool future invocations of make.

       -v   Print  the  version  of the make program plus a copy­
            right, a list of authors and a notice that  there  is
            no warranty.

       -w   Print  a  message  containing  the  working directory
            before and after other processing.  This may be  use­
            ful  for  tracking down errors from complicated nests
            of recursive make commands.

       -W file
            Pretend that the target file has just been  modified.
            When used with the -n flag, this shows you what would
            happen if you were to modify that file.  Without  -n,
            it  is  almost the same as running a touch command on
            the given file before running make, except  that  the
            modification  time is changed only in the imagination
            of make.


       The GNU Make Manual


       See the chapter `Problems and Bugs' in The GNU Make Manual


Show your Support for the Linux Tutorial

Purchase one of the products from our new online shop. For each product you purchase, the Linux Tutorial gets a portion of the proceeds to help keep us going.



Security Code
Security Code
Type Security Code

Don't have an account yet? You can create one. As a registered user you have some advantages like theme manager, comments configuration and post comments with your name.

Help if you can!

Amazon Wish List

Did You Know?
You can choose larger fonts by selecting a different themes.


Tell a Friend About Us

Bookmark and Share

Web site powered by PHP-Nuke

Is this information useful? At the very least you can help by spreading the word to your favorite newsgroups, mailing lists and forums.
All logos and trademarks in this site are property of their respective owner. The comments are property of their posters. Articles are the property of their respective owners. Unless otherwise stated in the body of the article, article content (C) 1994-2013 by James Mohr. All rights reserved. The stylized page/paper, as well as the terms "The Linux Tutorial", "The Linux Server Tutorial", "The Linux Knowledge Base and Tutorial" and "The place where you learn Linux" are service marks of James Mohr. All rights reserved.
The Linux Knowledge Base and Tutorial may contain links to sites on the Internet, which are owned and operated by third parties. The Linux Tutorial is not responsible for the content of any such third-party site. By viewing/utilizing this web site, you have agreed to our disclaimer, terms of use and privacy policy. Use of automated download software ("harvesters") such as wget, httrack, etc. causes the site to quickly exceed its bandwidth limitation and are therefore expressly prohibited. For more details on this, take a look here

PHP-Nuke Copyright © 2004 by Francisco Burzi. This is free software, and you may redistribute it under the GPL. PHP-Nuke comes with absolutely no warranty, for details, see the license.
Page Generation: 0.34 Seconds