

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). 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. If the -j option is given without an argument, make will not limit the number of jobs that can run simultaneously.Ĭontinue as much as possible after an error. If there is more than one -j option, the last one is effective. Specifies the number of jobs (commands) to run simultaneously. This syntax is allowed for compatibility with the C preprocessor's -I flag. Unlike the arguments to other flags of make, directories given with -I flags may come directly after the flag: -I dir is allowed, as well as -I dir. If several -I options are used to specify several directories, the directories are searched in the order specified. Specifies a directory dir to search for included makefiles. Ignore all errors in commands executed to remake files. Give variables taken from the environment precedence over variables from makefiles. FLAGS may be a for all debugging output (same as using -d), b for basic debugging, v for more verbose basic debugging, i for showing implicit rules, j for details on invocation of commands, and m for debugging while remaking makefiles. If the FLAGS are omitted, then the behavior is the same as if -d was specified. 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 that are applied everything interesting about how make decides what to do.

This is typically used with recursive invocations of make. If multiple -C options are specified, each is interpreted relative to the previous one: -C / -C etc is equivalent to -C /etc. These options are ignored, but included for compatibility with other versions of make.Ĭhange to directory dir before reading the makefiles or doing anything else. Make updates a target if it depends on prerequisite files that have been modified since the target was last modified, or if the target does not exist. If makefile is a dash (" -"), the standard input is read. You should use this name if you have a makefile that is specific to GNU make, and will not be understood by other versions of make. (The officially recommended name is 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.

Normally you should call your makefile either makefile or Makefile. If no -f option is present, make will look for the makefiles GNUmakefile, makefile, and Makefile, in that order. Make executes commands in the makefile to update one or more target names, where name is typically a program. For each of those files, it issues the commands recorded in the database. The make program uses the makefile data base and the last-modification times of the files to decide which of the files need to be updated. Suffices to perform all necessary recompilations. Once a suitable makefile exists, each time you change some source files, this simple shell command: make

In a program, typically the executable file is updated from object files, which are in turn made by compiling source files. 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. You can use it to describe any task where some files must be updated automatically from others whenever the others change. In fact, make is not limited to programs. Many of the examples listed below 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. This documentation describes the GNU implementation of make, which was written by Richard Stallman and Roland McGrath, and is currently maintained by Paul Smith. The purpose of the make utility is to determine automatically which pieces of a large program need to be re- compiled, and issue the commands necessary to recompile them.
