make(1S)

NAME
make - maintain, update, and regenerate related programs and files

SYNOPSIS

/usr/bin/make [-C directory] [-a] [-d] [-dd] [-D] [-DD] [-e] [-i]
     [-k] [-n] [-p] [-P] [-q] [-r] [-s] [-S] [-t] [-V]
     [-f makefile]... [-K statefile]... [target]...
     [macro = value...]

/usr/xpg4/bin/make [-C directory] [-a] [-d] [-dd] [-D] [-DD] [-e]
     [-i] [-k] [-n] [-p] [-P] [-q] [-r] [-s] [-S] [-t] [-V]
     [-f makefile]... [target]... [macro = value...]

DESCRIPTION

The make utility executes a list of shell commands associated with each target, typically to create or update a file of the same name. makefile contains entries that describe how to bring a target up to date with respect to those on which it depends, which are called dependencies. Since each dependency is a target, it can have dependencies of its own. Targets, dependencies, and sub-dependencies comprise a tree structure that make traces when deciding whether or not to rebuild a target.

For a description of the parallel make features, check the dmake(1) man page.

The make utility recursively checks each target against its dependencies, beginning with the first target entry in makefile if no target argument is supplied on the command line. If, after processing all of its dependencies, a target file is found either to be missing, or to be older than any of its dependencies, make rebuilds it. Optionally with this version of make, a target can be treated as out-of-date when the commands used to generate it have changed since the last time the target was built.

To build a given target, make executes the list of commands, called a rule. This rule can be listed explicitly in the target's makefile entry, or it can be supplied implicitly by make.

If no target is specified on the command line, make uses the first regular target defined in makefile.

A regular target is a target with a name that does not start with a dot.

If a target has no makefile entry, or if its entry has no rule, make attempts to derive a rule by each of the following methods, in turn, until a suitable rule is found. Each method is described under Usage below.

    o   Pattern matching rules.

    o   Implicit rules, read in from a user-supplied makefile.

    o   Standard implicit rules (also known as suffix rules), typically read in from the file /usr/share/lib/make/make.rules.

    o   SCCS retrieval. make retrieves the most recent version from the SCCS history file (if any). See the description of the .SCCS_GET: special-function target for details.

    o   The rule from the .DEFAULT: target entry, if there is such an entry in the makefile.

If there is no makefile entry for a target, if no rule can be derived for building it, and if no file by that name is present, make issues an error message and halts.

Unless when in SUN_MAKE_COMPAT_MODE or when emulating sysV make, make sets up some Special-Purpose Macros that provide automake properties.

OPTIONS

The following options are supported:

-a  Do not set up architecture specific make macros like MAKE_ARCH, MAKE_OS and similar that are provided as part of the automake features.

-Cdirectory
-C directory
    Changes the current working directory to the directory directory before attempting to open and process the makefiles or run any targets. This option may be specified more than once, each subsequent occurrence of the option is dependent on those that came before it.

    This option is not added to the MAKEFLAGS environment variable and it is not read from that variable even when MAKEFLAGS contains this option.

-d  Displays the reasons why make chooses to rebuild a target. make displays any and all dependencies that are newer. In addition, make displays options read in from the MAKEFLAGS environment variable.

-dd Displays the dependency check and processing in vast detail.

-D  Displays the text of the makefiles read in.

-DD Displays the text of the makefiles, make.rules file, the state file, and all hidden-dependency reports.

-e  Environment variables override assignments within makefiles.

-f makefile
    Uses the description file makefile. A - as the makefile argument denotes the standard input. The contents of makefile, when present, override the standard set of implicit rules and predefined macros. When more than one -f makefile argument pair appears, make uses the concatenation of those files, in order of appearance.

    When no makefile is specified, /usr/bin/make tries the following in sequence, except when in POSIX mode (see .POSIX in Usage):

    o   If there is a file named makefile in the working directory, make uses that file. If, however, there is an SCCS history file (SCCS/s.makefile) which is newer, make attempts to retrieve and use the most recent version.

    o   In the absence of the above file(s), if a file named Makefile is present in the working directory, make attempts to use it. If there is an SCCS history file (SCCS/s.Makefile) that is newer, make attempts to retrieve and use the most recent version.

    When no makefile is specified, /usr/bin/make in POSIX mode and /usr/xpg4/bin/make try the following files in sequence:

    o   ./makefile, ./Makefile

    o   s.makefile, SCCS/s.makefile

    o   s.Makefile, SCCS/s.Makefile

-i  Ignores error codes returned by commands. Equivalent to the special-function target .IGNORE:.

-jmake-max-jobs
-j make-max-jobs
    Specifies the maximum total number of jobs that are run in parallel.

    The environment DMAKE_ADJUST_MAX_JOBS and the command line macro of the same name manage the way make controls the number of jobs. See the chapter ENVIRONMENT for more information.

    This option is not available in case that make has not been compiled with support for parallel make features.

-k  When a nonzero error status is returned by a rule, or when make cannot find a rule, abandons work on the current target, but continues with other dependency branches that do not depend on it.

-K statefile
    Uses the state file statefile. A - as the statefile argument denotes the standard input. The contents of statefile, when present, override the standard set of implicit rules and predefined macros. When more than one -K statefile argument pair appears, make uses the concatenation of those files, in order of appearance. (See also .KEEP_STATE and .KEEP_STATE_FILE in the Special-Function Targets section).

-m {serial | parallel}
    Allows specifying one of the following key words:

    serial
        Causes make to behave like the standard serial version of make.

    parallel
        Causes make to run several jobs in parallel on the make host.

    This option is not available in case that make has not been compiled with support for parallel make features.

-n  No execution mode. Prints commands, but does not execute them. Even lines beginning with an @ are printed. However, if a command line contains a reference to the $(MAKE) macro, that line is always executed (see the discussion of MAKEFLAGS in Reading Makefiles and the Environment). When in POSIX mode, lines beginning with a "+" are executed.

-N  Reverse the effect of the -n (No execution mode) option.

-p  Prints out the complete set of macro definitions and target descriptions.

-P  Merely reports dependencies, rather than building them.

-q  Question mode. make returns a zero or nonzero status code depending on whether or not the target file is up to date. When in POSIX mode, lines beginning with a "+" are executed.

-r  Does not read in the default makefile /usr/share/lib/make/make.rules.

-R  Do not run in parallel mode.

    This option is not available in case that make has not been compiled with support for parallel make features.

-s  Silent mode. Does not print command lines before executing them. Equivalent to the special-function target .SILENT:.

-S  Undoes the effect of the -k option. Stops processing when a non-zero exit status is returned by a command.

-t  Touches the target files (bringing them up to date) rather than performing their rules. Warning: This can be dangerous when files are maintained by more than one person. When the .KEEP_STATE: target appears in the makefile, this option updates the state file just as if the rules had been performed. When in POSIX mode, lines beginning with a "+" are executed.

-T  Print a list of known targets. This includes targets from all explicit and implicit makefiles, e.g. the default makefile mentioned with in the description for the -r option above.

