1 '\" te 2 .\" Copyright 1989 AT&T 3 .\" Portions Copyright (c) 1992, X/Open Company Limited All Rights Reserved 4 .\" Copyright (c) 2008, Sun Microsystems, Inc. All Rights Reserved 5 .\" Sun Microsystems, Inc. gratefully acknowledges The Open Group for permission to reproduce portions of its copyrighted documentation. Original documentation from The Open Group can be obtained online at 6 .\" http://www.opengroup.org/bookstore/. 7 .\" The Institute of Electrical and Electronics Engineers and The Open Group, have given us permission to reprint portions of their documentation. In the following statement, the phrase "this text" refers to portions of the system documentation. Portions of this text are reprinted and reproduced in electronic form in the Sun OS Reference Manual, from IEEE Std 1003.1, 2004 Edition, Standard for Information Technology -- Portable Operating System Interface (POSIX), The Open Group Base Specifications Issue 6, Copyright (C) 2001-2004 by the Institute of Electrical and Electronics Engineers, Inc and The Open Group. In the event of any discrepancy between these versions and the original IEEE and The Open Group Standard, the original IEEE and The Open Group Standard is the referee document. The original Standard can be obtained online at http://www.opengroup.org/unix/online.html. 8 .\" This notice shall appear on any product containing this material. 9 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License. 10 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License. 11 .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner] 12 .TH MAKE 1S "Apr 23, 2008" 13 .SH NAME 14 make \- maintain, update, and regenerate related programs and files 15 .SH SYNOPSIS 16 .LP 17 .nf 18 \fB/usr/bin/make\fR [\fB-d\fR] [\fB-dd\fR] [\fB-D\fR] [\fB-DD\fR] [\fB-e\fR] [\fB-i\fR] [\fB-k\fR] [\fB-n\fR] 19 [\fB-p\fR] [\fB-P\fR] [\fB-q\fR] [\fB-r\fR] [\fB-s\fR] [\fB-S\fR] [\fB-t\fR] [\fB-V\fR] 20 [\fB-f\fR \fImakefile\fR]... [\fB-K\fR \fIstatefile\fR]... [\fItarget\fR]... 21 [\fImacro\fR = \fIvalue\fR...] 22 .fi 23 24 .LP 25 .nf 26 \fB/usr/xpg4/bin/make\fR [\fB-d\fR] [\fB-dd\fR] [\fB-D\fR] [\fB-DD\fR] [\fB-e\fR] [\fB-i\fR] [\fB-k\fR] 27 [\fB-n\fR] [\fB-p\fR] [\fB-P\fR] [\fB-q\fR] [\fB-r\fR] [\fB-s\fR] [\fB-S\fR] [\fB-t\fR] [\fB-V\fR] 28 [\fB-f\fR \fImakefile\fR]... [\fItarget\fR]... [\fImacro\fR = \fIvalue\fR...] 29 .fi 30 31 .SH DESCRIPTION 32 .LP 33 The \fBmake\fR utility executes a list of shell commands associated with each 34 \fItarget\fR, typically to create or update a file of the same name. 35 \fImakefile\fR contains entries that describe how to bring a target up to date 36 with respect to those on which it depends, which are called \fIdependencies\fR. 37 Since each dependency is a target, it can have dependencies of its own. 38 Targets, dependencies, and sub-dependencies comprise a tree structure that 39 \fBmake\fR traces when deciding whether or not to rebuild a \fItarget\fR. 40 .sp 41 .LP 42 The \fBmake\fR utility recursively checks each \fItarget\fR against its 43 dependencies, beginning with the first target entry in \fImakefile\fR if no 44 \fItarget\fR argument is supplied on the command line. If, after processing all 45 of its dependencies, a target file is found either to be missing, or to be 46 older than any of its dependencies, \fBmake\fR rebuilds it. Optionally with 47 this version of \fBmake\fR, a target can be treated as out-of-date when the 48 commands used to generate it have changed since the last time the target was 49 built. 50 .sp 51 .LP 52 To build a given target, \fBmake\fR executes the list of commands, called a 53 \fIrule\fR. This rule can be listed explicitly in the target's makefile entry, 54 or it can be supplied implicitly by \fBmake\fR. 55 .sp 56 .LP 57 If no \fItarget\fR is specified on the command line, \fBmake\fR uses the first 58 target defined in \fImakefile\fR. 59 .sp 60 .LP 61 If a \fItarget\fR has no makefile entry, or if its entry has no rule, 62 \fBmake\fR attempts to derive a rule by each of the following methods, in turn, 63 until a suitable rule is found. Each method is described under Usage below. 64 .RS +4 65 .TP 66 .ie t \(bu 67 .el o 68 Pattern matching rules. 69 .RE 70 .RS +4 71 .TP 72 .ie t \(bu 73 .el o 74 Implicit rules, read in from a user-supplied makefile. 75 .RE 76 .RS +4 77 .TP 78 .ie t \(bu 79 .el o 80 Standard implicit rules (also known as suffix rules), typically read in from 81 the file \fB/usr/share/lib/make/make.rules\fR. 82 .RE 83 .RS +4 84 .TP 85 .ie t \(bu 86 .el o 87 \fBSCCS\fR retrieval. \fBmake\fR retrieves the most recent version from the 88 \fBSCCS\fR history file (if any). See the description of the 89 \fB\&.SCCS_GET:\fR special-function target for details. 90 .RE 91 .RS +4 92 .TP 93 .ie t \(bu 94 .el o 95 The rule from the \fB\&.DEFAULT:\fR target entry, if there is such an entry in 96 the makefile. 97 .RE 98 .sp 99 .LP 100 If there is no makefile entry for a \fItarget\fR, if no rule can be derived for 101 building it, and if no file by that name is present, \fBmake\fR issues an error 102 message and halts. 103 .SH OPTIONS 104 .LP 105 The following options are supported: 106 .sp 107 .ne 2 108 .na 109 \fB\fB-d\fR\fR 110 .ad 111 .RS 16n 112 Displays the reasons why \fBmake\fR chooses to rebuild a target. \fBmake\fR 113 displays any and all dependencies that are newer. In addition, \fBmake\fR 114 displays options read in from the \fBMAKEFLAGS\fR environment variable. 115 .RE 116 117 .sp 118 .ne 2 119 .na 120 \fB\fB-dd\fR\fR 121 .ad 122 .RS 16n 123 Displays the dependency check and processing in vast detail. 124 .RE 125 126 .sp 127 .ne 2 128 .na 129 \fB\fB-D\fR\fR 130 .ad 131 .RS 16n 132 Displays the text of the makefiles read in. 133 .RE 134 135 .sp 136 .ne 2 137 .na 138 \fB\fB-DD\fR\fR 139 .ad 140 .RS 16n 141 Displays the text of the makefiles, \fBmake.rules\fR file, the state file, and 142 all hidden-dependency reports. 143 .RE 144 145 .sp 146 .ne 2 147 .na 148 \fB\fB-e\fR\fR 149 .ad 150 .RS 16n 151 Environment variables override assignments within makefiles. 152 .RE 153 154 .sp 155 .ne 2 156 .na 157 \fB\fB-f\fR \fImakefile\fR\fR 158 .ad 159 .RS 16n 160 Uses the description file \fImakefile\fR. A \fB\(mi\fR as the \fImakefile\fR 161 argument denotes the standard input. The contents of \fImakefile\fR, when 162 present, override the standard set of implicit rules and predefined macros. 163 When more than one \fB-f\fR \fImakefile\fR argument pair appears, \fBmake\fR 164 uses the concatenation of those files, in order of appearance. 165 .sp 166 When no \fImakefile\fR is specified, \fB/usr/bin/make\fR tries the following in 167 sequence, except when in POSIX mode (see \fB\&.POSIX\fR in Usage): 168 .RS +4 169 .TP 170 .ie t \(bu 171 .el o 172 If there is a file named \fBmakefile\fR in the working directory, \fBmake\fR 173 uses that file. If, however, there is an \fBSCCS\fR history file 174 (\fBSCCS/s.makefile\fR) which is newer, \fBmake\fR attempts to retrieve and use 175 the most recent version. 176 .RE 177 .RS +4 178 .TP 179 .ie t \(bu 180 .el o 181 In the absence of the above file(s), if a file named \fBMakefile\fR is present 182 in the working directory, \fBmake\fR attempts to use it. If there is an 183 \fBSCCS\fR history file (\fBSCCS/s.Makefile\fR) that is newer, \fBmake\fR 184 attempts to retrieve and use the most recent version. 185 .RE 186 When no \fImakefile\fR is specified, \fB/usr/bin/make\fR in POSIX mode and 187 \fB/usr/xpg4/bin/make\fR try the following files in sequence: 188 .RS +4 189 .TP 190 .ie t \(bu 191 .el o 192 \fB\&./makefile\fR, \fB\&./Makefile\fR 193 .RE 194 .RS +4 195 .TP 196 .ie t \(bu 197 .el o 198 \fBs.makefile\fR, \fBSCCS/s.makefile\fR 199 .RE 200 .RS +4 201 .TP 202 .ie t \(bu 203 .el o 204 \fBs.Makefile\fR, \fBSCCS/s.Makefile\fR 205 .RE 206 .RE 207 208 .sp 209 .ne 2 210 .na 211 \fB\fB-i\fR\fR 212 .ad 213 .RS 16n 214 Ignores error codes returned by commands. Equivalent to the special-function 215 target \fB\&.IGNORE:\fR. 216 .RE 217 218 .sp 219 .ne 2 220 .na 221 \fB\fB-k\fR\fR 222 .ad 223 .RS 16n 224 When a nonzero error status is returned by a rule, or when \fBmake\fR cannot 225 find a rule, abandons work on the current target, but continues with other 226 dependency branches that do not depend on it. 227 .RE 228 229 .sp 230 .ne 2 231 .na 232 \fB\fB-K\fR \fIstatefile\fR\fR 233 .ad 234 .RS 16n 235 Uses the state file \fIstatefile\fR. A \fB\(mi\fR as the \fIstatefile\fR 236 argument denotes the standard input. The contents of \fIstatefile\fR, when 237 present, override the standard set of implicit rules and predefined macros. 238 When more than one \fB-K\fR \fIstatefile\fR argument pair appears, \fBmake\fR 239 uses the concatenation of those files, in order of appearance. (See also 240 \fB\&.KEEP_STATE\fR and \fB\&.KEEP_STATE_FILE\fR in the Special-Function 241 Targets section). 242 .RE 243 244 .sp 245 .ne 2 246 .na 247 \fB\fB-n\fR\fR 248 .ad 249 .RS 16n 250 No execution mode. Prints commands, but does not execute them. Even lines 251 beginning with an \fB@\fR are printed. However, if a command line contains a 252 reference to the \fB$(MAKE)\fR macro, that line is always executed (see the 253 discussion of \fBMAKEFLAGS\fR in Reading Makefiles and the Environment). When 254 in POSIX mode, lines beginning with a "\fB+\fR" are executed. 255 .RE 256 257 .sp 258 .ne 2 259 .na 260 \fB\fB-p\fR\fR 261 .ad 262 .RS 16n 263 Prints out the complete set of macro definitions and target descriptions. 264 .RE 265 266 .sp 267 .ne 2 268 .na 269 \fB\fB-P\fR\fR 270 .ad 271 .RS 16n 272 Merely reports dependencies, rather than building them. 273 .RE 274 275 .sp 276 .ne 2 277 .na 278 \fB\fB-q\fR\fR 279 .ad 280 .RS 16n 281 Question mode. \fBmake\fR returns a zero or nonzero status code depending on 282 whether or not the target file is up to date. When in POSIX mode, lines 283 beginning with a "\fB+\fR" are executed. 284 .RE 285 286 .sp 287 .ne 2 288 .na 289 \fB\fB-r\fR\fR 290 .ad 291 .RS 16n 292 Does not read in the default makefile \fB/usr/share/lib/make/make.rules\fR. 293 .RE 294 295 .sp 296 .ne 2 297 .na 298 \fB\fB-s\fR\fR 299 .ad 300 .RS 16n 301 Silent mode. Does not print command lines before executing them. Equivalent to 302 the special-function target \fB\&.SILENT:\fR. 303 .RE 304 305 .sp 306 .ne 2 307 .na 308 \fB\fB-S\fR\fR 309 .ad 310 .RS 16n 311 Undoes the effect of the \fB-k\fR option. Stops processing when a non-zero exit 312 status is returned by a command. 313 .RE 314 315 .sp 316 .ne 2 317 .na 318 \fB\fB-t\fR\fR 319 .ad 320 .RS 16n 321 Touches the target files (bringing them up to date) rather than performing 322 their rules. \fBWarning:\fR This can be \fBdangerous\fR when files are 323 maintained by more than one person. When the \fB\&.KEEP_STATE:\fR target 324 appears in the makefile, this option updates the state file just as if the 325 rules had been performed. When in POSIX mode, lines beginning with a "\fB+\fR" 326 are executed. 327 .RE 328 329 .sp 330 .ne 2 331 .na 332 \fB\fB-V\fR\fR 333 .ad 334 .RS 16n 335 Puts \fBmake\fR into SysV mode. Refer to \fBsysV-make\fR(1) for respective 336 details. 337 .RE 338 339 .SH OPERANDS 340 .LP 341 The following operands are supported: 342 .sp 343 .ne 2 344 .na 345 \fB\fItarget\fR\fR 346 .ad 347 .RS 15n 348 Target names, as defined in Usage. 349 .RE 350 351 .sp 352 .ne 2 353 .na 354 \fB\fImacro\fR\fB=\fR\fIvalue\fR\fR 355 .ad 356 .RS 15n 357 Macro definition. This definition overrides any regular definition for the 358 specified macro within the makefile itself, or in the environment. However, 359 this definition can still be overridden by conditional macro assignments. 360 .RE 361 362 .SH USAGE 363 .LP 364 The usage of \fBmake\fR is described below: 365 .SS "Reading Makefiles and the Environment" 366 .LP 367 When \fBmake\fR first starts, it reads the \fBMAKEFLAGS\fR environment variable 368 to obtain any of the following options specified present in its value: 369 \fB-d\fR, \fB-D\fR, \fB-e\fR, \fB-i\fR, \fB-k\fR, \fB-n\fR, \fB-p\fR, \fB-q\fR, 370 \fB-r\fR, \fB-s\fR, \fB-S\fR, or \fB-t\fR. Due to the implementation of POSIX.2 371 (see \fBPOSIX.2\fR(5), the \fBMAKEFLAGS\fR values contains a leading \fB\(mi\fR 372 character. The \fBmake\fR utility then reads the command line for additional 373 options, which also take effect. 374 .sp 375 .LP 376 Next, \fBmake\fR reads in a default makefile that typically contains predefined 377 macro definitions, target entries for implicit rules, and additional rules, 378 such as the rule for retrieving \fBSCCS\fR files. If present, \fBmake\fR uses 379 the file \fBmake.rules\fR in the current directory; otherwise it reads the file 380 \fB/usr/share/lib/make/make.rules\fR, which contains the standard definitions 381 and rules. Use the directive: 382 .sp 383 .in +2 384 .nf 385 \fBinclude /usr/share/lib/make/make.rules\fR 386 .fi 387 .in -2 388 .sp 389 390 .sp 391 .LP 392 in your local \fBmake.rules\fR file to include them. 393 .sp 394 .LP 395 Next, \fBmake\fR imports variables from the environment (unless the \fB-e\fR 396 option is in effect), and treats them as defined macros. Because \fBmake\fR 397 uses the most recent definition it encounters, a macro definition in the 398 makefile normally overrides an environment variable of the same name. When 399 \fB-e\fR is in effect, however, environment variables are read in \fBafter\fR 400 all makefiles have been read. In that case, the environment variables take 401 precedence over definitions in the makefile. 402 .sp 403 .LP 404 Next, \fBmake\fR reads any makefiles you specify with \fB-f\fR, or one of 405 \fBmakefile\fR or \fBMakefile\fR as described above and then the state file, in 406 the local directory if it exists. If the makefile contains a 407 \fB\&.KEEP_STATE_FILE\fR target, then it reads the state file that follows the 408 target. Refer to special target \fB\&.KEEP_STATE_FILE\fR for details. 409 .sp 410 .LP 411 Next (after reading the environment if \fB-e\fR is in effect), \fBmake\fR reads 412 in any macro definitions supplied as command line arguments. These override 413 macro definitions in the makefile and the environment both, but only for the 414 \fBmake\fR command itself. 415 .sp 416 .LP 417 \fBmake\fR exports environment variables, using the most recently defined 418 value. Macro definitions supplied on the command line are not normally 419 exported, unless the macro is also an environment variable. 420 .sp 421 .LP 422 \fBmake\fR does not export macros defined in the makefile. If an environment 423 variable is set, and a macro with the same name is defined on the command line, 424 \fBmake\fR exports its value as defined on the command line. Unless \fB-e\fR is 425 in effect, macro definitions within the makefile take precedence over those 426 imported from the environment. 427 .sp 428 .LP 429 The macros \fBMAKEFLAGS\fR, \fBMAKE\fR, \fBSHELL\fR, \fBHOST_ARCH\fR, 430 \fBHOST_MACH\fR, and \fBTARGET_MACH\fR are special cases. See Special-Purpose 431 Macros below for details. 432 .SS "Makefile Target Entries" 433 .LP 434 A target entry has the following format: 435 .sp 436 .in +2 437 .nf 438 \fItarget\fR [\fB:\fR|\fB::\fR] [\fIdependency\fR] ... [\fB;\fR \fBcommand\fR] ... 439 [\fBcommand\fR] 440 ... 441 .fi 442 .in -2 443 444 .sp 445 .LP 446 The first line contains the name of a target, or a space-separated list of 447 target names, terminated with a colon or double colon. If a list of targets is 448 given, this is equivalent to having a separate entry of the same form for each 449 target. The colon(s) can be followed by a \fIdependency\fR, or a dependency 450 list. \fBmake\fR checks this list before building the target. The dependency 451 list can be terminated with a semicolon (\fB;\fR), which in turn can be 452 followed by a single Bourne shell command. Subsequent lines in the target entry 453 begin with a \fBTAB\fR and contain Bourne shell commands. These commands 454 comprise the rule for building the target. 455 .sp 456 .LP 457 Shell commands can be continued across input lines by escaping the 458 \fBNEWLINE\fR with a backslash (\fB\e\fR). The continuing line must also start 459 with a \fBTAB\fR. 460 .sp 461 .LP 462 To rebuild a target, \fBmake\fR expands macros, strips off initial \fBTAB\fR 463 characters and either executes the command directly (if it contains no shell 464 metacharacters), or passes each command line to a Bourne shell for execution. 465 .sp 466 .LP 467 The first \fInon-empty\fR line that does not begin with a \fBTAB\fR or \fB#\fR 468 begins another target or macro definition. 469 .SS "Special Characters" 470 .LP 471 Special characters are defined below. 472 .SS "\fIGlobal\fR" 473 .ne 2 474 .na 475 \fB\fB#\fR\fR 476 .ad 477 .RS 20n 478 Start a comment. The comment ends at the next \fBNEWLINE\fR. If the \fB#\fR 479 follows the \fBTAB\fR in a command line, that line is passed to the shell 480 (which also treats \fB#\fR as the start of a comment). 481 .RE 482 483 .sp 484 .ne 2 485 .na 486 \fB\fBinclude\fR \fIfilename\fR\fR 487 .ad 488 .RS 20n 489 If the word \fBinclude\fR appears as the first seven letters of a line and is 490 followed by a \fBSPACE\fR or \fBTAB\fR, the string that follows is taken as a 491 filename to interpolate at that line. \fBinclude\fR files can be nested to a 492 depth of no more than 38 nested makefiles . If \fIfilename\fR is a macro 493 reference, it is expanded. 494 .RE 495 496 .SS "\fITargets and Dependencies\fR" 497 .ne 2 498 .na 499 \fB\fB:\fR\fR 500 .ad 501 .sp .6 502 .RS 4n 503 Target list terminator. Words following the colon are added to the dependency 504 list for the target or targets. If a target is named in more than one 505 colon-terminated target entry, the dependencies for all its entries are added 506 to form that target's complete dependency list. 507 .RE 508 509 .sp 510 .ne 2 511 .na 512 \fB\fB::\fR\fR 513 .ad 514 .sp .6 515 .RS 4n 516 Target terminator for alternate dependencies. When used in place of a \fB:\fR 517 the double-colon allows a target to be checked and updated with respect to 518 alternate dependency lists. When the target is out-of-date with respect to 519 dependencies listed in the first alternate, it is built according to the rule 520 for that entry. When out-of-date with respect to dependencies in another 521 alternate, it is built according the rule in that other entry. Implicit rules 522 do not apply to double-colon targets; you must supply a rule for each entry. If 523 no dependencies are specified, the rule is always performed. 524 .RE 525 526 .sp 527 .ne 2 528 .na 529 \fB\fItarget\fR [\fB+\fR \fItarget\fR.\|.\|.\|] \fB:\fR\fR 530 .ad 531 .sp .6 532 .RS 4n 533 Target group. The rule in the target entry builds all the indicated targets as 534 a group. It is normally performed only once per \fBmake\fR run, but is checked 535 for command dependencies every time a target in the group is encountered in the 536 dependency scan. 537 .RE 538 539 .sp 540 .ne 2 541 .na 542 \fB\fB%\fR\fR 543 .ad 544 .sp .6 545 .RS 4n 546 Pattern matching wild card metacharacter. Like the \fB*\fR shell wild card, 547 \fB%\fR matches any string of zero or more characters in a target name or 548 dependency, in the target portion of a conditional macro definition, or within 549 a pattern replacement macro reference. Notice that only one \fB%\fR can appear 550 in a target, dependency-name, or pattern-replacement macro reference. 551 .RE 552 553 .sp 554 .ne 2 555 .na 556 \fB\fB\&./\fR\fIpathname\fR\fR 557 .ad 558 .sp .6 559 .RS 4n 560 \fBmake\fR ignores the leading \fB\&./\fR characters from targets with names 561 given as pathnames relative to "dot," the working directory. 562 .RE 563 564 .SS "\fIMacros\fR" 565 .ne 2 566 .na 567 \fB\fB=\fR\fR 568 .ad 569 .RS 9n 570 Macro definition. The word to the left of this character is the macro name; 571 words to the right comprise its value. Leading and trailing white space 572 characters are stripped from the value. A word break following the \fB=\fR is 573 implied. 574 .RE 575 576 .sp 577 .ne 2 578 .na 579 \fB\fB$\fR\fR 580 .ad 581 .RS 9n 582 Macro reference. The following character, or the parenthesized or bracketed 583 string, is interpreted as a macro reference: \fBmake\fR expands the reference 584 (including the \fB$\fR) by replacing it with the macro's value. 585 .RE 586 587 .sp 588 .ne 2 589 .na 590 \fB\fB( )\fR\fR 591 .ad 592 .br 593 .na 594 \fB\fB{ }\fR\fR 595 .ad 596 .RS 9n 597 Macro-reference name delimiters. A parenthesized or bracketed word appended to 598 a \fB$\fR is taken as the name of the macro being referred to. Without the 599 delimiters, \fBmake\fR recognizes only the first character as the macro name. 600 .RE 601 602 .sp 603 .ne 2 604 .na 605 \fB\fB$$\fR\fR 606 .ad 607 .RS 9n 608 A reference to the dollar-sign macro, the value of which is the character 609 \fB$\fR. Used to pass variable expressions beginning with \fB$\fR to the shell, 610 to refer to environment variables which are expanded by the shell, or to delay 611 processing of dynamic macros within the dependency list of a target, until that 612 target is actually processed. 613 .RE 614 615 .sp 616 .ne 2 617 .na 618 \fB\fB\e$\fR\fR 619 .ad 620 .RS 9n 621 Escaped dollar-sign character. Interpreted as a literal dollar sign within a 622 rule. 623 .RE 624 625 .sp 626 .ne 2 627 .na 628 \fB\fB+=\fR\fR 629 .ad 630 .RS 9n 631 When used in place of \fB=\fR, appends a string to a macro definition (must be 632 surrounded by white space, unlike \fB=\fR). 633 .RE 634 635 .sp 636 .ne 2 637 .na 638 \fB\fB:=\fR\fR 639 .ad 640 .RS 9n 641 Conditional macro assignment. When preceded by a list of targets with explicit 642 target entries, the macro definition that follows takes effect when processing 643 only those targets, and their dependencies. 644 .RE 645 646 .sp 647 .ne 2 648 .na 649 \fB\fB:sh\fR \fB=\fR\fR 650 .ad 651 .RS 9n 652 Define the value of a macro to be the output of a command (see Command 653 Substitutions below). 654 .RE 655 656 .sp 657 .ne 2 658 .na 659 \fB\fB:sh\fR\fR 660 .ad 661 .RS 9n 662 In a macro reference, execute the command stored in the macro, and replace the 663 reference with the output of that command (see \fBCommand Substitutions\fR 664 below). 665 .RE 666 667 .SS "\fIRules\fR" 668 .ne 2 669 .na 670 \fB\fB+\fR\fR 671 .ad 672 .RS 8n 673 \fBmake\fR always executes the commands preceded by a "\fB+\fR", even when 674 \fB-n\fR is specified. 675 .RE 676 677 .sp 678 .ne 2 679 .na 680 \fB\fB\(mi\fR\fR 681 .ad 682 .RS 8n 683 \fBmake\fR ignores any nonzero error code returned by a command line for which 684 the first non-\fBTAB\fR character is a \fB\(mi\fR\&. This character is not 685 passed to the shell as part of the command line. \fBmake\fR normally terminates 686 when a command returns nonzero status, unless the \fB-i\fR or \fB-k\fR options, 687 or the \fB\&.IGNORE:\fR special-function target is in effect. 688 .RE 689 690 .sp 691 .ne 2 692 .na 693 \fB\fB@\fR\fR 694 .ad 695 .RS 8n 696 If the first non-\fBTAB\fR character is a \fB@\fR, \fBmake\fR does not print 697 the command line before executing it. This character is not passed to the 698 shell. 699 .RE 700 701 .sp 702 .ne 2 703 .na 704 \fB\fB?\fR\fR 705 .ad 706 .RS 8n 707 Escape command-dependency checking. Command lines starting with this character 708 are not subject to command dependency checking. 709 .RE 710 711 .sp 712 .ne 2 713 .na 714 \fB\fB!\fR\fR 715 .ad 716 .RS 8n 717 Force command-dependency checking. Command-dependency checking is applied to 718 command lines for which it would otherwise be suppressed. This checking is 719 normally suppressed for lines that contain references to the \fB?\fR dynamic 720 macro (for example, \fB$?\fR). 721 .sp 722 When any combination of \fB+\fR, \fB\(mi\fR, \fB@\fR, \fB?\fR, or \fB!\fR 723 appear as the first characters after the \fBTAB\fR, all that are present apply. 724 None are passed to the shell. 725 .RE 726 727 .SS "Special-Function Targets" 728 .LP 729 When incorporated in a makefile, the following target names perform 730 special-functions: 731 .sp 732 .ne 2 733 .na 734 \fB\fB\&.DEFAULT:\fR\fR 735 .ad 736 .RS 23n 737 If it has an entry in the makefile, the rule for this target is used to process 738 a target when there is no other entry for it, no rule for building it, and no 739 \fBSCCS\fR history file from which to retrieve a current version. \fBmake\fR 740 ignores any dependencies for this target. 741 .RE 742 743 .sp 744 .ne 2 745 .na 746 \fB\fB\&.DONE:\fR\fR 747 .ad 748 .RS 23n 749 If defined in the makefile, \fBmake\fR processes this target and its 750 dependencies after all other targets are built. This target is also performed 751 when \fBmake\fR halts with an error, unless the \fB\&.FAILED\fR target is 752 defined. 753 .RE 754 755 .sp 756 .ne 2 757 .na 758 \fB\fB\&.FAILED:\fR\fR 759 .ad 760 .RS 23n 761 This target, along with its dependencies, is performed instead of \fB\&.DONE\fR 762 when defined in the makefile and \fBmake\fR halts with an error. 763 .RE 764 765 .sp 766 .ne 2 767 .na 768 \fB\fB\&.GET_POSIX:\fR\fR 769 .ad 770 .RS 23n 771 This target contains the rule for retrieving the current version of an 772 \fBSCCS\fR file from its history file in the current working directory. 773 \fBmake\fR uses this rule when it is running in POSIX mode. 774 .RE 775 776 .sp 777 .ne 2 778 .na 779 \fB\fB\&.IGNORE:\fR\fR 780 .ad 781 .RS 23n 782 Ignore errors. When this target appears in the makefile, \fBmake\fR ignores 783 non-zero error codes returned from commands. When used in POSIX mode, 784 \fB\&.IGNORE\fR could be followed by target names only, for which the errors is 785 ignored. 786 .RE 787 788 .sp 789 .ne 2 790 .na 791 \fB\fB\&.INIT:\fR\fR 792 .ad 793 .RS 23n 794 If defined in the makefile, this target and its dependencies are built before 795 any other targets are processed. 796 .RE 797 798 .sp 799 .ne 2 800 .na 801 \fB\fB\&.KEEP_STATE:\fR\fR 802 .ad 803 .RS 23n 804 If this target is in effect, \fBmake\fR updates the state file, 805 \fB\&.make.state\fR, in the current directory. This target also activates 806 command dependencies, and hidden dependency checks. If either the 807 \fB\&.KEEP_STATE:\fR target appears in the makefile, or the environment 808 variable \fBKEEP_STATE\fR is set (\fBsetenv KEEP_STATE\fR), \fBmake\fR rebuilds 809 everything in order to collect dependency information, even if all the targets 810 were up to date due to previous \fBmake\fR runs. See also the Environment 811 Variables section. This target has no effect if used in POSIX mode. 812 .RE 813 814 .sp 815 .ne 2 816 .na 817 \fB\fB\&.KEEP_STATE_FILE:\fR\fR 818 .ad 819 .RS 23n 820 This target has no effect if used in POSIX mode. This target implies 821 \fB\&.KEEP_STATE\fR. If the target is followed by a filename, \fBmake\fR uses 822 it as the state file. If the target is followed by a directory name, \fBmake\fR 823 looks for a \fB\&.make.state\fR file in that directory. If the target is not 824 followed by any name, \fBmake\fR looks for \fB\&.make.state\fR file in the 825 current working directory. 826 .RE 827 828 .sp 829 .ne 2 830 .na 831 \fB\fB\&.MAKE_VERSION:\fR\fR 832 .ad 833 .RS 23n 834 A target-entry of the form: 835 .sp 836 .in +2 837 .nf 838 \&.MAKE_VERSION: VERSION\(mi\fInumber\fR 839 .fi 840 .in -2 841 842 enables version checking. If the version of \fBmake\fR differs from the version 843 indicated by a string like \fBVERSION-1.0\fR, \fBmake\fR issues a warning 844 message. 845 .RE 846 847 .sp 848 .ne 2 849 .na 850 \fB\fB\&.NO_PARALLEL:\fR\fR 851 .ad 852 .RS 23n 853 Currently, this target has no effect, it is, however, reserved for future use. 854 .RE 855 856 .sp 857 .ne 2 858 .na 859 \fB\fB\&.PARALLEL:\fR\fR 860 .ad 861 .RS 23n 862 Currently of no effect, but reserved for future use. 863 .RE 864 865 .sp 866 .ne 2 867 .na 868 \fB\fB\&.POSIX:\fR\fR 869 .ad 870 .RS 23n 871 This target enables POSIX mode. 872 .RE 873 874 .sp 875 .ne 2 876 .na 877 \fB\fB\&.PRECIOUS:\fR\fR 878 .ad 879 .RS 23n 880 List of files not to delete. \fBmake\fR does not remove any of the files listed 881 as dependencies for this target when interrupted. \fBmake\fR normally removes 882 the current target when it receives an interrupt. When used in POSIX mode, if 883 the target is not followed by a list of files, all the file are assumed 884 precious. 885 .RE 886 887 .sp 888 .ne 2 889 .na 890 \fB\fB\&.SCCS_GET:\fR\fR 891 .ad 892 .RS 23n 893 This target contains the rule for retrieving the current version of an 894 \fBSCCS\fR file from its history file. To suppress automatic retrieval, add an 895 entry for this target with an empty rule to your makefile. 896 .RE 897 898 .sp 899 .ne 2 900 .na 901 \fB\fB\&.SCCS_GET_POSIX:\fR\fR 902 .ad 903 .RS 23n 904 This target contains the rule for retrieving the current version of an 905 \fBSCCS\fR file from its history file. \fBmake\fR uses this rule when it is 906 running in POSIX mode. 907 .RE 908 909 .sp 910 .ne 2 911 .na 912 \fB\fB\&.SILENT:\fR\fR 913 .ad 914 .RS 23n 915 Run silently. When this target appears in the makefile, \fBmake\fR does not 916 echo commands before executing them. When used in POSIX mode, it could be 917 followed by target names, and only those are executed silently. 918 .RE 919 920 .sp 921 .ne 2 922 .na 923 \fB\fB\&.SUFFIXES:\fR\fR 924 .ad 925 .RS 23n 926 The suffixes list for selecting implicit rules (see The Suffixes List). 927 .RE 928 929 .sp 930 .ne 2 931 .na 932 \fB\fB\&.WAIT:\fR\fR 933 .ad 934 .RS 23n 935 Currently of no effect, but reserved for future use. 936 .RE 937 938 .SS "\fIClearing Special Targets\fR" 939 .LP 940 In this version of \fBmake\fR, you can clear the definition of the following 941 special targets by supplying entries for them with no dependencies and no rule: 942 .sp 943 .LP 944 \fB\&.DEFAULT, .SCCS_GET, and .SUFFIXES\fR 945 .SS "Command Dependencies" 946 .LP 947 When the \fB\&.KEEP_STATE:\fR target is effective, \fBmake\fR checks the 948 command for building a target against the state file. If the command has 949 changed since the last \fBmake\fR run, \fBmake\fR rebuilds the target. 950 .SS "Hidden Dependencies" 951 .LP 952 When the \fB\&.KEEP_STATE:\fR target is effective, \fBmake\fR reads reports 953 from \fBcpp\fR(1) and other compilation processors for any "hidden" files, such 954 as \fB#include\fR files. If the target is out of date with respect to any of 955 these files, \fBmake\fR rebuilds it. 956 .SS "Macros" 957 .LP 958 Entries of the form 959 .sp 960 .in +2 961 .nf 962 \fImacro\fR\fB=\fR\fIvalue\fR 963 .fi 964 .in -2 965 966 .sp 967 .LP 968 define macros. \fImacro\fR is the name of the macro, and \fIvalue\fR, which 969 consists of all characters up to a comment character or unescaped 970 \fBNEWLINE\fR, is the value. \fBmake\fR strips both leading and trailing white 971 space in accepting the value. 972 .sp 973 .LP 974 Subsequent references to the macro, of the forms: \fB$(\fR\fIname\fR\fB)\fR or 975 \fB${\fR\fIname\fR\fB}\fR are replaced by \fIvalue\fR. The parentheses or 976 brackets can be omitted in a reference to a macro with a single-character name. 977 .sp 978 .LP 979 Macro references can contain references to other macros, in which case nested 980 references are expanded first. 981 .SS "\fISuffix Replacement Macro References\fR" 982 .LP 983 Substitutions within macros can be made as follows: 984 .sp 985 .in +2 986 .nf 987 \fB$(\fR\fIname\fR\fB:\fR\fIstring1\fR\fB=\fR\fIstring2\fR\fB)\fR 988 .fi 989 .in -2 990 991 .sp 992 .LP 993 where \fIstring1\fR is either a suffix, or a word to be replaced in the macro 994 definition, and \fIstring2\fR is the replacement suffix or word. Words in a 995 macro value are separated by \fBSPACE\fR, \fBTAB\fR, and escaped \fBNEWLINE\fR 996 characters. 997 .SS "\fIPattern Replacement Macro References\fR" 998 .LP 999 Pattern matching replacements can also be applied to macros, with a reference 1000 of the form: 1001 .sp 1002 .in +2 1003 .nf 1004 \fB$(\fR\fIname\fR\fB:\fR \fIop\fR\fB%\fR\fIos\fR\fB=\fR \fInp\fR\fB%\fR\fIns\fR\fB)\fR 1005 .fi 1006 .in -2 1007 1008 .sp 1009 .LP 1010 where \fIop\fR is the existing (old) prefix and \fIos\fR is the existing (old) 1011 suffix, \fInp\fR and \fIns\fR are the new prefix and new suffix, respectively, 1012 and the pattern matched by \fB%\fR (a string of zero or more characters), is 1013 carried forward from the value being replaced. For example: 1014 .sp 1015 .in +2 1016 .nf 1017 \fBPROGRAM=fabricate 1018 DEBUG= $(PROGRAM:%=tmp/%\(mig)\fR 1019 .fi 1020 .in -2 1021 .sp 1022 1023 .sp 1024 .LP 1025 sets the value of \fBDEBUG\fR to \fBtmp/fabricate\(mig\fR. 1026 .sp 1027 .LP 1028 Notice that pattern replacement macro references cannot be used in the 1029 dependency list of a pattern matching rule; the \fB%\fR characters are not 1030 evaluated independently. Also, any number of \fB%\fR metacharacters can appear 1031 after the equal-sign. 1032 .SS "\fIAppending to a Macro\fR" 1033 .LP 1034 Words can be appended to macro values as follows: 1035 .sp 1036 .in +2 1037 .nf 1038 \fImacro\fR \fB+=\fR \fIword .\|.\|.\fR 1039 .fi 1040 .in -2 1041 1042 .SS "Special-Purpose Macros" 1043 .LP 1044 When the \fBMAKEFLAGS\fR variable is present in the environment, \fBmake\fR 1045 takes options from it, in combination with options entered on the command line. 1046 \fBmake\fR retains this combined value as the \fBMAKEFLAGS\fR macro, and 1047 exports it automatically to each command or shell it invokes. 1048 .sp 1049 .LP 1050 Notice that flags passed by way of \fBMAKEFLAGS\fR are only displayed when the 1051 \fB-d\fR, or \fB-dd\fR options are in effect. 1052 .sp 1053 .LP 1054 The \fBMAKE\fR macro is another special case. It has the value \fBmake\fR by 1055 default, and temporarily overrides the \fB-n\fR option for any line in which it 1056 is referred to. This allows nested invocations of \fBmake\fR written as: 1057 .sp 1058 .in +2 1059 .nf 1060 \fB$(MAKE)\fR .\|.\|. 1061 .fi 1062 .in -2 1063 1064 .sp 1065 .LP 1066 to run recursively, with the \fB-n\fR flag in effect for all commands but 1067 \fBmake\fR. This lets you use \fBmake\fR \fB-n\fR to test an entire hierarchy 1068 of makefiles. 1069 .sp 1070 .LP 1071 For compatibility with the 4.2 \fBBSD\fR \fBmake\fR, the \fBMFLAGS\fR macro is 1072 set from the \fBMAKEFLAGS\fR variable by prepending a \fB-\fR\&. \fBMFLAGS\fR 1073 is not exported automatically. 1074 .sp 1075 .LP 1076 The \fBSHELL\fR macro, when set to a single-word value such as 1077 \fB/usr/bin/csh\fR, indicates the name of an alternate shell to use. The 1078 default is \fB/bin/sh\fR. Notice that \fBmake\fR executes commands that contain 1079 no shell metacharacters itself. Built-in commands, such as \fBdirs\fR in the C 1080 shell, are not recognized unless the command line includes a metacharacter (for 1081 instance, a semicolon). This macro is neither imported from, nor exported to 1082 the environment, regardless of \fB-e\fR. To be sure it is set properly, you 1083 must define this macro within every makefile that requires it. 1084 .sp 1085 .LP 1086 The syntax of the \fBVPATH\fR macro is: 1087 .sp 1088 .in +2 1089 .nf 1090 \fBVPATH\fR = [ \fIpathname\fR [ : \fIpathname\fR ] ... ] 1091 .fi 1092 .in -2 1093 1094 .sp 1095 .LP 1096 \fBVPATH\fR specifies a list of directories to search for the files, which are 1097 targets or dependencies, when \fBmake\fR is executed. \fBVPATH\fR is also used 1098 in order to search for the \fBinclude\fR files mentioned in the particular 1099 makefile. 1100 .sp 1101 .LP 1102 When processing a target or a dependency or an include directive, \fBmake\fR 1103 checks the existence of the file with the same name in the current directory. 1104 If the file is found to be missing, \fBmake\fR searches for this file in the 1105 list of directories presented in \fBVPATH\fR (like the \fBPATH\fR variable in 1106 the shell). Unlike the \fBPATH\fR variable, \fBVPATH\fR is used in order to 1107 search for the files with relative pathnames. When \fBmake\fR attempts to apply 1108 implicit rules to the target, it also searches for the dependency files using 1109 \fBVPATH\fR. 1110 .sp 1111 .LP 1112 When the file is found using \fBVPATH\fR, internal macros \fB$@\fR, \fB@<\fR, 1113 \fB$?\fR, \fB$*\fR, and their alternative forms (with \fBD\fR or \fBF\fR 1114 appended) are set in accordance with the name derived from \fBVPATH\fR. For 1115 instance, if the target \fBsubdir/foo.o\fR is found in the directory 1116 \fB/aaa/bbb\fR using \fBVPATH\fR, then the value of the internal macro \fB$@\fR 1117 for this target is \fB/aaa/bbb/subdir/foo.o\fR. 1118 .sp 1119 .LP 1120 If a target or a dependency file is found using \fBVPATH\fR, then any 1121 occurrences of the word that is the same as the target name in the subsequent 1122 rules are replaced with the actual name of the target derived from \fBVPATH\fR. 1123 .sp 1124 .LP 1125 For example: 1126 .sp 1127 .in +2 1128 .nf 1129 \fBVPATH=./subdir 1130 file.o : file.c 1131 cc -c file.c -o file.o\fR 1132 .fi 1133 .in -2 1134 .sp 1135 1136 .sp 1137 .LP 1138 If \fBfile.c\fR is found in \fB\&./subdir\fR, then the command 1139 .sp 1140 .in +2 1141 .nf 1142 \fBcc -c ./subdir/file.c -o file.o\fR 1143 .fi 1144 .in -2 1145 .sp 1146 1147 .sp 1148 .LP 1149 are executed. 1150 .sp 1151 .LP 1152 The following macros are provided for use with cross-compilation: 1153 .sp 1154 .ne 2 1155 .na 1156 \fB\fBHOST_ARCH\fR\fR 1157 .ad 1158 .RS 15n 1159 The processor type of the host system. By default, this is the output of the 1160 \fBmach\fR(1) command, prepended with \fB-\fR\&. Under normal circumstances, 1161 this value should never be altered by the user. 1162 .RE 1163 1164 .sp 1165 .ne 2 1166 .na 1167 \fB\fBHOST_MACH\fR\fR 1168 .ad 1169 .RS 15n 1170 The machine architecture of the host system. By default, this is the output of 1171 the \fBarch\fR(1) command, prepended with \fB\(mi\fR\&. Under normal 1172 circumstances, this value should never be altered by the user. 1173 .RE 1174 1175 .sp 1176 .ne 2 1177 .na 1178 \fB\fBTARGET_ARCH\fR\fR 1179 .ad 1180 .RS 15n 1181 The processor type of the target system. By default, the output of \fBmach\fR, 1182 prepended with \fB\(mi\fR\&. 1183 .RE 1184 1185 .SS "Dynamic Macros" 1186 .LP 1187 There are several dynamically maintained macros that are useful as 1188 abbreviations within rules. They are shown here as references; if you were to 1189 define them, \fBmake\fR would simply override the definition. 1190 .sp 1191 .ne 2 1192 .na 1193 \fB\fB$*\fR\fR 1194 .ad 1195 .RS 6n 1196 The basename of the current target, derived as if selected for use with an 1197 implicit rule. 1198 .RE 1199 1200 .sp 1201 .ne 2 1202 .na 1203 \fB\fB$<\fR\fR 1204 .ad 1205 .RS 6n 1206 The name of a dependency file, derived as if selected for use with an implicit 1207 rule. 1208 .RE 1209 1210 .sp 1211 .ne 2 1212 .na 1213 \fB\fB$@\fR\fR 1214 .ad 1215 .RS 6n 1216 The name of the current target. This is the only dynamic macro whose value is 1217 strictly determined when used in a dependency list. (In which case it takes the 1218 form \fB$$@\fR.) 1219 .RE 1220 1221 .sp 1222 .ne 2 1223 .na 1224 \fB\fB$?\fR\fR 1225 .ad 1226 .RS 6n 1227 The list of dependencies that are newer than the target. Command-dependency 1228 checking is automatically suppressed for lines that contain this macro, just as 1229 if the command had been prefixed with a \fB?\fR. See the description of 1230 \fB?\fR, under \fBSpecial Character\fR Rules above. You can force this check 1231 with the \fB!\fR command-line prefix. 1232 .RE 1233 1234 .sp 1235 .ne 2 1236 .na 1237 \fB\fB$%\fR\fR 1238 .ad 1239 .RS 6n 1240 The name of the library member being processed. (See Library Maintenance 1241 below.) 1242 .RE 1243 1244 .sp 1245 .LP 1246 To refer to the \fB$@\fR dynamic macro within a dependency list, precede the 1247 reference with an additional \fB$\fR character (as in, \fB$$@\fR). Because 1248 \fBmake\fR assigns \fB$<\fR and \fB$*\fR as it would for implicit rules 1249 (according to the suffixes list and the directory contents), they can be 1250 unreliable when used within explicit target entries. 1251 .sp 1252 .LP 1253 These macros can be modified to apply either to the filename part, or the 1254 directory part of the strings they stand for, by adding an upper case \fBF\fR 1255 or \fBD\fR, respectively (and enclosing the resulting name in parentheses or 1256 braces). Thus, \fB$(@D)\fR refers to the directory part of the string \fB$@\fR; 1257 if there is no directory part, \fB\&.\fR is assigned. \fB$(@F)\fR refers to the 1258 filename part. 1259 .SS "Conditional Macro Definitions" 1260 .LP 1261 A macro definition of the form: 1262 .sp 1263 .in +2 1264 .nf 1265 \fItarget-list\fR \fB:=\fR \fImacro\fR \fB=\fR \fIvalue\fR 1266 .fi 1267 .in -2 1268 1269 .sp 1270 .LP 1271 indicates that when processing any of the targets listed \fIand their 1272 dependencies\fR, \fImacro\fR is to be set to the \fIvalue\fR supplied. Notice 1273 that if a conditional macro is referred to in a dependency list, the \fB$\fR 1274 must be delayed (use \fB$$\fR instead). Also, \fItarget-list\fR can contain a 1275 \fB%\fR pattern, in which case the macro is conditionally defined for all 1276 targets encountered that match the pattern. A pattern replacement reference can 1277 be used within the \fIvalue\fR. 1278 .sp 1279 .LP 1280 You can temporarily append to a macros value with a conditional definition of 1281 the form: 1282 .sp 1283 .in +2 1284 .nf 1285 \fItarget-list\fR \fB:=\fR \fImacro\fR \fB+=\fR \fIvalue\fR 1286 .fi 1287 .in -2 1288 1289 .SS "Predefined Macros" 1290 .LP 1291 \fBmake\fR supplies the macros shown in the table that follows for compilers 1292 and their options, host architectures, and other commands. Unless these macros 1293 are read in as environment variables, their values are not exported by 1294 \fBmake\fR. If you run \fBmake\fR with any of these set in the environment, it 1295 is a good idea to add commentary to the makefile to indicate what value each is 1296 expected to take. If \fB-r\fR is in effect, \fBmake\fR does not read the 1297 default makefile (\fB\&./make.rules\fR or \fB/usr/share/lib/make/make.rules\fR) 1298 in which these macro definitions are supplied. 1299 .sp 1300 1301 .sp 1302 .TS 1303 box; 1304 cw(1i) | cw(1.17i) | cw(3.33i) 1305 cw(1i) | cw(1.17i) | cw(3.33i) . 1306 \fITable of Predefined Macros\fR 1307 _ 1308 \fIUse\fR \fIMacro\fR \fIDefault Value\fR 1309 _ 1310 Library \fBAR\fR \fBar\fR 1311 Archives \fBARFLAGS\fR \fBrv\fR 1312 _ 1313 1314 Assembler \fBAS\fR \fBas\fR 1315 Commands \fBASFLAGS\fR 1316 \fBCOMPILE.s\fR \fB$(AS) $(ASFLAGS)\fR 1317 \fBCOMPILE.S\fR \fB$(CC) $(ASFLAGS) $(CPPFLAGS)\fR \fB-c\fR 1318 _ 1319 1320 C \fBCC\fR \fBcc\fR 1321 Compiler \fBCFLAGS\fR 1322 Commands \fBCPPFLAGS\fR 1323 \fBCOMPILE.c\fR \fB$(CC) $(CFLAGS) $(CPPFLAGS)\fR \fB-c\fR 1324 \fBLINK.c\fR \fB$(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS)\fR 1325 _ 1326 1327 C++ \fBCCC\fR \fBCC\fR 1328 Compiler \fBCCFLAGS\fR \fBCFLAGS\fR 1329 Commands \fBCPPFLAGS\fR 1330 \fBCOMPILE.cc\fR \fB$(CCC) $(CCFLAGS) $(CPPFLAGS)\fR \fB-c\fR 1331 \fBLINK.cc\fR \fB$(CCC) $(CCFLAGS) $(CPPFLAGS) $(LDFLAGS)\fR 1332 \fBCOMPILE.C\fR \fB$(CCC) $(CCFLAGS) $(CPPFLAGS)\fR \fB-c\fR 1333 \fBLINK.C\fR \fB$(CCC) $(CCFLAGS) $(CPPFLAGS) $(LDFLAGS)\fR 1334 _ 1335 1336 FORTRAN 77 \fBFC\fR \fBf77\fR 1337 Compiler \fBFFLAGS\fR 1338 Commands \fBCOMPILE.f\fR \fB$(FC) $(FFLAGS)\fR \fB-c\fR 1339 \fBLINK.f\fR \fB$(FC) $(FFLAGS) $(LDFLAGS)\fR 1340 \fBCOMPILE.F\fR \fB$(FC) $(FFLAGS) $(CPPFLAGS)\fR \fB-c\fR 1341 \fBLINK.F\fR \fB$(FC) $(FFLAGS) $(CPPFLAGS) $(LDFLAGS)\fR 1342 _ 1343 1344 FORTRAN 90 \fBFC\fR \fBf90\fR 1345 Compiler \fBF90FLAGS\fR 1346 Commands \fBCOMPILE.f90\fR \fB$(F90C) $(F90FLAGS)\fR \fB-c\fR 1347 \fBLINK.f90\fR \fB$(F90C) $(F90FLAGS) $(LDFLAGS)\fR 1348 \fBCOMPILE.ftn\fR \fB$(F90C) $(F90FLAGS) $(CPPFLAGS)\fR \fB-c\fR 1349 \fBLINK.ftn\fR T{ 1350 \fB$(F90C) $(F90FLAGS) $(CPPFLAGS) $(LDFLAGS)\fR 1351 T} 1352 _ 1353 1354 Link Editor \fBLD\fR \fBld\fR 1355 Command \fBLDFLAGS\fR 1356 _ 1357 1358 lex \fBLEX\fR \fBlex\fR 1359 Command \fBLFLAGS\fR 1360 \fBLEX.l\fR \fB$(LEX) $(LFLAGS)\fR \fB-t\fR 1361 _ 1362 1363 lint \fBLINT\fR \fBlint\fR 1364 Command \fBLINTFLAGS\fR 1365 \fBLINT.c\fR \fB$(LINT) $(LINTFLAGS) $(CPPFLAGS)\fR 1366 _ 1367 1368 Modula 2 \fBM2C\fR \fBm2c\fR 1369 Commands \fBM2FLAGS\fR 1370 \fBMODFLAGS\fR 1371 \fBDEFFLAGS\fR 1372 \fBCOMPILE.def\fR \fB$(M2C) $(M2FLAGS) $(DEFFLAGS)\fR 1373 \fBCOMPILE.mod\fR \fB$(M2C) $(M2FLAGS) $(MODFLAGS)\fR 1374 _ 1375 1376 Pascal \fBPC\fR \fBpc\fR 1377 Compiler \fBPFLAGS\fR 1378 Commands \fBCOMPILE.p\fR \fB$(PC) $(PFLAGS) $(CPPFLAGS)\fR \fB-c\fR 1379 \fBLINK.p\fR \fB$(PC) $(PFLAGS) $(CPPFLAGS) $(LDFLAGS)\fR 1380 _ 1381 1382 Ratfor \fBRFLAGS\fR 1383 Compilation \fBCOMPILE.r\fR \fB$(FC) $(FFLAGS) $(RFLAGS)\fR \fB-c\fR 1384 Commands \fBLINK.r\fR \fB$(FC) $(FFLAGS) $(RFLAGS) $(LDFLAGS)\fR 1385 _ 1386 1387 rm Command \fBRM\fR \fBrm\fR \fB-f\fR 1388 _ 1389 1390 sccs \fBSCCSFLAGS\fR 1391 Command \fBSCCSGETFLAGS\fR \fB-s\fR 1392 _ 1393 1394 yacc \fBYACC\fR \fByacc\fR 1395 Command \fBYFLAGS\fR 1396 \fBYACC.y\fR \fB$(YACC) $(YFLAGS)\fR 1397 _ 1398 1399 Suffixes List \fBSUFFIXES\fR T{ 1400 \fB\&.o .c .c~ .cc .cc~ .y .y~ .l .l~ .s .s~ .sh .sh~ .S .S~ .ln .h .h~ .f .f~ .F .F~ .mod .mod~ .sym .def .def~ .p .p~ .r .r~ .cps .cps~ .C .C~ .Y .Y~ .L .L .f90 .f90~ .ftn .ftn~\fR 1401 T} 1402 .TE 1403 1404 .SS "Implicit Rules" 1405 .LP 1406 When a target has no entry in the makefile, \fBmake\fR attempts to determine 1407 its class (if any) and apply the rule for that class. An implicit rule 1408 describes how to build any target of a given class, from an associated 1409 dependency file. The class of a target can be determined either by a pattern, 1410 or by a suffix; the corresponding dependency file (with the same basename) from 1411 which such a target might be built. In addition to a predefined set of implicit 1412 rules, \fBmake\fR allows you to define your own, either by pattern, or by 1413 suffix. 1414 .SS "\fIPattern Matching Rules\fR" 1415 .LP 1416 A target entry of the form: 1417 .sp 1418 .in +2 1419 .nf 1420 \fItp\fR\fB%\fR\fIts\fR:\|\fIdp\fR\fB%\fR\fIds\fR 1421 \fIrule\fR 1422 .fi 1423 .in -2 1424 .sp 1425 1426 .sp 1427 .LP 1428 is a pattern matching rule, in which \fItp\fR is a target prefix, \fIts\fR is a 1429 target suffix, \fIdp\fR is a dependency prefix, and \fIds\fR is a dependency 1430 suffix (any of which can be null). The \fB%\fR stands for a basename of zero or 1431 more characters that is matched in the target, and is used to construct the 1432 name of a dependency. When \fBmake\fR encounters a match in its search for an 1433 implicit rule, it uses the rule in that target entry to build the target from 1434 the dependency file. Pattern-matching implicit rules typically make use of the 1435 \fB$@\fR and \fB$<\fR dynamic macros as placeholders for the target and 1436 dependency names. Other, regular dependencies can occur in the dependency list; 1437 however, none of the regular dependencies can contain \fB%\fR. An entry of the 1438 form: 1439 .sp 1440 .in +2 1441 .nf 1442 \fItp\fR%\fIts\fR:\|[\fIdependency .\|.\|.\fR\|] \fIdp\fR%\fIds\fR\|[\fIdependency .\|.\|.\fR\|] 1443 \fIrule\fR 1444 .fi 1445 .in -2 1446 .sp 1447 1448 .sp 1449 .LP 1450 is a valid pattern matching rule. 1451 .SS "\fISuffix Rules\fR" 1452 .LP 1453 When no pattern matching rule applies, \fBmake\fR checks the target name to see 1454 if it ends with a suffix in the known suffixes list. If so, \fBmake\fR checks 1455 for any suffix rules, as well as a dependency file with same root and another 1456 recognized suffix, from which to build it. 1457 .sp 1458 .LP 1459 The target entry for a suffix rule takes the form: 1460 .sp 1461 .in +2 1462 .nf 1463 \fIDsTs\fR: \fIrule\fR 1464 .fi 1465 .in -2 1466 .sp 1467 1468 .sp 1469 .LP 1470 where \fITs\fR is the suffix of the target, \fIDs\fR is the suffix of the 1471 dependency file, and \fIrule\fR is the rule for building a target in the class. 1472 Both \fIDs\fR and \fITs\fR must appear in the suffixes list. (A suffix need not 1473 begin with a \fB\&.\fR to be recognized.) 1474 .sp 1475 .LP 1476 A suffix rule with only one suffix describes how to build a target having a 1477 null (or no) suffix from a dependency file with the indicated suffix. For 1478 instance, the \fB\&.c\fR rule could be used to build an executable program 1479 named \fBfile\fR from a C source file named \fBfile.c\fR. If a target with a 1480 null suffix has an explicit dependency, \fBmake\fR omits the search for a 1481 suffix rule. 1482 .sp 1483 1484 .sp 1485 .TS 1486 box; 1487 cw(1.57i) |cw(3.93i) 1488 cw(1.57i) |cw(3.93i) . 1489 T{ 1490 \fITable of Standard Implicit (Suffix) Rules for Assembly Files\fR 1491 T} 1492 _ 1493 \fIImplicit Rule Name\fR \fICommand Line\fR 1494 _ 1495 \fB\&.s.o\fR \fB$(COMPILE.s)\fR \fB-o\fR \fB$@ $<\fR 1496 _ 1497 1498 \fB\&.s.a\fR \fB$(COMPILE.s)\fR \fB-o\fR \fB$% $<\fR 1499 \fB$(AR) $(ARFLAGS) $@ $%\fR 1500 \fB$(RM) $%\fR 1501 _ 1502 1503 \fB\&.s~.o\fR \fB$(GET) $(GFLAGS)\fR \fB-p\fR \fB$< > $*.s\fR 1504 \fB$(COMPILE.s)\fR \fB-o\fR \fB$@ $*.s\fR 1505 _ 1506 1507 \fB\&.S.o\fR \fB$(COMPILE.S)\fR \fB-o\fR \fB$@ $<\fR 1508 _ 1509 1510 \fB\&.S.a\fR \fB$(COMPILE.S)\fR \fB-o\fR \fB$% $<\fR 1511 \fB$(AR) $(ARFLAGS) $@ $%\fR 1512 \fB$(RM) $%\fR 1513 _ 1514 1515 \fB\&.S~.o\fR \fB$(GET) $(GFLAGS)\fR \fB-p\fR \fB$< > $*.S\fR 1516 \fB$(COMPILE.S)\fR \fB-o\fR \fB$@ $*.S\fR 1517 _ 1518 1519 \fB\&.S~.a\fR \fB$(GET) $(GFLAGS)\fR \fB-p\fR \fB$< > $*.S\fR 1520 \fB$(COMPILE.S)\fR \fB-o\fR \fB$% $*.S\fR 1521 \fB$(AR) $(ARFLAGS) $@ $%\fR 1522 \fB$(RM) $%\fR 1523 .TE 1524 1525 .sp 1526 1527 .sp 1528 .TS 1529 box; 1530 cw(1.57i) |cw(3.93i) 1531 cw(1.57i) |cw(3.93i) . 1532 T{ 1533 \fITable of Standard Implicit (Suffix) Rules for C Files\fR 1534 T} 1535 _ 1536 \fIImplicit Rule Name\fR \fICommand Line\fR 1537 _ 1538 \fB\&.c\fR \fB$(LINK.c)\fR \fB-o\fR \fB$@ $< $(LDLIBS)\fR 1539 _ 1540 1541 \fB\&.c.ln\fR \fB$(LINT.c) $(OUTPUT_OPTION)\fR \fB-i\fR \fB$<\fR 1542 _ 1543 1544 \fB\&.c.o\fR \fB$(COMPILE.c) $(OUTPUT_OPTION) $<\fR 1545 _ 1546 1547 \fB\&.c.a\fR \fB$(COMPILE.c)\fR \fB-o\fR \fB$% $<\fR 1548 \fB$(AR) $(ARFLAGS) $@ $%\fR 1549 \fB$(RM) $%\fR 1550 _ 1551 1552 \fB\&.c~\fR \fB$(GET) $(GFLAGS)\fR \fB-p\fR \fB$< > $*.c\fR 1553 \fB$(CC) $(CFLAGS) $(LDFLAGS)\fR \fB-o\fR \fB$@ $*.c\fR 1554 _ 1555 1556 \fB\&.c~.o\fR \fB$(GET) $(GFLAGS)\fR \fB-p\fR \fB$< > $*.c\fR 1557 \fB$(CC) $(CFLAGS)\fR \fB-c\fR \fB$*.c\fR 1558 _ 1559 1560 \fB\&.c~.ln\fR \fB$(GET) $(GFLAGS)\fR \fB-p\fR \fB$< > $*.c\fR 1561 \fB$(LINT.c) $(OUTPUT_OPTION)\fR \fB-c\fR \fB$*.c\fR 1562 _ 1563 1564 \fB\&.c~.a\fR \fB$(GET) $(GFLAGS)\fR \fB-p\fR \fB$< > $*.c\fR 1565 \fB$(COMPILE.c)\fR \fB-o\fR \fB$% $*.c\fR 1566 \fB$(AR) $(ARFLAGS) $@ $%\fR 1567 \fB$(RM) $%\fR 1568 .TE 1569 1570 .sp 1571 1572 .sp 1573 .TS 1574 box; 1575 cw(1.57i) |cw(3.93i) 1576 cw(1.57i) |cw(3.93i) . 1577 T{ 1578 \fITable of Standard Implicit (Suffix) Rules for C++ Files\fR 1579 T} 1580 _ 1581 \fIImplicit Rule Name\fR \fICommand Line\fR 1582 _ 1583 \fB\&.cc\fR \fB$(LINK.cc)\fR \fB-o\fR \fB$@ $< $(LDLIBS)\fR 1584 _ 1585 1586 \fB\&.cc.o\fR \fB$(COMPILE.cc) $(OUTPUT_OPTION) $<\fR 1587 _ 1588 1589 \fB\&.cc.a\fR \fB$(COMPILE.cc)\fR \fB-o\fR \fB$% $<\fR 1590 \fB$(AR) $(ARFLAGS) $@ $%\fR 1591 \fB$(RM) $%\fR 1592 _ 1593 1594 \fB\&.cc~\fR \fB$(GET) $(GFLAGS)\fR \fB-p\fR \fB$< > $*.cc\fR 1595 \fB$(LINK.cc)\fR \fB-o\fR \fB$@ $*.cc $(LDLIBS)\fR 1596 _ 1597 1598 \fB\&.cc.o\fR \fB$(COMPILE.cc) $(OUTPUT_OPTION) $<\fR 1599 _ 1600 1601 \fB\&.cc~.o\fR \fB$(GET) $(GFLAGS)\fR \fB-p\fR \fB$< > $*.cc\fR 1602 \fB$(COMPILE.cc) $(OUTPUT_OPTION) $*.cc\fR 1603 _ 1604 1605 \fB\&.cc.a\fR \fB$(COMPILE.cc)\fR \fB-o\fR \fB$% $<\fR 1606 \fB$(AR) $(ARFLAGS) $@ $%\fR 1607 \fB$(RM) $%\fR 1608 _ 1609 1610 \fB\&.cc~.a\fR \fB$(GET) $(GFLAGS)\fR \fB-p\fR \fB$< > $*.cc\fR 1611 \fB$(COMPILE.cc)\fR \fB-o\fR \fB$% $*.cc\fR 1612 \fB$(AR) $(ARFLAGS) $@ $%\fR 1613 \fB$(RM) $%\fR 1614 _ 1615 1616 \fB\&.C\fR \fB$(LINK.C)\fR \fB-o\fR \fB$@ $< $(LDLIBS)\fR 1617 _ 1618 1619 \fB\&.C~\fR \fB$(GET) $(GFLAGS)\fR \fB-p\fR \fB$< > $*.C\fR 1620 \fB$(LINK.C)\fR \fB-o\fR \fB$@ $*.C $(LDLIBS)\fR 1621 _ 1622 1623 \fB\&.C.o\fR \fB$(COMPILE.C) $(OUTPUT_OPTION) $<\fR 1624 _ 1625 1626 \fB\&.C~.o\fR \fB$(GET) $(GFLAGS)\fR \fB-p\fR \fB$< > $*.C\fR 1627 \fB$(COMPILE.C) $(OUTPUT_OPTION) $*.C\fR 1628 _ 1629 1630 \fB\&.C.a\fR \fB$(COMPILE.C)\fR \fB-o\fR \fB$% $<\fR 1631 \fB$(AR) $(ARFLAGS) $@ $%\fR 1632 \fB$(RM) $%\fR 1633 _ 1634 1635 \fB\&.C~.a\fR \fB$(GET) $(GFLAGS)\fR \fB-p\fR \fB$< > $*.C\fR 1636 \fB$(COMPILE.C)\fR \fB-o\fR \fB$% $*.C\fR 1637 \fB$(AR) $(ARFLAGS) $@ $%\fR 1638 \fB$(RM) $%\fR 1639 .TE 1640 1641 .sp 1642 1643 .sp 1644 .TS 1645 box; 1646 cw(1.57i) |cw(3.93i) 1647 cw(1.57i) |cw(3.93i) . 1648 T{ 1649 \fITable of Standard Implicit (Suffix) Rules for FORTRAN 77 Files\fR 1650 T} 1651 _ 1652 \fIImplicit Rule Name\fR \fICommand Line\fR 1653 _ 1654 \fB\&.f\fR \fB$(LINK.f)\fR \fB-o\fR \fB$@ $< $(LDLIBS)\fR 1655 _ 1656 1657 \fB\&.f.o\fR \fB$(COMPILE.f) $(OUTPUT_OPTION) $<\fR 1658 _ 1659 1660 \fB\&.f.a\fR \fB$(COMPILE.f)\fR \fB-o\fR \fB$% $<\fR 1661 \fB$(AR) $(ARFLAGS) $@ $%\fR 1662 \fB$(RM) $%\fR 1663 _ 1664 1665 \fB\&.f\fR \fB$(LINK.f)\fR \fB-o\fR \fB$@ $< $(LDLIBS)\fR 1666 _ 1667 1668 \fB\&.f~\fR \fB$(GET) $(GFLAGS)\fR \fB-p\fR \fB$< > $*.f\fR 1669 \fB$(FC) $(FFLAGS) $(LDFLAGS)\fR \fB-o\fR \fB$@ $*.f\fR 1670 _ 1671 1672 \fB\&.f~.o\fR \fB$(GET) $(GFLAGS)\fR \fB-p\fR \fB$< > $*.f\fR 1673 \fB$(FC) $(FFLAGS)\fR \fB-c\fR \fB$*.f\fR 1674 _ 1675 1676 \fB\&.f~.a\fR \fB$(GET) $(GFLAGS)\fR \fB-p\fR \fB$< > $*.f\fR 1677 \fB$(COMPILE.f)\fR \fB-o\fR \fB$% $*.f\fR 1678 \fB$(AR) $(ARFLAGS) $@ $%\fR 1679 \fB$(RM) $%\fR 1680 _ 1681 1682 \fB\&.F\fR \fB$(LINK.F)\fR \fB-o\fR \fB$@ $< $(LDLIBS)\fR 1683 _ 1684 1685 \fB\&.F.o\fR \fB$(COMPILE.F) $(OUTPUT_OPTION) $<\fR 1686 _ 1687 1688 \fB\&.F.a\fR \fB$(COMPILE.F)\fR \fB-o\fR \fB$% $<\fR 1689 \fB$(AR) $(ARFLAGS) $@ $%\fR 1690 \fB$(RM) $%\fR 1691 _ 1692 1693 \fB\&.F~\fR \fB$(GET) $(GFLAGS)\fR \fB-p\fR \fB$< > $*.F\fR 1694 \fB$(FC) $(FFLAGS) $(LDFLAGS)\fR \fB-o\fR \fB$@ $*.F\fR 1695 _ 1696 1697 \fB\&.F~.o\fR \fB$(GET) $(GFLAGS)\fR \fB-p\fR \fB$< > $*.F\fR 1698 \fB$(FC) $(FFLAGS)\fR \fB-c\fR \fB$*.F\fR 1699 _ 1700 1701 \fB\&.F~.a\fR \fB$(GET) $(GFLAGS)\fR \fB-p\fR \fB$< > $*.F\fR 1702 \fB$(COMPILE.F)\fR \fB-o\fR \fB$% $*.F\fR 1703 \fB$(AR) $(ARFLAGS) $@ $%\fR 1704 \fB$(RM) $%\fR 1705 .TE 1706 1707 .sp 1708 1709 .sp 1710 .TS 1711 box; 1712 cw(1.57i) |cw(3.93i) 1713 cw(1.57i) |cw(3.93i) . 1714 T{ 1715 \fITable of Standard Implicit (Suffix) Rules for FORTRAN 90 Files\fR 1716 T} 1717 _ 1718 \fIImplicit Rule Name\fR \fICommand Line\fR 1719 _ 1720 \fB\&.f90\fR \fB$(LINK.f90)\fR \fB-o\fR \fB$@ $< $(LDLIBS)\fR 1721 _ 1722 1723 \fB\&.f90~\fR \fB$(GET) $(GFLAGS)\fR \fB-p\fR \fB$< > $*.f90\fR 1724 \fB$(LINK.f90)\fR \fB-o\fR \fB$@ $*.f90 $(LDLIBS)\fR 1725 _ 1726 1727 \fB\&.f90.o\fR \fB$(COMPILE.f90) $(OUTPUT_OPTION) $<\fR 1728 _ 1729 1730 \fB\&.f90~.o\fR \fB$(GET) $(GFLAGS)\fR \fB-p\fR \fB$< > $*.f90\fR 1731 \fB$(COMPILE.f90) $(OUTPUT_OPTION) $*.f90\fR 1732 _ 1733 1734 \fB\&.f90.a\fR \fB$(COMPILE.f90)\fR \fB-o\fR \fB$% $<\fR 1735 \fB$(AR) $(ARFLAGS) $@ $%\fR 1736 \fB$(RM) $%\fR 1737 _ 1738 1739 \fB\&.f90~.a\fR \fB$(GET) $(GFLAGS)\fR \fB-p\fR \fB$< > $*.f90\fR 1740 \fB$(COMPILE.f90)\fR \fB-o\fR \fB$% $*.f90\fR 1741 \fB$(AR) $(ARFLAGS) $@ $%\fR 1742 \fB$(RM) $%\fR 1743 _ 1744 1745 \fB\&.ftn\fR \fB$(LINK.ftn)\fR \fB-o\fR \fB$@ $< $(LDLIBS)\fR 1746 _ 1747 1748 \fB\&.ftn~\fR \fB$(GET) $(GFLAGS)\fR \fB-p\fR \fB$< > $*.ftn\fR 1749 \fB$(LINK.ftn)\fR \fB-o\fR \fB$@ $*.ftn $(LDLIBS)\fR 1750 _ 1751 1752 \fB\&.ftn.o\fR \fB$(COMPILE.ftn) $(OUTPUT_OPTION) $<\fR 1753 _ 1754 1755 \fB\&.ftn~.o\fR \fB$(GET) $(GFLAGS)\fR \fB-p\fR \fB$< > $*.ftn\fR 1756 \fB$(COMPILE.ftn) $(OUTPUT_OPTION) $*.ftn\fR 1757 _ 1758 1759 \fB\&.ftn.a\fR \fB$(COMPILE.ftn)\fR \fB-o\fR \fB$% $<\fR 1760 \fB$(AR) $(ARFLAGS) $@ $%\fR 1761 \fB$(RM) $%\fR 1762 _ 1763 1764 \fB\&.ftn~.a\fR \fB$(GET) $(GFLAGS)\fR \fB-p\fR \fB$< > $*.ftn\fR 1765 \fB$(COMPILE.ftn)\fR \fB-o\fR \fB$% $*.ftn\fR 1766 \fB$(AR) $(ARFLAGS) $@ $%\fR 1767 \fB$(RM) $%\fR 1768 .TE 1769 1770 .sp 1771 1772 .sp 1773 .TS 1774 box; 1775 cw(1.57i) |cw(3.93i) 1776 cw(1.57i) |cw(3.93i) . 1777 T{ 1778 \fITable of Standard Implicit (Suffix) Rules for lex Files\fR 1779 T} 1780 _ 1781 \fIImplicit Rule Name\fR \fICommand Line\fR 1782 _ 1783 \fB\&.l\fR \fB$(RM) $*.c\fR 1784 \fB$(LEX.l) $< > $*.c\fR 1785 \fB$(LINK.c)\fR \fB-o\fR \fB$@ $*.c $(LDLIBS)\fR 1786 \fB$(RM) $*.c\fR 1787 _ 1788 1789 \fB\&.l.c\fR \fB$(RM) $@\fR 1790 \fB$(LEX.l) $< > $@\fR 1791 _ 1792 1793 \fB\&.l.ln\fR \fB$(RM) $*.c\fR 1794 \fB$(LEX.l) $< > $*.c\fR 1795 \fB$(LINT.c)\fR \fB-o\fR \fB$@\fR \fB-i\fR \fB$*.c\fR 1796 \fB$(RM) $*.c\fR 1797 _ 1798 1799 \fB\&.l.o\fR \fB$(RM) $*.c\fR 1800 \fB$(LEX.l) $< > $*.c\fR 1801 \fB$(COMPILE.c)\fR \fB-o\fR \fB$@ $*.c\fR 1802 \fB$(RM) $*.c\fR 1803 _ 1804 1805 \fB\&.l~\fR \fB$(GET) $(GFLAGS)\fR \fB-p\fR \fB$< > $*.l\fR 1806 \fB$(LEX) $(LFLAGS) $*.l\fR 1807 \fB$(CC) $(CFLAGS)\fR \fB-c\fR \fBlex.yy.c\fR 1808 \fBrm\fR \fB-f\fR \fBlex.yy.c\fR 1809 \fBmv lex.yy.c $@\fR 1810 _ 1811 1812 \fB\&.l~.c\fR \fB$(GET) $(GFLAGS)\fR \fB-p\fR \fB$< > $*.l\fR 1813 \fB$(LEX) $(LFLAGS) $*.l\fR 1814 \fBmv lex.yy.c $@\fR 1815 _ 1816 1817 \fB\&.l~.ln\fR \fB$(GET) $(GFLAGS)\fR \fB-p\fR \fB$< > $*.l\fR 1818 \fB$(RM) $*.c\fR 1819 \fB$(LEX.l) $*.l > $*.c\fR 1820 \fB$(LINT.c)\fR \fB-o\fR \fB$@\fR \fB-i\fR \fB$*.c\fR 1821 \fB$(RM) $*.c\fR 1822 _ 1823 1824 \fB\&.l~.o\fR \fB$(GET) $(GFLAGS)\fR \fB-p\fR \fB$< > $*.l\fR 1825 \fB$(LEX) $(LFLAGS) $*.l\fR 1826 \fB$(CC) $(CFLAGS)\fR \fB-c\fR \fBlex.yy.c\fR 1827 \fBrm\fR \fB-f\fR \fBlex.yy.c\fR 1828 \fBmv lex.yy.c $@\fR 1829 .TE 1830 1831 .sp 1832 1833 .sp 1834 .TS 1835 box; 1836 cw(1.57i) |cw(3.93i) 1837 cw(1.57i) |cw(3.93i) . 1838 T{ 1839 \fITable of Standard Implicit (Suffix) Rules for Modula 2 Files\fR 1840 T} 1841 _ 1842 \fIImplicit Rule Name\fR \fICommand Line\fR 1843 _ 1844 \fB\&.mod\fR \fB$(COMPILE.mod)\fR \fB-o\fR \fB$@\fR \fB-e\fR \fB$@ $<\fR 1845 _ 1846 1847 \fB\&.mod.o\fR \fB$(COMPILE.mod)\fR \fB-o\fR \fB$@ $<\fR 1848 _ 1849 1850 \fB\&.def.sym\fR \fB$(COMPILE.def)\fR \fB-o\fR \fB$@ $<\fR 1851 _ 1852 1853 \fB\&.def~.sym\fR \fB$(GET) $(GFLAGS)\fR \fB-p\fR \fB$< > $*.def\fR 1854 \fB$(COMPILE.def)\fR \fB-o\fR\fB$@ $*.def\fR 1855 _ 1856 1857 \fB\&.mod~\fR \fB$(GET) $(GFLAGS)\fR \fB-p\fR \fB$< > $*.mod\fR 1858 \fB$(COMPILE.mod)\fR \fB-o\fR \fB$@\fR \fB-e\fR \fB$@ $*.mod\fR 1859 _ 1860 1861 \fB\&.mod~.o\fR \fB$(GET) $(GFLAGS)\fR \fB-p\fR \fB$< > $*.mod\fR 1862 \fB$(COMPILE.mod)\fR \fB-o\fR \fB$@ $*.mod\fR 1863 _ 1864 1865 \fB\&.mod~.a\fR \fB$(GET) $(GFLAGS)\fR \fB-p\fR \fB$< > $*.mod\fR 1866 \fB$(COMPILE.mod)\fR \fB-o\fR \fB$% $*.mod\fR 1867 \fB$(AR) $(ARFLAGS) $@ $%\fR 1868 \fB$(RM) $%\fR 1869 .TE 1870 1871 .sp 1872 1873 .sp 1874 .TS 1875 box; 1876 cw(1.57i) |cw(3.93i) 1877 cw(1.57i) |cw(3.93i) . 1878 T{ 1879 \fITable of Standard Implicit (Suffix) Rules for NeWS Files\fR 1880 T} 1881 _ 1882 \fIImplicit Rule Name\fR \fICommand Line\fR 1883 _ 1884 \fB\&.cps.h\fR \fBcps $*.cps\fR 1885 _ 1886 \fB\&.cps~.h\fR \fB$(GET) $(GFLAGS)\fR \fB-p\fR \fB$< > $*.cps\fR 1887 \fB$(CPS) $(CPSFLAGS) $*.cps\fR 1888 .TE 1889 1890 .sp 1891 1892 .sp 1893 .TS 1894 box; 1895 cw(1.57i) |cw(3.93i) 1896 cw(1.57i) |cw(3.93i) . 1897 T{ 1898 \fITable of Standard Implicit (Suffix) Rules for Pascal Files\fR 1899 T} 1900 _ 1901 \fIImplicit Rule Name\fR \fICommand Line\fR 1902 _ 1903 \fB\&.p\fR \fB$(LINK.p)\fR \fB-o\fR \fB$@ $< $(LDLIBS)\fR 1904 _ 1905 1906 \fB\&.p.o\fR \fB$(COMPILE.p) $(OUTPUT_OPTION) $<\fR 1907 _ 1908 1909 \fB\&.p~\fR \fB$(GET) $(GFLAGS)\fR \fB-p\fR \fB$< > $*.p\fR 1910 \fB$(LINK.p)\fR \fB-o\fR \fB$@ $*.p $(LDLIBS)\fR 1911 _ 1912 1913 \fB\&.p~.o\fR \fB$(GET) $(GFLAGS)\fR \fB-p\fR \fB$< > $*.p\fR 1914 \fB$(COMPILE.p) $(OUTPUT_OPTION) $*.p\fR 1915 _ 1916 1917 \fB\&.p~.a\fR \fB$(GET) $(GFLAGS)\fR \fB-p\fR \fB$< > $*.p\fR 1918 \fB$(COMPILE.p)\fR \fB-o\fR \fB$% $*.p\fR 1919 \fB$(AR) $(ARFLAGS) $@ $%\fR 1920 \fB$(RM) $%\fR 1921 .TE 1922 1923 .sp 1924 1925 .sp 1926 .TS 1927 box; 1928 cw(1.57i) |cw(3.93i) 1929 cw(1.57i) |cw(3.93i) . 1930 T{ 1931 \fITable of Standard Implicit (Suffix) Rules for Ratfor Files\fR 1932 T} 1933 _ 1934 \fIImplicit Rule Name\fR \fICommand Line\fR 1935 _ 1936 \fB\&.r\fR \fB$(LINK.r)\fR \fB-o\fR \fB$@ $< $(LDLIBS)\fR 1937 _ 1938 1939 \fB\&.r.o\fR \fB$(COMPILE.r) $(OUTPUT_OPTION) $<\fR 1940 _ 1941 1942 \fB\&.r.a\fR \fB$(COMPILE.r)\fR \fB-o\fR \fB$% $<\fR 1943 \fB$(AR) $(ARFLAGS) $@ $%\fR 1944 \fB$(RM) $%\fR 1945 _ 1946 1947 \fB\&.r~\fR \fB$(GET) $(GFLAGS)\fR \fB-p\fR \fB$< > $*.r\fR 1948 \fB$(LINK.r)\fR \fB-o\fR \fB$@ $*.r $(LDLIBS)\fR 1949 _ 1950 1951 \fB\&.r~.o\fR \fB$(GET) $(GFLAGS)\fR \fB-p\fR \fB$< > $*.r\fR 1952 \fB$(COMPILE.r) $(OUTPUT_OPTION) $*.r\fR 1953 _ 1954 1955 \fB\&.r~.a\fR \fB$(GET) $(GFLAGS)\fR \fB-p\fR \fB$< > $*.r\fR 1956 \fB$(COMPILE.r)\fR \fB-o\fR \fB$% $*.r\fR 1957 \fB$(AR) $(ARFLAGS) $@ $%\fR 1958 \fB$(RM) $%\fR 1959 .TE 1960 1961 .sp 1962 1963 .sp 1964 .TS 1965 box; 1966 cw(1.57i) |cw(3.93i) 1967 cw(1.57i) |cw(3.93i) . 1968 T{ 1969 \fITable of Standard Implicit (Suffix) Rules for SCCS Files\fR 1970 T} 1971 _ 1972 \fIImplicit Rule Name\fR \fICommand Line\fR 1973 _ 1974 \fB\&.SCCS_GET\fR T{ 1975 \fBsccs $(SCCSFLAGS) get $(SCCSGETFLAGS) $@\fR \fB-G\fR\fB$@\fR 1976 T} 1977 1978 _ 1979 1980 \fB\&.SCCS_GET_POSIX\fR \fBsccs $(SCCSFLAGS) get $(SCCSGETFLAGS) $@\fR 1981 _ 1982 1983 \fB\&.GET_POSIX\fR \fB$(GET) $(GFLAGS) s.$@\fR 1984 .TE 1985 1986 .sp 1987 1988 .sp 1989 .TS 1990 box; 1991 cw(1.57i) |cw(3.93i) 1992 cw(1.57i) |cw(3.93i) . 1993 T{ 1994 \fITable of Standard Implicit (Suffix) Rules for Shell Scripts\fR 1995 T} 1996 _ 1997 \fIImplicit Rule Name\fR \fICommand Line\fR 1998 _ 1999 \fB\&.sh\fR \fBcat $< >$@\fR 2000 \fBchmod +x $@\fR 2001 _ 2002 2003 \fB\&.sh~\fR \fB$(GET) $(GFLAGS)\fR \fB-p\fR \fB$< > $*.sh\fR 2004 \fBcp $*.sh $@\fR 2005 \fBchmod a+x $@\fR 2006 .TE 2007 2008 .sp 2009 2010 .sp 2011 .TS 2012 box; 2013 cw(1.57i) |cw(3.93i) 2014 cw(1.57i) |cw(3.93i) . 2015 T{ 2016 \fITable of Standard Implicit (Suffix) Rules for yacc Files\fR 2017 T} 2018 _ 2019 \fIImplicit Rule Name\fR \fICommand Line\fR 2020 _ 2021 \fB\&.y\fR \fB$(YACC.y) $<\fR 2022 \fB$(LINK.c)\fR \fB-o\fR \fB$@ y.tab.c $(LDLIBS)\fR 2023 \fB$(RM) y.tab.c\fR 2024 _ 2025 2026 \fB\&.y.c\fR \fB$(YACC.y) $<\fR 2027 \fBmv y.tab.c $@\fR 2028 _ 2029 2030 \fB\&.y.ln\fR \fB$(YACC.y) $<\fR 2031 \fB$(LINT.c)\fR \fB-o\fR \fB$@\fR \fB-i\fR \fBy.tab.c\fR 2032 \fB$(RM) y.tab.c\fR 2033 _ 2034 2035 \fB\&.y.o\fR \fB$(YACC.y) $<\fR 2036 \fB$(COMPILE.c)\fR \fB-o\fR \fB$@ y.tab.c\fR 2037 \fB$(RM) y.tab.c\fR 2038 _ 2039 2040 \fB\&.y~\fR \fB$(GET) $(GFLAGS)\fR \fB-p\fR \fB$< > $*.y\fR 2041 \fB$(YACC) $(YFLAGS) $*.y\fR 2042 \fB$(COMPILE.c)\fR \fB-o\fR \fB$@ y.tab.c\fR 2043 \fB$(RM) y.tab.c\fR 2044 _ 2045 2046 \fB\&.y~.c\fR \fB$(GET) $(GFLAGS)\fR \fB-p\fR \fB$< > $*.y\fR 2047 \fB$(YACC) $(YFLAGS) $*.y\fR 2048 \fBmv y.tab.c $@\fR 2049 _ 2050 2051 \fB\&.y~.ln\fR \fB$(GET) $(GFLAGS)\fR \fB-p\fR \fB$< > $*.y\fR 2052 \fB$(YACC.y) $*.y\fR 2053 \fB$(LINT.c)\fR \fB-o\fR \fB$@\fR \fB-i\fR \fBy.tab.c\fR 2054 \fB$(RM) y.tab.c\fR 2055 _ 2056 2057 \fB\&.y~.o\fR \fB$(GET) $(GFLAGS)\fR \fB-p\fR \fB$< > $*.y\fR 2058 \fB$(YACC) $(YFLAGS) $*.y\fR 2059 \fB$(CC) $(CFLAGS)\fR \fB-c\fR \fBy.tab.c\fR 2060 \fBrm\fR \fB-f\fR \fBy.tab.c\fR 2061 \fBmv y.tab.o $@\fR 2062 .TE 2063 2064 .sp 2065 .LP 2066 \fBmake\fR reads in the standard set of implicit rules from the file 2067 \fB/usr/share/lib/make/make.rules\fR, unless \fB-r\fR is in effect, or there is 2068 a \fBmake.rules\fR file in the local directory that does not \fBinclude\fR that 2069 file. 2070 .SS "The Suffixes List" 2071 .LP 2072 The suffixes list is given as the list of dependencies for the 2073 \fB\&.SUFFIXES:\fR special-function target. The default list is contained in 2074 the \fBSUFFIXES\fR macro (See \fITable of Predefined Macros\fR for the standard 2075 list of suffixes). You can define additional \fB\&.SUFFIXES:\fR targets; a 2076 \fB\&.SUFFIXES\fR target with no dependencies clears the list of suffixes. 2077 Order is significant within the list; \fBmake\fR selects a rule that 2078 corresponds to the target's suffix and the first dependency-file suffix found 2079 in the list. To place suffixes at the head of the list, clear the list and 2080 replace it with the new suffixes, followed by the default list: 2081 .sp 2082 .in +2 2083 .nf 2084 .SUFFIXES: 2085 .SUFFIXES: \fIsuffixes\fR $(SUFFIXES) 2086 .fi 2087 .in -2 2088 2089 .sp 2090 .LP 2091 A tilde (\fB~\fR) indicates that if a dependency file with the indicated suffix 2092 (minus the ~) is under \fBSCCS\fR its most recent version should be retrieved, 2093 if necessary, before the target is processed. 2094 .SS "Library Maintenance" 2095 .LP 2096 A target name of the form: 2097 .sp 2098 .in +2 2099 .nf 2100 \fIlib\fR(\fImember ...\fR) 2101 .fi 2102 .in -2 2103 2104 .sp 2105 .LP 2106 refers to a member, or a space-separated list of members, in an \fBar\fR(1) 2107 library. 2108 .sp 2109 .LP 2110 The dependency of the library member on the corresponding file must be given as 2111 an explicit entry in the makefile. This can be handled by a pattern matching 2112 rule of the form: 2113 .sp 2114 .in +2 2115 .nf 2116 \fIlib\fR(%\fI\&.s\fR): %\fI\&.s\fR 2117 .fi 2118 .in -2 2119 2120 .sp 2121 .LP 2122 where \fI\&.s\fR is the suffix of the member; this suffix is typically 2123 \fB\&.o\fR for object libraries. 2124 .sp 2125 .LP 2126 A target name of the form: 2127 .sp 2128 .in +2 2129 .nf 2130 \fIlib\fR((\fIsymbol\fR)) 2131 .fi 2132 .in -2 2133 2134 .sp 2135 .LP 2136 refers to the member of a randomized object library that defines the entry 2137 point named \fIsymbol\fR. 2138 .SS "Command Execution" 2139 .LP 2140 Command lines are executed one at a time, \fIeach by its own process or 2141 shell\fR. Shell commands, notably \fBcd\fR, are ineffectual across an unescaped 2142 \fBNEWLINE\fR in the makefile. A line is printed (after macro expansion) just 2143 before being executed. This is suppressed if it starts with a \fB@\fR, if there 2144 is a \fB\&.SILENT:\fR entry in the makefile, or if \fBmake\fR is run with the 2145 \fB-s\fR option. Although the \fB-n\fR option specifies printing without 2146 execution, lines containing the macro \fB$(MAKE)\fR are executed regardless, 2147 and lines containing the \fB@\fR special character are printed. The \fB-t\fR 2148 (touch) option updates the modification date of a file without executing any 2149 rules. This can be dangerous when sources are maintained by more than one 2150 person. 2151 .sp 2152 .LP 2153 \fBmake\fR invokes the shell with the \fB-e\fR (exit-on-errors) argument. Thus, 2154 with semicolon-separated command sequences, execution of the later commands 2155 depends on the success of the former. This behavior can be overridden by 2156 starting the command line with a \fB\|-\fR, or by writing a shell script that 2157 returns a non-zero status only as it finds appropriate. 2158 .SS "Bourne Shell Constructs" 2159 .LP 2160 To use the Bourne shell \fBif\fR control structure for branching, use a command 2161 line of the form: 2162 .sp 2163 .in +2 2164 .nf 2165 if \fIexpression\fR ; \e 2166 then \fIcommand\fR ; \e 2167 ... ; \e 2168 else \fIcommand\fR; \e 2169 ... ; \e 2170 fi 2171 .fi 2172 .in -2 2173 2174 .sp 2175 .LP 2176 Although composed of several input lines, the escaped \fBNEWLINE\fR characters 2177 insure that \fBmake\fR treats them all as one (shell) command line. 2178 .sp 2179 .LP 2180 To use the Bourne shell \fBfor\fR control structure for loops, use a command 2181 line of the form: 2182 .sp 2183 .in +2 2184 .nf 2185 for \fIvar\fR in \fIlist\fR ; \e 2186 do \fIcommand\fR; \e 2187 ... \fB; \e\fRdone 2188 .fi 2189 .in -2 2190 2191 .sp 2192 .LP 2193 To refer to a shell variable, use a double-dollar-sign (\fB$$\fR). This 2194 prevents expansion of the dollar-sign by \fBmake\fR. 2195 .SS "Command Substitutions" 2196 .LP 2197 To incorporate the standard output of a shell command in a macro, use a 2198 definition of the form: 2199 .sp 2200 .in +2 2201 .nf 2202 \fIMACRO\|\fR:sh =\fIcommand\fR 2203 .fi 2204 .in -2 2205 2206 .sp 2207 .LP 2208 The command is executed only once, standard error output is discarded, and 2209 \fBNEWLINE\fR characters are replaced with \fBSPACE\fRs. If the command has a 2210 non-zero exit status, \fBmake\fR halts with an error. 2211 .sp 2212 .LP 2213 To capture the output of a shell command in a macro reference, use a reference 2214 of the form: 2215 .sp 2216 .in +2 2217 .nf 2218 $(\fIMACRO\|\fR:sh) 2219 .fi 2220 .in -2 2221 2222 .sp 2223 .LP 2224 where \fIMACRO\fR is the name of a macro containing a valid Bourne shell 2225 command line. In this case, the command is executed whenever the reference is 2226 evaluated. As with shell command substitutions, the reference is replaced with 2227 the standard output of the command. If the command has a non-zero exit status, 2228 \fBmake\fR halts with an error. 2229 .sp 2230 .LP 2231 In contrast to commands in rules, the command is not subject for macro 2232 substitution; therefore, a dollar sign (\fB$\fR) need not be replaced with a 2233 double dollar sign (\fB$$\fR). 2234 .SS "\fISignals\fR" 2235 .LP 2236 \fBINT\fR, \fBSIGTERM\fR, and \fBQUIT\fR signals received from the keyboard 2237 halt \fBmake\fR and remove the target file being processed unless that target 2238 is in the dependency list for \fB\&.PRECIOUS:\fR. 2239 .SH EXAMPLES 2240 .LP 2241 \fBExample 1 \fRDefining dependencies 2242 .sp 2243 .LP 2244 This makefile says that \fBpgm\fR depends on two files \fBa.o\fR and \fBb.o\fR, 2245 and that they in turn depend on their corresponding source files (\fBa.c\fR and 2246 \fBb.c\fR) along with a common file \fBincl.h\fR: 2247 2248 .sp 2249 .in +2 2250 .nf 2251 pgm: a.o b.o 2252 $(LINK.c) -o $@a.o b.o 2253 a.o: incl.h a.c 2254 cc -c a.c 2255 b.o: incl.h b.c 2256 cc -c b.c 2257 .fi 2258 .in -2 2259 2260 .LP 2261 \fBExample 2 \fRUsing implicit rules 2262 .sp 2263 .LP 2264 The following makefile uses implicit rules to express the same dependencies: 2265 2266 .sp 2267 .in +2 2268 .nf 2269 pgm: a.o b.o 2270 cc a.o b.o -o pgm 2271 a.o b.o: incl.h 2272 .fi 2273 .in -2 2274 2275 .SH ENVIRONMENT VARIABLES 2276 .LP 2277 See \fBenviron\fR(5) for descriptions of the following environment variables 2278 that affect the execution of \fBmake\fR: \fBLANG\fR, \fBLC_ALL\fR, 2279 \fBLC_CTYPE\fR, \fBLC_MESSAGES\fR, and \fBNLSPATH\fR. 2280 .sp 2281 .ne 2 2282 .na 2283 \fB\fBKEEP_STATE\fR\fR 2284 .ad 2285 .RS 17n 2286 This environment variable has the same effect as the .KEEP_STATE: 2287 special-function target. It enables command dependencies, hidden dependencies 2288 and writing of the state file. 2289 .RE 2290 2291 .sp 2292 .ne 2 2293 .na 2294 \fB\fBUSE_SVR4_MAKE\fR\fR 2295 .ad 2296 .RS 17n 2297 This environment variable causes \fBmake\fR to invoke the generic System V 2298 version of \fBmake\fR (\fB/usr/lib/svr4.make\fR). See \fBsysV-make\fR(1). 2299 .RE 2300 2301 .sp 2302 .ne 2 2303 .na 2304 \fB\fBMAKEFLAGS\fR\fR 2305 .ad 2306 .RS 17n 2307 This variable is interpreted as a character string representing a series of 2308 option characters to be used as the default options. The implementation accepts 2309 both of the following formats (but need not accept them when intermixed): 2310 .RS +4 2311 .TP 2312 1. 2313 The characters are option letters without the leading hyphens or blank 2314 character separation used on a command line. 2315 .RE 2316 .RS +4 2317 .TP 2318 2. 2319 The characters are formatted in a manner similar to a portion of the 2320 \fBmake\fR command line: options are preceded by hyphens and 2321 blank-character-separated. The \fImacro=name\fR macro definition operands can 2322 also be included. The difference between the contents of \fBMAKEFLAGS\fR and 2323 the command line is that the contents of the variable is not subjected to the 2324 word expansions associated with parsing the command line values. See 2325 \fBwordexp\fR(3C). 2326 .sp 2327 When the command-line options \fB-f\fR or \fB-p\fR are used, they take effect 2328 regardless of whether they also appear in \fBMAKEFLAGS\fR. If they otherwise 2329 appear in \fBMAKEFLAGS\fR, the result is undefined. 2330 .RE 2331 The \fBMAKEFLAGS\fR variable is accessed from the environment before the 2332 makefile is read. At that time, all of the options (except \fB-f\fR and 2333 \fB-p\fR) and command-line macros not already included in \fBMAKEFLAGS\fR are 2334 added to the \fBMAKEFLAGS\fR macro. The \fBMAKEFLAGS\fR macro is passed into 2335 the environment as an environment variable for all child processes. If the 2336 \fBMAKEFLAGS\fR macro is subsequently set by the makefile, it replaces the 2337 \fBMAKEFLAGS\fR variable currently found in the environment. 2338 .RE 2339 2340 .sp 2341 .ne 2 2342 .na 2343 \fB\fBPROJECTDIR\fR\fR 2344 .ad 2345 .RS 17n 2346 Provides a directory to be used to search for SCCS files not found in the 2347 current directory. In all of the following cases, the search for SCCS files is 2348 made in the directory SCCS in the identified directory. If the value of 2349 \fBPROJECTDIR\fR begins with a slash, it shall be considered an absolute 2350 pathname. Otherwise, the value of \fBPROJECTDIR\fR is treated as a user name 2351 and that user's initial working directory shall be examined for a subdirectory 2352 \fBsrc\fR or \fBsource\fR. If such a directory is found, it shall be used. 2353 Otherwise, the value is used as a relative pathname. 2354 .sp 2355 If \fBPROJECTDIR\fR is not set or has a null value, the search for SCCS files 2356 shall be made in the directory SCCS in the current directory. The setting of 2357 \fBPROJECTDIR\fR affects all files listed in the remainder of this utility 2358 description for files with a component named SCCS. 2359 .RE 2360 2361 .SH EXIT STATUS 2362 .LP 2363 When the \fB-q\fR option is specified, the \fBmake\fR utility exits with one of 2364 the following values: 2365 .sp 2366 .ne 2 2367 .na 2368 \fB\fB0\fR\fR 2369 .ad 2370 .RS 6n 2371 Successful completion. 2372 .RE 2373 2374 .sp 2375 .ne 2 2376 .na 2377 \fB\fB1\fR\fR 2378 .ad 2379 .RS 6n 2380 The target was not up-to-date. 2381 .RE 2382 2383 .sp 2384 .ne 2 2385 .na 2386 \fB\fB>1\fR\fR 2387 .ad 2388 .RS 6n 2389 An error occurred. 2390 .RE 2391 2392 .sp 2393 .LP 2394 When the \fB-q\fR option is not specified, the \fBmake\fR utility exits with 2395 one of the following values: 2396 .sp 2397 .ne 2 2398 .na 2399 \fB\fB0\fR\fR 2400 .ad 2401 .RS 6n 2402 Successful completion 2403 .RE 2404 2405 .sp 2406 .ne 2 2407 .na 2408 \fB\fB>0\fR\fR 2409 .ad 2410 .RS 6n 2411 An error occurred 2412 .RE 2413 2414 .SH FILES 2415 .ne 2 2416 .na 2417 \fB\fBmakefile\fR\fR 2418 .ad 2419 .br 2420 .na 2421 \fB\fBMakefile\fR\fR 2422 .ad 2423 .sp .6 2424 .RS 4n 2425 current version(s) of \fBmake\fR description file 2426 .RE 2427 2428 .sp 2429 .ne 2 2430 .na 2431 \fB\fBs.makefile\fR\fR 2432 .ad 2433 .br 2434 .na 2435 \fB\fBs.Makefile\fR\fR 2436 .ad 2437 .sp .6 2438 .RS 4n 2439 \fBSCCS\fR history files for the above makefile(s) in the current directory 2440 .RE 2441 2442 .sp 2443 .ne 2 2444 .na 2445 \fB\fBSCCS/s.makefile\fR\fR 2446 .ad 2447 .br 2448 .na 2449 \fB\fBSCCS/s.Makefile\fR\fR 2450 .ad 2451 .sp .6 2452 .RS 4n 2453 \fBSCCS\fR history files for the above makefile(s) 2454 .RE 2455 2456 .sp 2457 .ne 2 2458 .na 2459 \fB\fBmake.rules\fR\fR 2460 .ad 2461 .sp .6 2462 .RS 4n 2463 default file for user-defined targets, macros, and implicit rules 2464 .RE 2465 2466 .sp 2467 .ne 2 2468 .na 2469 \fB\fB/usr/share/lib/make/make.rules\fR\fR 2470 .ad 2471 .sp .6 2472 .RS 4n 2473 makefile for standard implicit rules and macros (not read if \fBmake.rules\fR 2474 is) 2475 .RE 2476 2477 .sp 2478 .ne 2 2479 .na 2480 \fB\fB\&.make.state\fR\fR 2481 .ad 2482 .sp .6 2483 .RS 4n 2484 state file in the local directory 2485 .RE 2486 2487 .SH ATTRIBUTES 2488 .LP 2489 See \fBattributes\fR(5) for descriptions of the following attributes: 2490 .SS "/usr/xpg4/bin/make" 2491 .TS 2492 box; 2493 cw(2.75i) |cw(2.75i) 2494 lw(2.75i) |lw(2.75i) . 2495 ATTRIBUTE TYPE ATTRIBUTE VALUE 2496 _ 2497 Interface Stability Committed 2498 _ 2499 Standard See \fBstandards\fR(5). 2500 .TE 2501 2502 .SH SEE ALSO 2503 .LP 2504 \fBar\fR(1), \fBarch\fR(1), \fBcd\fR(1), \fBcpp\fR(1), \fBlex\fR(1), 2505 \fBmach\fR(1), \fBsccs-get\fR(1), \fBsh\fR(1), \fBsysV-make\fR(1), 2506 \fByacc\fR(1), \fBwordexp\fR(3C), \fBpasswd\fR(4), \fBattributes\fR(5), 2507 \fBenviron\fR(5), \fBPOSIX.2\fR(5), \fBstandards\fR(5) 2508 .sp 2509 .LP 2510 \fISolaris Advanced User\&'s Guide\fR 2511 .SH DIAGNOSTICS 2512 .ne 2 2513 .na 2514 \fB\fBDon't know how to make target \fItarget\fR\fR\fR 2515 .ad 2516 .sp .6 2517 .RS 4n 2518 There is no makefile entry for \fItarget\fR, and none of \fBmake\fR's implicit 2519 rules apply (there is no dependency file with a suffix in the suffixes list, or 2520 the target's suffix is not in the list). 2521 .RE 2522 2523 .sp 2524 .ne 2 2525 .na 2526 \fB\fB***\fR \fItarget\fR \fBremoved.\fR\fR 2527 .ad 2528 .sp .6 2529 .RS 4n 2530 \fBmake\fR was interrupted while building \fItarget\fR. Rather than leaving a 2531 partially-completed version that is newer than its dependencies, \fBmake\fR 2532 removes the file named \fItarget\fR. 2533 .RE 2534 2535 .sp 2536 .ne 2 2537 .na 2538 \fB\fB***\fR \fItarget\fR \fBnot removed.\fR\fR 2539 .ad 2540 .sp .6 2541 .RS 4n 2542 \fBmake\fR was interrupted while building \fItarget\fR and \fItarget\fR was not 2543 present in the directory. 2544 .RE 2545 2546 .sp 2547 .ne 2 2548 .na 2549 \fB\fB***\fR \fItarget\fR \fBcould not be removed,\fR \fIreason\fR\fR 2550 .ad 2551 .sp .6 2552 .RS 4n 2553 \fBmake\fR was interrupted while building \fItarget\fR, which was not removed 2554 for the indicated reason. 2555 .RE 2556 2557 .sp 2558 .ne 2 2559 .na 2560 \fB\fBRead of include file\fR \fBfile\fR \fBfailed\fR\fR 2561 .ad 2562 .sp .6 2563 .RS 4n 2564 The makefile indicated in an \fBinclude\fR directive was not found, or was 2565 inaccessible. 2566 .RE 2567 2568 .sp 2569 .ne 2 2570 .na 2571 \fB\fBLoop detected when expanding macro value\fR \fImacro\fR\fB\&'\fR\fR 2572 .ad 2573 .sp .6 2574 .RS 4n 2575 A reference to the macro being defined was found in the definition. 2576 .RE 2577 2578 .sp 2579 .ne 2 2580 .na 2581 \fB\fBCould not write state file\fR \fIfile\fR\fB\fR\fR 2582 .ad 2583 .sp .6 2584 .RS 4n 2585 You used the \fB\&.KEEP_STATE:\fR target, but do not have write permission on 2586 the state file. 2587 .RE 2588 2589 .sp 2590 .ne 2 2591 .na 2592 \fB\fB***Error code\fR \fIn\fR\fR 2593 .ad 2594 .sp .6 2595 .RS 4n 2596 The previous shell command returned a nonzero error code. 2597 .RE 2598 2599 .sp 2600 .ne 2 2601 .na 2602 \fB\fB***\fR \fIsignal message\fR\fR 2603 .ad 2604 .sp .6 2605 .RS 4n 2606 The previous shell command was aborted due to a signal. If \fB- core dumped\fR 2607 appears after the message, a \fBcore\fR file was created. 2608 .RE 2609 2610 .sp 2611 .ne 2 2612 .na 2613 \fB\fBConditional macro conflict encountered\fR\fR 2614 .ad 2615 .sp .6 2616 .RS 4n 2617 Displayed only when \fB-d\fR is in effect, this message indicates that two or 2618 more parallel targets currently being processed depend on a target which is 2619 built differently for each by virtue of conditional macros. Since the target 2620 cannot simultaneously satisfy both dependency relationships, it is conflicted. 2621 .RE 2622 2623 .SH BUGS 2624 .LP 2625 Some commands return nonzero status inappropriately; to overcome this 2626 difficulty, prefix the offending command line in the rule with a \fB\(mi\fR\&. 2627 .sp 2628 .LP 2629 Filenames with the characters \fB=\fR, \fB:\fR, or \fB@\fR, do not work. 2630 .sp 2631 .LP 2632 You cannot build \fBfile.o\fR from \fBlib(file.o)\fR. 2633 .sp 2634 .LP 2635 Options supplied by \fBMAKEFLAGS\fR should be reported for nested \fBmake\fR 2636 commands. Use the \fB-d\fR option to find out what options the nested command 2637 picks up from \fBMAKEFLAGS\fR. 2638 .sp 2639 .LP 2640 This version of \fBmake\fR is incompatible in certain respects with previous 2641 versions: 2642 .RS +4 2643 .TP 2644 .ie t \(bu 2645 .el o 2646 The \fB-d\fR option output is much briefer in this version. \fB-dd\fR now 2647 produces the equivalent voluminous output. 2648 .RE 2649 .RS +4 2650 .TP 2651 .ie t \(bu 2652 .el o 2653 \fBmake\fR attempts to derive values for the dynamic macros \fB$*\fR, \fB$<\fR, 2654 and \fB$?\fR, while processing explicit targets. It uses the same method as for 2655 implicit rules; in some cases this can lead either to unexpected values, or to 2656 an empty value being assigned. (Actually, this was true for earlier versions as 2657 well, even though the documentation stated otherwise.) 2658 .RE 2659 .RS +4 2660 .TP 2661 .ie t \(bu 2662 .el o 2663 \fBmake\fR no longer searches for \fBSCCS\fR history (\fBs\fR.) files. 2664 .RE 2665 .RS +4 2666 .TP 2667 .ie t \(bu 2668 .el o 2669 Suffix replacement in macro references are now applied after the macro is 2670 expanded. 2671 .RE 2672 .sp 2673 .LP 2674 There is no guarantee that makefiles created for this version of \fBmake\fR 2675 work with earlier versions. 2676 .sp 2677 .LP 2678 If there is no \fBmake.rules\fR file in the current directory, and the file 2679 \fB/usr/share/lib/make/make.rules\fR is missing, \fBmake\fR stops before 2680 processing any targets. To force \fBmake\fR to run anyway, create an empty 2681 \fBmake.rules\fR file in the current directory. 2682 .sp 2683 .LP 2684 Once a dependency is made, \fBmake\fR assumes the dependency file is present 2685 for the remainder of the run. If a rule subsequently removes that file and 2686 future targets depend on its existence, unexpected errors can result. 2687 .sp 2688 .LP 2689 When hidden dependency checking is in effect, the \fB$?\fR macro's value 2690 includes the names of hidden dependencies. This can lead to improper filename 2691 arguments to commands when \fB$?\fR is used in a rule. 2692 .sp 2693 .LP 2694 Pattern replacement macro references cannot be used in the dependency list of a 2695 pattern matching rule. 2696 .sp 2697 .LP 2698 Unlike previous versions, this version of \fBmake\fR strips a leading 2699 \fB\&./\fR from the value of the \fB$@\fR dynamic macro. 2700 .sp 2701 .LP 2702 With automatic \fBSCCS\fR retrieval, this version of \fBmake\fR does not 2703 support tilde suffix rules. 2704 .sp 2705 .LP 2706 The only dynamic macro whose value is strictly determined when used in a 2707 dependency list is \fB$@\fR (takes the form \fB$$@\fR). 2708 .sp 2709 .LP 2710 \fBmake\fR invokes the shell with the \fB-e\fR argument. This cannot be 2711 inferred from the syntax of the rule alone.