-u  Unconditionally build the target and all its dependencies. This may result in targets being remade more than once since every target is rebuilt every time it appears in a dependency list.

-V  Puts make into SysV mode. Refer to sysV-make(1) for respective details.

-w  Print a message containing the working directory before and after processing targets. This may be useful for tracking down errors from complex nests of recursive make calls.

-x SUN_MAKE_COMPAT_MODE=value
-x DMAKE_OUTPUT_MODE=value
    Allows setting the make compat mode or the output mode. See dmake(1) and ENVIRONMENT for more information.

    This option is not available in case that make has not been compiled with support for parallel make features.

OPERANDS

The following operands are supported:

target
    Target names, as defined in Usage.

macro=value
    Macro definition. This definition overrides any regular definition for the specified macro within the makefile itself, or in the environment. However, this definition can still be overridden by conditional macro assignments.

macro::=value
    Macro definition. The value is expanded before the assignment is done. This variant of a macro definition creates a different macro type that is not expanded on use.

    The ::= operator is only supported if make is either in GNU compatibility mode or in POSIX mode.

macro:::=value
    Macro definition. The value is expanded before the assignment is done.

macro +=value
    Append to a macro definition.

    This operand type is not forwarded to sub-makes via the MAKEFLAGS environment.

    A space is required before += and the whole command line macro definition needs to be quoted.

macro +:=value
    Append to a macro definition. The value is expanded before the assignment is done.

    This operand type is not forwarded to sub-makes via the MAKEFLAGS environment.

    A space is required before +:= and the whole command line macro definition needs to be quoted.

USAGE

The usage of make is described below:

  Reading Makefiles and the Environment

When make first starts, it reads the MAKEFLAGS environment variable to obtain any of the following options specified present in its value: -a, -d, -D, -e, -i, -k, -n, -N, -p, -q, -r, -s, -S, -t, -T, -u, or -w. Due to the implementation of POSIX.2 (see POSIX.2(7), the MAKEFLAGS values contains a leading - character. The make utility then reads the command line for additional options, which also take effect.

Next, make reads in a default makefile that typically contains predefined macro definitions, target entries for implicit rules, and additional rules, such as the rule for retrieving SCCS files. If present, make uses the file make.rules in the current directory; otherwise it reads the file /usr/share/lib/make/make.rules, which contains the standard definitions and rules. Use the directive:

include /usr/share/lib/make/make.rules

in your local make.rules file to include them.

Next, make imports variables from the environment (unless the -e option is in effect), and treats them as defined macros. Because make uses the most recent definition it encounters, a macro definition in the makefile normally overrides an environment variable of the same name. When -e is in effect, however, environment variables are read in after all makefiles have been read. In that case, the environment variables take precedence over definitions in the makefile.

Next, make reads any makefiles you specify with -f, or one of makefile or Makefile as described above and then the state file, in the local directory if it exists. If the makefile contains a .KEEP_STATE_FILE target, then it reads the state file that follows the target. Refer to special target .KEEP_STATE_FILE for details.

Next (after reading the environment if -e is in effect), make reads in any macro definitions supplied as command line arguments. These override macro definitions in the makefile and the environment both, but only for the make command itself.

make exports environment variables, using the most recently defined value. Macro definitions supplied on the command line are not normally exported, unless the macro is also an environment variable.

make does not export macros defined in the makefile. If an environment variable is set, and a macro with the same name is defined on the command line, make exports its value as defined on the command line. Unless -e is in effect, macro definitions within the makefile take precedence over those imported from the environment.

The macros MAKEFLAGS, MAKE, MAKE_NAME, SHELL, HOST_ARCH, HOST_MACH, TARGET_ARCH, and TARGET_MACH are special cases. See Special-Purpose Macros below for details.

  Makefile Target Entries

A target entry has the following format:

       target [target...] :|:: [dependency] ... [; command] ...
                      [command]
                      ...

The first line contains the name of a target, or a space-separated list of target names, terminated with a colon or double colon. If a list of targets is given, this is equivalent to having a separate entry of the same form for each target. The colon(s) can be followed by a dependency, or a dependency list. make checks this list before building the target. The dependency list can be terminated with a semicolon (;), which in turn can be followed by a single Bourne shell command. Subsequent lines in the target entry begin with a TAB and contain Bourne shell commands. These commands comprise the rule for building the target.

Shell commands can be continued across input lines by escaping the NEWLINE with a backslash (\). The continuing line must also start with a TAB.

To rebuild a target, make expands macros, strips off initial TAB characters and either executes the command directly (if it contains no shell metacharacters), or passes each command line to a Bourne shell for execution.

The first non-empty line that does not begin with a TAB or # begins another target or macro definition.

  Special Characters

Special characters are defined below.

  Global

#   Start a comment. The comment ends at the next NEWLINE. If the # follows the TAB in a command line, that line is passed to the shell (which also treats # as the start of a comment).

export macro ...
    If the word export appears as the first six letters of a line and is followed by a SPACE or TAB, the strings that follows are taken as a list of macros that should be exported in the list of environment variables.

    If an environment variable with the same name already exists, it's value is replaced by the current value of the related make macro. An empty list of macro names is not considered an error. If the PATH macro is in the list of parameters, the path search of the current make process is also affected. If the SHELL macro is in the list of parameters, it is ignored and the previous SHELL environment is kept.

    Previous versions of make did not support the export directive. With an empty SUN_MAKE_COMPAT_MODE environment, make does not support this feature.

include filename ...
    If the word include appears as the first seven letters of a line and is followed by a SPACE or TAB, the string that follows is taken as a filename to interpolate at that line. include files can be nested to a depth of no more than 38 nested makefiles. If filename is a macro reference, it is expanded.

    Previous versions of make did only supoport one filename after the include directive, this version supports any number of filenames and macros that expand to more than one name. With an empty SUN_MAKE_COMPAT_MODE environment, make only supports one filename after the include directive.

-include filename ...
    If the word -include appears as the first nine letters of a line and is followed by a SPACE or TAB, the string that follows is taken as a filename to interpolate at that line.

    The -include directive is implemented similar to the include directive, except that a nonexistent file is not considered to be an error.

    Previous versions of make did not support the -include directive. With an empty SUN_MAKE_COMPAT_MODE environment, make does not support this feature.

readonly macro ...
    If the word readonly appears as the first eight letters of a line and is followed by a SPACE or TAB, the strings that follows are taken as a list of macros that should be marked as readonly. This prevents further modification of the content of the related macros. An empty list of macro names is not considered an error.

    Previous versions of make did not support the readonly directive. With an empty SUN_MAKE_COMPAT_MODE environment, make does not support this feature.

unexport macro ...
    If the word unexport appears as the first eight letters of a line and is followed by a SPACE or TAB, the strings that follows are taken as a list of macros that should be removed from the list of environment variables. An empty list of macro names is not considered an error. If the PATH macro is in the list of parameters, the path search of the current make process is also affected. If the SHELL macro is in the list of parameters, it is ignored and the previous SHELL environment is kept.

    Previous versions of make did not support the unexport directive. With an empty SUN_MAKE_COMPAT_MODE environment, make does not support this feature.

  Automake Features

Make implements automake features that help to write highly portable makefile systems. The automake features are implemented with a set of special purpose macros and by special rules that help to extend the functionality and automated adaptivity of make.

Automake special purpose macros
    The special purpose macros that have names that match MAKE_* (see section Special-Purpose Macros) are part of the automake features of make. The related special macros are set up by make to contain values that have been retrieved from the results of the uname(2), sysinfo(2) or sysctl(2) system calls. The values for these macros may however be overwritten from a makefile or from a command line macro definition.

Automake special targets
    The special target .INCLUDE_FAILED allows one to define a rule that is evaluated in case that an include file does not exist and could not be made from other rules. As the associated command for this target is typically a shell script, the shell script can be written to create fall back rules in a platform independent way.

  Targets and Dependencies

:

    Target list terminator. Words following the colon are added to the dependency list for the target or targets. If a target is named in more than one colon-terminated target entry, the dependencies for all its entries are added to form that target's complete dependency list.

::

    Target terminator for alternate dependencies. When used in place of a : the double-colon allows a target to be checked and updated with respect to alternate dependency lists. When the target is out-of-date with respect to dependencies listed in the first alternate, it is built according to the rule for that entry. When out-of-date with respect to dependencies in another alternate, it is built according the rule in that other entry. Implicit rules do not apply to double-colon targets; you must supply a rule for each entry. If no dependencies are specified, the rule is always performed.

target [+ target...] :

    Target group. The rule in the target entry builds all the indicated targets as a group. It is normally performed only once per make run, but is checked for command dependencies every time a target in the group is encountered in the dependency scan.

%

    Pattern matching wild card metacharacter. Like the * shell wild card, % matches any string of zero or more characters in a target name or dependency, in the target portion of a conditional macro definition, or within a pattern replacement macro reference. Notice that only one % can appear in a target, dependency-name, or pattern-replacement macro reference.

./pathname

    make ignores the leading ./ characters from targets with names given as pathnames relative to "dot," the working directory.

  Macros

=
    Macro definition. The word to the left of this character is the macro name; words to the right comprise its value. Leading and trailing white space characters are stripped from the value. A word break following the = is implied.

    Macro references in the text to the right of the assignment operator are not expanded prior to the assignment.

$
    Macro reference. The following character, or the parenthesized or bracketed string, is interpreted as a macro reference: make expands the reference (including the $) by replacing it with the macro's value.

( )
{ }
    Macro-reference name delimiters. A parenthesized or bracketed word appended to a $ is taken as the name of the macro being referred to. Without the delimiters, make recognizes only the first character as the macro name.

$$
    A reference to the dollar-sign macro, the value of which is the character $. Used to pass variable expressions beginning with $ to the shell, to refer to environment variables which are expanded by the shell, or to delay processing of dynamic macros within the dependency list of a target, until that target is actually processed.

\$
    Escaped dollar-sign character. Interpreted as a literal dollar sign within a rule.

+=
    When used in place of =, appends a string to a macro definition (must be surrounded by white space, unlike =).

    Macro references in the text to the right of the append operator are not expanded prior to appending the text.

    Warning: Macros created with the ::= operator will cause the += operator to expand macros on the right side of the operator before doing the actual append operation. To avoid unpredictable behavior, it is recommended to use at least one lower case character in the name of macros that have been created using the ::= operator.

+:=
    When used in place of =, appends a string to a macro definition (must be surrounded by white space, unlike =). The string $$ is not expanded with the +:= operator, it is left unmodified while the right side is expanded.

    Macro references in the text to the right of this append operator are always expanded prior to appending the text.

    With an empty SUN_MAKE_COMPAT_MODE environment, or when in SysV mode, make ignores this operator in order to achieve compatibility to previous versions of the SunPro make program.

?=
    When used in place of =, assigns a string to a macro definition if the macro was not assigned before (must be surrounded by white space, unlike =).

    Macro references in the text to the right of the assignment operator are not expanded prior to the assignment.

    With an empty SUN_MAKE_COMPAT_MODE environment, or when in SysV mode, make ignores this operator in order to achieve compatibility to previous versions of the SunPro make program.

::=
    When used in place of =, assigns a string to a macro definition after first expanding macro references on the right side (must be surrounded by white space, unlike =).

    Macros created with this operator are not expanded on use.

    Note that this is the POSIX variant of the GNU immediate assignment that is portable to make implementations that are compatible to POSIX issue 8.

    The ::= operator is only supported if make is either in GNU compatibility mode or in POSIX mode.

    Warning: This operator may cause unpredictable behavior, since it creates a different type of macro that is not expanded on use and that causes a different behavior with the += operator. In order to avoid the unpredictable behavior, it is recommended to avoid the ::= operator in favor of :::= or to use at least one lower case letter in the names of all macros that have been created with the ::= operator.

    With an empty SUN_MAKE_COMPAT_MODE environment, or when in SysV mode, make ignores this operator in order to achieve compatibility to previous versions of the SunPro make program.

:::=
    When used in place of =, assigns a string to a macro definition after first expanding macro references on the right side (must be surrounded by white space, unlike =). The string $$ is not expanded with the :::= operator, it is left unmodified while the right side is expanded.

    The POSIX operator :::= should be preferred over the operator ::=.

    With an empty SUN_MAKE_COMPAT_MODE environment, or when in SysV mode, make ignores this operator in order to achieve compatibility to previous versions of the SunPro make program.

:=
    Conditional macro assignment. When preceded by a list of targets with explicit target entries, the macro definition that follows takes effect when processing only those targets, and their dependencies.

:sh =
    Define the value of a macro to be the output of a command (see Command Substitutions below).

:shell =
    Define the value of a macro to be the output of a command with make macros in the command line expanded by make before calling the command (see Command Substitutions below).

:sh
    In a macro reference, execute the command stored in the macro, and replace the reference with the output of that command (see Command Substitutions below).

:shell
    In a macro reference, behaves identical to :sh in a macro reference.

  Rules

+
    make always executes the commands preceded by a "+", even when -n is specified.

-
    make ignores any nonzero error code returned by a command line for which the first non-TAB character is a -. This character is not passed to the shell as part of the command line. make normally terminates when a command returns nonzero status, unless the -i or -k options, or the .IGNORE: special-function target is in effect.

@
    If the first non-TAB character is a @, make does not print the command line before executing it. This character is not passed to the shell.

?
    Escape command-dependency checking. Command lines starting with this character are not subject to command dependency checking.

!
    Force command-dependency checking. Command-dependency checking is applied to command lines for which it would otherwise be suppressed. This checking is normally suppressed for lines that contain references to the ? dynamic macro (for example, $?).

    When any combination of +, -, @, ?, or ! appear as the first characters after the TAB, all that are present apply. None are passed to the shell.

  Special-Function Targets

When incorporated in a makefile, the following target names perform special-functions:

.BUILT_LAST_MAKE_RUN:
    This is a separator used in the automatically created .make.state file in case that make is in .KEEP_STATE: mode. Do not use this pseudo target in hand written makefiles.

.DEFAULT:
    If it has an entry in the makefile, the rule for this target is used to process a target when there is no other entry for it, no rule for building it, and no SCCS history file from which to retrieve a current version. make ignores any dependencies for this target.

.DONE:
    If defined in the makefile, make processes this target and its dependencies after all other targets are built. This target is also performed when make halts with an error, unless the .FAILED target is defined.

.FAILED:
    This target, along with its dependencies, is performed instead of .DONE when defined in the makefile and make halts with an error.

.GET_POSIX:
    This target contains the rule for retrieving the current version of an SCCS file from its history file in the current working directory. make uses this rule when it is running in POSIX mode.

.IGNORE:
    Ignore errors. When this target appears in the makefile, make ignores non-zero error codes returned from commands. When used in POSIX mode, .IGNORE could be followed by target names only, for which the errors is ignored.

.INCLUDE_FAILED:
    This special target implements automake features for object oriented layered makefiles. If this target is present and defines commands, make executes the commands for this target in case that a makefile could not be included and there was no other explicit or implicit rule that did create the the missing make include file.

    The .INCLUDE_FAILED target may not have a dependency list. When the commands for the target .INCLUDE_FAILED are called, the dependency list of the special target is set up to the include filename that caused the failure. It is therefore recommended to define the commands for the .INCLUDE_FAILED target to include $^ as parameter. The commands for the target .INCLUDE_FAILED are called only for the include and not for the -include directive. If the commands for the .INCLUDE_FAILED target cannot create a file that is going to be included, make fails.

    With an empty SUN_MAKE_COMPAT_MODE environment, or when in SysV mode, make ignores the .INCLUDE_FAILED target in order to achieve compatibility to previous versions of the SunPro make program.

.INIT:
    If defined in the makefile, this target and its dependencies are built before any other targets are processed.

.KEEP_STATE:
    If this target is in effect, make updates the state file, .make.state, in the current directory. This target also activates command dependencies, and hidden dependency checks. If either the .KEEP_STATE: target appears in the makefile, or the environment variable KEEP_STATE is set (setenv KEEP_STATE), make rebuilds everything in order to collect dependency information, even if all the targets were up to date due to previous make runs. See also the Environment Variables section. This target has no effect if used in POSIX mode.

.KEEP_STATE_FILE:
    This target has no effect if used in POSIX mode. This target implies .KEEP_STATE. If the target is followed by a filename, make uses it as the state file. If the target is followed by a directory name, make looks for a .make.state file in that directory. If the target is not followed by any name, make looks for .make.state file in the current working directory.

.LOCAL:
    When running in serial mode, this target has no effect. It is used when in parallel mode. See dmake(1) for more information.

.MAKE_VERSION:
    A target-entry of the form:

    .MAKE_VERSION:  VERSION-number
    enables version checking. If the version of make differs from the version indicated by a string like VERSION-1.0, make issues a warning message.

.NO_PARALLEL:
    When running in serial mode, this target has no effect. It is used when in parallel mode. Add targets to the dependency list of this target to control which targets are to be processed serially. See dmake(1) for more information.

.NOTPARALLEL:
    When running in serial mode, this target has no effect. When in parallel mode and this special target is seen in a makefile, all targets in this make instance are processed serially. Sub-makes may still run in parallel mode. See dmake(1) for more information.

    With an empty SUN_MAKE_COMPAT_MODE environment, or when in SysV mode, make ignores the .NOTPARALLEL target in order to achieve compatibility to previous versions of the SunPro make program.

.PARALLEL:
    When running in serial mode, this target has no effect. It is used when in parallel mode. Add targets to the dependency list of this target to control which targets are to be processed in parallel. See dmake(1) for more information.

.PHONY:
    List of targets that should not be checked against existing files. A target that is marked .PHONY will always considered to be out of date. make does not remove any of the files listed as dependencies for this target when interrupted. make normally removes the current target when it receives an interrupt. If make is called with the -t (touch) option, the targets marked as .PHONY are not touched.

    With an empty SUN_MAKE_COMPAT_MODE environment, or when in SysV mode, make ignores the .PHONY target in order to achieve compatibility to previous versions of the SunPro make program.

.POSIX:
    This target enables POSIX mode. Trying to enable POSIX mode has no effect, if make was in SysV mode before, because the SysV mode uses a different internal makefile.

    If no job was run before .POSIX: is seen, make tries to set DMAKE_ADJUST_MAX_JOBS=M2 as POSIX likes to have a pool of jobs for a group of make programs, in case that the -j option is used to switch into parallel mode.

.PRECIOUS:
    List of files not to delete. make does not remove any of the files listed as dependencies for this target when interrupted. make normally removes the current target when it receives an interrupt. When used in POSIX mode, if the target is not followed by a list of files, all the file are assumed precious.

.SCCS_GET:
    This target contains the rule for retrieving the current version of an SCCS file from its history file. To suppress automatic retrieval, add an entry for this target with an empty rule to your makefile.

.SCCS_GET_POSIX:
    This target contains the rule for retrieving the current version of an SCCS file from its history file. make uses this rule when it is running in POSIX mode.

.SILENT:
    Run silently. When this target appears in the makefile, make does not echo commands before executing them. When used in POSIX mode, it could be followed by target names, and only those are executed silently.

.SUFFIXES:
    The suffixes list for selecting implicit rules (see The Suffixes List).

.SVR4:
    This target enables SVR4 mode. Note that the builtin rules are not reread and thus stay the default builtin rules for make. If the builtin rules should be the rules from SVR4, better use -x SUN_MAKE_COMPAT_MODE=svr4 or set the environment USE_SVR4_MAKE.

.WAIT:
    When running in serial mode, this target has no effect. When in parallel mode and this target is specified in a dependency list, make waits until the dependencies to the left of the .WAIT: pseudo target are finished with updating before starting to process targets to the right of .WAIT.

    See dmake(1) for more information.

  Clearing Special Targets

In this version of make, you can clear the definition of the following special targets by supplying entries for them with no dependencies and no rule:

.DEFAULT, .SCCS_GET, and .SUFFIXES

  Command Dependencies

When the .KEEP_STATE: target is effective, make checks the command for building a target against the state file. If the command has changed since the last make run, make rebuilds the target.

  Hidden Dependencies

When the .KEEP_STATE: target is effective, make reads reports from cpp(1) and other compilation processors for any "hidden" files, such as #include files. If the target is out of date with respect to any of these files, make rebuilds it.

  Macros

Entries of the form

macro=value

define macros. macro is the name of the macro, and value, which consists of all characters up to a comment character or unescaped NEWLINE, is the value. make strips both leading and trailing white space in accepting the value.

Subsequent references to the macro, of the forms: $(name) or ${name} are replaced by value. The parentheses or brackets can be omitted in a reference to a macro with a single-character name.

Macro references can contain references to other macros, in which case nested references are expanded first.

  Suffix Replacement Macro References

Substitutions within macros can be made as follows:

     $(name:string1=string2)

where string1 is either a suffix, or a word to be replaced in the macro definition, and string2 is the replacement suffix or word. Words in a macro value are separated by SPACE, TAB, and escaped NEWLINE characters.

  Pattern Replacement Macro References

Pattern matching replacements can also be applied to macros, with a reference of the form:

     $(name:op%os=np%ns)

where op is the existing (old) prefix and os is the existing (old) suffix, np and ns are the new prefix and new suffix, respectively, and the pattern matched by % (a string of zero or more characters), is carried forward from the value being replaced. For example:

PROGRAM=fabricate
DEBUG= $(PROGRAM:%=tmp/%-g)

sets the value of DEBUG to tmp/fabricate-g.

The replacement is done on a word by word base and the white space between words is literally retained. If there is no match, the result is unmodified.

Notice that pattern replacement macro references cannot be used in the dependency list of a pattern matching rule; the % characters are not evaluated independently. Also, any number of % metacharacters can appear after the equal-sign, including no % metacharacter after the equal-sign.

  Appending to a Macro

Words can be appended to macro values as follows:

     macro += word ...

  Special-Purpose Macros

When the MAKEFLAGS variable is present in the environment, make takes options from it, in combination with options entered on the command line. make retains this combined value as the MAKEFLAGS macro, and exports it automatically to each command or shell it invokes.

Notice that flags passed by way of MAKEFLAGS are only displayed when the -d, or -dd options are in effect.

The MAKE macro is another special case. It has the value make by default, and temporarily overrides the -n option for any line in which it is referred to. This allows nested invocations of make written as:

     $(MAKE) ...

to run recursively, with the -n flag in effect for all commands but make. This lets you use make -n to test an entire hierarchy of makefiles.

The MAKE macro contains a path name that is sufficient to recursively call the same make program again (it either contains the last path component or the full path name of the make program). Note that this may differ from the name that was used on the command line if the name that was used on the command line would not allow calling the same make program from a different directory using this name. For this reason $(MAKE) may not be used to check for a specific make program. Use $(MAKE_NAME) instead.

If not in SunPro make or in SysV compatibility mode, the MAKE_NAME macro is set up by make to help writing makefiles that depend on vendor specific features. It contains the official name of the make program - in our case sunpro.

For compatibility with the 4.2 BSD make, the MFLAGS macro is set from the MAKEFLAGS variable by prepending a -. MFLAGS is not exported automatically.

The SHELL macro, when set to a single-word value such as /usr/bin/csh, indicates the name of an alternate shell to use. The default is /bin/sh. Notice that make executes commands that contain no shell metacharacters itself. Built-in commands, such as dirs in the C shell, are not recognized unless the command line includes a metacharacter (for instance, a semicolon). This macro is neither imported from, nor exported to the environment, regardless of -e. To be sure it is set properly, you must define this macro within every makefile that requires it.

The syntax of the VPATH macro is:

     VPATH = [ pathname [ : pathname ] ... ]

VPATH specifies a list of directories to search for the files, which are targets or dependencies, when make is executed. VPATH is also used in order to search for the include files mentioned in the particular makefile.

When processing a target or a dependency or an include directive, make checks the existence of the file with the same name in the current directory. If the file is found to be missing, make searches for this file in the list of directories presented in VPATH (like the PATH variable in the shell). Unlike the PATH variable, VPATH is used in order to search for the files with relative pathnames. When make attempts to apply implicit rules to the target, it also searches for the dependency files using VPATH.

When the file is found using VPATH, internal macros $@, @<, $?, $*, and their alternative forms (with D or F appended) are set in accordance with the name derived from VPATH. For instance, if the target subdir/foo.o is found in the directory /aaa/bbb using VPATH, then the value of the internal macro $@ for this target is /aaa/bbb/subdir/foo.o.

If a target or a dependency file is found using VPATH, then any occurrences of the word that is the same as the target name in the subsequent rules are replaced with the actual name of the target derived from VPATH.

For example:

VPATH=./subdir
file.o : file.c
         cc -c file.c -o file.o

If file.c is found in ./subdir, then the command

cc -c ./subdir/file.c -o file.o

are executed.

The following macros are provided for use with cross-compilation:

HOST_ARCH
    The processor type of the host system. By default, this is the output of the mach(1) command or uname -p, prepended with -. Under normal circumstances, this value should never be altered by the user.

HOST_MACH
    The machine architecture of the host system. By default, this is the output of the arch(1) command or uname -m, prepended with -. Under normal circumstances, this value should never be altered by the user. Note that on Solaris, sun4 is returned in case that uname -p returns sparc, sun3 is returned for mc68020 and i86pc is returned for i386.

TARGET_ARCH
    The processor type of the target system. By default, the output of the mach(1) command, prepended with -.

TARGET_MACH
    The machine architecture of the target system. By default, this is the output of the arch(1) command, prepended with -.

The following macros are provided for compatibility with smake:

MAKE_ARCH
    This macro is set up by make as part of the automake features of make. It contains the processor architecture of the current machine from uname -p (e.g. mc68020, sparc, pentium, i386).

MAKE_BRAND
    This macro is set up by make as part of the automake features of make. It contains the brand of the current machine from sysinfo(SI_HW_PROVIDER) (e.g. Sun_Microsystems).

MAKE_DOMAIN
    This macro is set up by make as part of the automake features of make. It contains the domainname of the current machine from domainname(1) (e.g. acme.com).

MAKE_HOST
    This macro is set up by make as part of the automake features of make. It contains the host name of the current machine from uname -n (e.g. duffy, sherwood, ghost).

MAKE_HOST_OS
    This macro is set up by make as part of the automake features of make. It contains the host OS name from uname -Hs of the current machine in case that there is a layered OS like Cygwin (e.g. windows).

MAKE_HOST_OSREL
    This macro is set up by make as part of the automake features of make. It contains the host OS release from uname -Hr of the current machine in case that there is a layered OS like Cygwin (e.g. 5.1).

MAKE_HOST_OSVERSION
    This macro is set up by make as part of the automake features of make. It contains the host OS version from uname -Hv of the current machine in case that there is a layered OS like Cygwin (e.g. sp2).

MAKE_HWSERIAL
    This macro is set up by make as part of the automake features of make. It contains the serial number of the current machine (e.g. 1920098175).

MAKE_ISALIST
    This macro is set up by make as part of the automake features of make. It contains the instruction set architecture list of the current machine from sysinfo(SI_ISALIST) (e.g. amd64 pentium_pro+mmx pentium_pro pentium+mmx pentium i486 i386 i86).

MAKE_M_ARCH
    This macro is set up by make as part of the automake features of make. It contains the machine architecture of the current machine derived from MAKE_MACH (e.g. sun3, sun4).

MAKE_MACH
    This macro is set up by bmake as part of the automake features of make. It contains the kernel architecture of the current machine from uname -m (e.g. sun3, sun4c, sun4m, sun4u, i86pc).

MAKE_MODEL
    This macro is set up by bmake as part of the automake features of make. It contains the model name of the current machine from sysinfo(SI_PLATFORM) or uname -i (e.g. SUNW,SPARCstation-20).

MAKE_NAME
    This macro is set up by make as part of the automake features of make. It contains the official name of the make program - in our case smake.

MAKE_OS
    This macro is set up by make as part of the automake features of make. It contains the operating system name of the current machine from uname -s (e.g. sunos, linux, dgux).

MAKE_OSDEFS
    This macro is set up by bmake as part of the automake features of make. It contains operating system specific defines for the compiler (e.g. -D__SVR4).

MAKE_OSREL
    This macro is set up by bmake as part of the automake features of bmake. It contains the operating system release name of the current machine from uname -r (e.g. 5.5, 4.1.1).

MAKE_OSVERSION
    This macro is set up by bmake as part of the automake features of make. It contains the operating system version of the current machine from uname -v (e.g. generic).

The following macros are provided for compatibility with GNU make:

CURDIR
    After make has processed all -C options (if any), it sets the variable CURDIR to the absolute pathname of the current working directory. This value is never touched by make again. An environment variable will not overwrite it, but a makefile may. Setting this variable has no effect on the operation of make.

  Dynamic Macros

There are several dynamically maintained macros that are useful as abbreviations within rules. They are shown here as references; if you were to define them, make would simply override the definition.

$*
    The basename of the current target, derived as if selected for use with an implicit rule.

$<
    The name of a dependency file, derived as if selected for use with an implicit rule.

$@
    The name of the current target. This is the only dynamic macro whose value is strictly determined when used in a dependency list. (In which case it takes the form $$@.)

$^
    The list of all dependencies of the current target. Since the list main contain .WAIT pseudo targets, it is recommended to use $(^:.WAIT=) if .WAIT is part of the dependency list.

$?
    The list of dependencies that are newer than the target. Command-dependency checking is automatically suppressed for lines that contain this macro, just as if the command had been prefixed with a ?. See the description of ?, under Special Character Rules above. You can force this check with the ! command-line prefix.

$%
    The name of the library member being processed. (See Library Maintenance below.)

To refer to the $@ dynamic macro within a dependency list, precede the reference with an additional $ character (as in, $$@). Because make assigns $< and $* as it would for implicit rules (according to the suffixes list and the directory contents), they can be unreliable when used within explicit target entries.

These macros can be modified to apply either to the filename part, or the directory part of the strings they stand for, by adding an upper case F or D, respectively (and enclosing the resulting name in parentheses or braces). Thus, $(@D) refers to the directory part of the string $@; if there is no directory part, . is assigned. $(@F) refers to the filename part.

  Conditional Macro Definitions

A macro definition of the form:

target-list := macro = value

indicates that when processing any of the targets listed and their dependencies, macro is to be set to the value supplied. Notice that if a conditional macro is referred to in a dependency list, the $ must be delayed (use $$ instead). Also, target-list can contain a % pattern, in which case the macro is conditionally defined for all targets encountered that match the pattern. A pattern replacement reference can be used within the value.

You can temporarily append to a macros value with a conditional definition of the form:

target-list := macro += value

  Predefined Macros

make supplies the macros shown in the table that follows for compilers and their options, host architectures, and other commands. Unless these macros are read in as environment variables, their values are not exported by make. If you run make with any of these set in the environment, it is a good idea to add commentary to the makefile to indicate what value each is expected to take. If -r is in effect, make does not read the default makefile (./make.rules or /usr/share/lib/make/make.rules) in which these macro definitions are supplied.

  Implicit Rules

When a target has no entry in the makefile, make attempts to determine its class (if any) and apply the rule for that class. An implicit rule describes how to build any target of a given class, from an associated dependency file. The class of a target can be determined either by a pattern, or by a suffix; the corresponding dependency file (with the same basename) from which such a target might be built. In addition to a predefined set of implicit rules, make allows you to define your own, either by pattern, or by suffix.

  Pattern Matching Rules

A target entry of the form:

tp%ts: dp%ds
     rule

or

tp%ts:
     rule

is a pattern matching rule, in which tp is a target prefix, ts is a target suffix, dp is a dependency prefix, and ds is a dependency suffix (any of which can be null).

The % stands for a basename of zero or more characters that is matched in the target, and is used to construct the name of a dependency. When make encounters a match in its search for an implicit rule, it uses the rule in that target entry to build the target from the dependency file. Pattern-matching implicit rules typically make use of the $@ and $< dynamic macros as placeholders for the target and dependency names. Other, regular dependencies can occur in the dependency list; however, none of the regular dependencies can contain %. An entry of the form:

tp%ts: [dependency ...] dp%ds [dependency ...]
     rule

or

tp%ts: [dependency ...]
     rule

is a valid pattern matching rule.

Pattern Matching Rules are searched in in the same order as they appear in the makefile.

Pattern Matching Rules have precedence over Suffix Rules. The builtin rules defined by make are intentionally defined as Suffix Rules to allow them to be overwritten by Pattern Matching Rules in the customers makefiles.

  Suffix Rules

When no pattern matching rule applies, make checks the target name to see if it ends with a suffix in the known suffixes list. If so, make checks for any suffix rules, as well as a dependency file with same root and another recognized suffix, from which to build it.

The target entry for a suffix rule takes the form:

DsTs:
     rule

where Ts is the suffix of the target, Ds is the suffix of the dependency file, and rule is the rule for building a target in the class. Both Ds and Ts must appear in the suffixes list. (A suffix need not begin with a . to be recognized.)

A suffix rule with only one suffix describes how to build a target having a null (or no) suffix from a dependency file with the indicated suffix. For instance, the .c rule could be used to build an executable program named file from a C source file named file.c. If a target with a null suffix has an explicit dependency, make omits the search for a suffix rule.

make reads in the standard set of implicit rules from the file /usr/share/lib/make/make.rules, unless -r is in effect, or there is a make.rules file in the local directory that does not include that file.

  The Suffixes List

The suffixes list is given as the list of dependencies for the .SUFFIXES: special-function target. The default list is contained in the SUFFIXES macro (See Table of Predefined Macros for the standard list of suffixes). You can define additional .SUFFIXES: targets; a .SUFFIXES target with no dependencies clears the list of suffixes. Order is significant within the list; make selects a rule that corresponds to the target's suffix and the first dependency-file suffix found in the list. To place suffixes at the head of the list, clear the list and replace it with the new suffixes, followed by the default list:

   .SUFFIXES:
   .SUFFIXES: suffixes $(SUFFIXES)

A tilde (~) indicates that if a dependency file with the indicated suffix (minus the ~) is under SCCS its most recent version should be retrieved, if necessary, before the target is processed.

  Library Maintenance

A target name of the form:

   lib(member ...)

refers to a member, or a space-separated list of members, in an ar(1) library.

The dependency of the library member on the corresponding file must be given as an explicit entry in the makefile. This can be handled by a pattern matching rule of the form:

   lib(%.s): %.s

where .s is the suffix of the member; this suffix is typically .o for object libraries.

A target name of the form:

   lib((symbol))

refers to the member of a randomized object library that defines the entry point named symbol.

  Command Execution

Command lines are executed one at a time, each by its own process or shell. Shell commands, notably cd, are ineffectual across an unescaped NEWLINE in the makefile. A line is printed (after macro expansion) just before being executed. This is suppressed if it starts with a @, if there is a .SILENT: entry in the makefile, or if make is run with the -s option. Although the -n option specifies printing without execution, lines containing the macro $(MAKE) are executed regardless, and lines containing the @ special character are printed. The -t (touch) option updates the modification date of a file without executing any rules. This can be dangerous when sources are maintained by more than one person.

make invokes the shell with the -e (exit-on-errors) argument. Thus, with semicolon-separated command sequences, execution of the later commands depends on the success of the former. This behavior can be overridden by starting the command line with a -, or by writing a shell script that returns a non-zero status only as it finds appropriate.

  Bourne Shell Constructs

To use the Bourne shell if control structure for branching, use a command line of the form:

if expression ; \
then command ; \
     ... ; \
else command; \
     ... ; \
fi

Although composed of several input lines, the escaped NEWLINE characters insure that make treats them all as one (shell) command line.

To use the Bourne shell for control structure for loops, use a command line of the form:

for var in list ; \
do command; \
     ... ; \done

To refer to a shell variable, use a double-dollar-sign ($$). This prevents expansion of the dollar-sign by make.

  Command Substitutions

To incorporate the standard output of a shell command in a macro, use a definition of the form:

   MACRO:sh =command

The command is executed only once, standard error output is discarded, and NEWLINE characters are replaced with SPACEs. If the command has a non-zero exit status, make halts with an error.

To capture the output of a shell command in a macro reference, use a reference of the form:

$(MACRO:sh)

where MACRO is the name of a macro containing a valid Bourne shell command line. In this case, the command is executed whenever the reference is evaluated. As with shell command substitutions, the reference is replaced with the standard output of the command. If the command has a non-zero exit status, make halts with an error.

In contrast to commands in rules, the command is not subject for macro substitution; therefore, a dollar sign ($) need not be replaced with a double dollar sign ($$).

  Signals

INT, SIGTERM, and QUIT signals received from the keyboard halt make and remove the target file being processed unless that target is in the dependency list for .PRECIOUS:.

EXAMPLES

Example 1 Defining dependencies

This makefile says that pgm depends on two files a.o and b.o, and that they in turn depend on their corresponding source files (a.c and b.c) along with a common file incl.h:

pgm:  a.o  b.o
     $(LINK.c) -o $@a.o  b.o
a.o:  incl.h  a.c
     cc -c a.c
b.o:  incl.h  b.c
     cc -c b.c

Example 2 Using implicit rules

The following makefile uses implicit rules to express the same dependencies:

pgm:  a.o  b.o
     cc  a.o  b.o -o pgm
a.o  b.o:  incl.h

ENVIRONMENT VARIABLES

See environ(7) for descriptions of the following environment variables that affect the execution of make: LANG, LC_ALL, LC_CTYPE, LC_MESSAGES, and NLSPATH.

DMAKE_ADJUST_MAX_JOBS
    This environment variable allows one to control the parallel make behavior. The macro DMAKE_ADJUST_MAX_JOBS may either be imported from the environment or specified on the command line. The following values are possible:

    YES This is the same as specifying DMAKE_ADJUST_MAX_JOBS=M1

    NO  The number of jobs is not adjusted based on the load of the system or the total number of jobs.

    M1  Allow make to control the number of jobs based on the current system load. If the load is high, the number of jobs will be reduced. If the load is low, the number of jobs specified by the user is used.

        This is the default method used to control the number of jobs.

    M2  The number of jobs is adjusted based on the total number of jobs run by the current group of running make programs. This is implemented via shared memory that is set up between recursively called make programs.

DMAKE_MAX_JOBS
    Allows setting the maximum number of jobs in case that -j was not specified.

DMAKE_MODE
    May contain one of the following key words:

    serial
        Causes make to behave like the standard serial version of make.

    parallel
        Causes make to run several jobs in parallel on the dmake host.

DMAKE_OUTPUT_MODE
    Controls the output format used by make. The following values are possible:

    TXT1
        The default behavior. Serialize stdout and stderr, and print a label before the output from a new job starts.

    TXT2
        Serialize stdout and stderr, but do not print the labels from TXT1 mode.

DMAKE_STATISTICS
    If this environment variable is present, make prints a set of allocation statistics at the end of the run.

__DMAKE_M2_FILE__
    If DMAKE_ADJUST_MAX_JOBS is set to M2, this environment variable holds a handle to the shared memory that is used to manage the job pool. Do never set this environment variable.

KEEP_STATE
    This environment variable has the same effect as the .KEEP_STATE: special-function target. It enables command dependencies, hidden dependencies and writing of the state file.

USE_SVR4_MAKE
USE_SVID
    This environment variable causes make to invoke the generic System V version of make (/usr/lib/svr4.make). See sysV-make(1).

MAKEFLAGS
    This variable is interpreted as a character string representing a series of option characters to be used as the default options. The implementation accepts both of the following formats (but need not accept them when intermixed):

    1.  The characters are option letters without the leading hyphens or blank character separation used on a command line.

    2.  The characters are formatted in a manner similar to a portion of the make command line: options are preceded by hyphens and blank-character-separated. The macro=name macro definition operands can also be included. The difference between the contents of MAKEFLAGS and the command line is that the contents of the variable is not subjected to the word expansions associated with parsing the command line values. See wordexp(3C).

        When the command-line options -f or -p are used, they take effect regardless of whether they also appear in MAKEFLAGS. If they otherwise appear in MAKEFLAGS, the result is undefined.

    The MAKEFLAGS variable is accessed from the environment before the makefile is read. At that time, all of the options (except -f and -p) and command-line macros not already included in MAKEFLAGS are added to the MAKEFLAGS macro. The MAKEFLAGS macro is passed into the environment as an environment variable for all child processes. If the MAKEFLAGS macro is subsequently set by the makefile, it replaces the MAKEFLAGS variable currently found in the environment.

PROJECTDIR
    Provides a directory to be used to search for SCCS files not found in the current directory. In all of the following cases, the search for SCCS files is made in the directory SCCS in the identified directory. If the value of PROJECTDIR begins with a slash, it shall be considered an absolute pathname. Otherwise, the value of PROJECTDIR is treated as a user name and that user's initial working directory shall be examined for a subdirectory src or source. If such a directory is found, it shall be used. Otherwise, the value is used as a relative pathname.

    If PROJECTDIR is not set or has a null value, the search for SCCS files shall be made in the directory SCCS in the current directory. The setting of PROJECTDIR affects all files listed in the remainder of this utility description for files with a component named SCCS.
SGS_SUPPORT
SGS_SUPPORT_32
SGS_SUPPORT_64
    These variables contain a path to libmakestate.so.1 that is used by the linker to load the make provided library in order to maintain linker dependencies by make. SGS_SUPPORT is used for all binaries unless SGS_SUPPORT_32 or SGS_SUPPORT_64 are set. SGS_SUPPORT_32 and SGS_SUPPORT_64 are isa specific versions.

    These environment variables may be set by the user, but they are also automatically maintained by make in case it is neither in POSIX nor in SysV mode.

SUNPRO_DEPENDENCIES
    If make is in KEEP_STATE mode, this environment variable is used to tell the compiler that it should create include dependencies as a side effect of compiling.

SUN_MAKE_COMPAT_MODE
    Set up compatibility for other make programs. Supported values are:

    GNU Implement the expansion for the dynamic macros $< and $* for explicit rules the same was as GNU make does. Note that the expansion of these dynamic macros for explicit rules is unspecified by the standard.

        When in GNU compatibility mode, command line macro definitions are forwarded to recursively called make programs.

    POSIX
        Switch make into POSIX mode.

    SUN Switch make into Sun compatibility mode. This is a mode that is compatible to the SunPro Make source as published by Sun on December 19 2006.

    SVR4
        Switch make into SysV (SVR4) mode.

    other
        Implement 100% compatibility to the version of the SunPro make program as published by Sun. This results in disabling to forward command line macro definitions specified to the current make program to recursively called make programs. It disables the special macro MAKE_NAME and disables to evaluate the .PHONY special target. Multiple includes with a single include statement are disabled.

TMPDIR
    Set up the directory where the temporary files from make are stored. If this environment is missing, /tmp is used.

EXIT STATUS

When the -q option is specified, the make utility exits with one of the following values:

0
    Successful completion.

1
    The target was not up-to-date.

>1
    An error occurred.

When the -q option is not specified, the make utility exits with one of the following values:

0
    Successful completion

>0
    An error occurred

FILES

makefile
Makefile

    current version(s) of make description file

s.makefile
s.Makefile

    SCCS history files for the above makefile(s) in the current directory

SCCS/s.makefile
SCCS/s.Makefile

    SCCS history files for the above makefile(s)

make.rules

    default file for user-defined targets, macros, and implicit rules

/usr/share/lib/make/make.rules

    makefile for standard implicit rules and macros (not read if make.rules is)

.make.state

    state file in the local directory

.make.state.lock

    lock file for the state file in the local directory. This file may need manual removal if the system crashed at a critical state.

ATTRIBUTES

See attributes(7) for descriptions of the following attributes:

  /usr/bin/make

  /usr/xpg4/bin/make

SEE ALSO

ar(1), arch(1), cd(1), cpp(1), dmake(1), lex(1), mach(1), sccs-get(1), sh(1), smake(1), sysV-make(1), yacc(1), wordexp(3C), passwd(5), attributes(7), environ(7), POSIX.2(7), standards(7)

Solaris Advanced User's Guide

DIAGNOSTICS

Don't know how to make target target

    There is no makefile entry for target, and none of make's implicit rules apply (there is no dependency file with a suffix in the suffixes list, or the target's suffix is not in the list).

*** target removed.

    make was interrupted while building target. Rather than leaving a partially-completed version that is newer than its dependencies, make removes the file named target.

*** target not removed.

    make was interrupted while building target and target was not present in the directory.

*** target could not be removed, reason

    make was interrupted while building target, which was not removed for the indicated reason.

Read of include file file failed

    The makefile indicated in an include directive was not found, or was inaccessible.

Loop detected when expanding macro value macro'

    A reference to the macro being defined was found in the definition.

Could not write state file file

    You used the .KEEP_STATE: target, but do not have write permission on the state file.

***Error code n

    The previous shell command returned a nonzero error code.

*** signal message

    The previous shell command was aborted due to a signal. If - core dumped appears after the message, a core file was created.

Conditional macro conflict encountered

    Displayed only when -d is in effect, this message indicates that two or more parallel targets currently being processed depend on a target which is built differently for each by virtue of conditional macros. Since the target cannot simultaneously satisfy both dependency relationships, it is conflicted.

The string `string' is not valid in current locale

    A string or path-name was discovered that cannot be translated into the current locale. Run make in the C-locale (e.g. by using LC_CTYPE=C or LC_ALL=C) to avoid this problem.

NOTES

Unlike older versions of make, this version of make forwards command line macros to sub-make programs as required by POSIX. If you like to get the previous behavior, set the environment SUN_MAKE_COMPAT_MODE to an empty value before you start make.

BUGS

Some commands return nonzero status inappropriately; to overcome this difficulty, prefix the offending command line in the rule with a -.

Filenames with the characters =, :, or @, do not work.

You cannot build file.o from lib(file.o).

Options supplied by MAKEFLAGS should be reported for nested make commands. Use the -d option to find out what options the nested command picks up from MAKEFLAGS.

This version of make is incompatible in certain respects with previous versions:

    o   The -d option output is much briefer in this version. -dd now produces the equivalent voluminous output.

    o   make attempts to derive values for the dynamic macros $*, $<, and $?, while processing explicit targets. It uses the same method as for implicit rules; in some cases this can lead either to unexpected values, or to an empty value being assigned. (Actually, this was true for earlier versions as well, even though the documentation stated otherwise.)

    o   make no longer searches for SCCS history (s.) files.

    o   Suffix replacement in macro references are now applied after the macro is expanded.

There is no guarantee that makefiles created for this version of make works with earlier versions.

If there is no make.rules file in the current directory, and the file /usr/share/lib/make/make.rules is missing, make stops before processing any targets. To force make to run anyway, create an empty make.rules file in the current directory.

Once a dependency is made, make assumes the dependency file is present for the remainder of the run. If a rule subsequently removes that file and future targets depend on its existence, unexpected errors can result.

When hidden dependency checking is in effect, the $? macro's value includes the names of hidden dependencies. This can lead to improper filename arguments to commands when $? is used in a rule.

Pattern replacement macro references cannot be used in the dependency list of a pattern matching rule.

Unlike previous versions, this version of make strips a leading ./ from the value of the $@ dynamic macro.

Since all internal strings are handled as wide character strings, there may be problems caused from character conversion while using an inappropriate locale for the current project. In such a case, it helps to run make in the C-locale.

With automatic SCCS retrieval, this version of make does not support tilde suffix rules.

The only dynamic macro whose value is strictly determined when used in a dependency list is $@ (takes the form $$@).

make invokes the shell with the -e argument. This cannot be inferred from the syntax of the rule alone. Mail other bugs and suggestions to schilytools@mlists.in-berlin.de or open a ticket at https://codeberg.org/schilytools/schilytools/issues.

The mailing list archive may be found at:

https://mlists.in-berlin.de/mailman/listinfo/schilytools-mlists.in-berlin.de.

AUTHORS
This version of make(1) was originally written by Sun Microsystems in 1986. Since 2016, it has been maintained by Joerg Schilling and the schilytools project authors.

SOURCE DOWNLOAD
The source code for SunPro Make is included in the schilytools project and may be retrieved from the schilytools project at Codeberg at

https://codeberg.org/schilytools/schilytools.

The download directory is

https://codeberg.org/schilytools/schilytools/releases.