Lines Matching +full:- +full:- +full:no +full:- +full:install +full:- +full:suggests
23 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
57 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
68 .EH 'PSD:12-%''PMake \*- A Tutorial'
69 .OH 'PMake \*- A Tutorial''PSD:12-%'
81 .\" into a table-of-contents, properly indented, etc. If the first argument
100 .\" CW is used to place a string in fixed-width or switch to a
101 .\" fixed-width font.
108 .\" Anything I put in a display I want to be in fixed-width
112 .\" The stuff in .No produces a little stop sign in the left margin
122 .po -\\n(g3u
129 .po -0.5i
144 \d\D'p -0.19i 0.0i 0.0i -0.13i 0.30i 0.0i 0.0i 0.13i'
151 \h'85u'\v'0.85n'\h-\w\\*(g9u/2u\&\\*(g9
169 PMake \*- A Tutorial
182 The University of California, Berkeley Softworks, and Adam de Boor make no
197 PMake is almost fully-compatible with Make, with which you may already
220 ``out-of-date.'' This file is known as a ``makefile'' and is usually
222 kept in the top-most directory of the system to be built. While you
231 .B \-f
233 .CW "pmake -f program.mk" ''). ``
234 .Ix 0 ref flags -f
260 the C files will need to be re-compiled should the header file be
269 one- or two-character operator.
289 the target can be re-created. The third operator is very similar to
291 out-of-date if it has no sources. These operations are represented by
292 the colon, the exclamation point and the double-colon, respectively, and are
298 ``out-of-date'' (and in need of creation) if
305 .Ix 0 def out-of-date
307 Under this operation, steps will be taken to re-create the target only
308 if it is found to be out-of-date by using these two rules.
312 If an exclamation point is used, the target will always be re-created,
314 and re-created, if necessary.
316 .Ix 0 def operator double-colon
318 If a double-colon is used, a target is out-of-date if:
325 the target has no sources.
328 If the target is out-of-date according to these rules, it will be re-created.
361 cannot be made by linking together .c files \*- it must be
364 it isn't the .c files that need to be re-created, it's the .o files.
365 If you think of dependencies in these terms \*- which files (targets)
366 need to be created from which files (sources) \*- you should have no problems.
387 Both targets and sources may contain the standard C-Shell wildcard
396 but the non-curly-brace ones may only appear in the final component
400 These enclose a comma-separated list of options and cause the pattern
418 contains those three files (and no other files that end in
425 .CW a-z , (
428 .CW [A-Za-z]
435 actually `re-created,' as he likes to spell it?''
436 The re-creation is accomplished by commands you place in the makefile.
440 .Ix 0 ref re-creation
459 .Ix 0 ref operator double-colon
463 If the double-colon was used, each dependency line for the target
465 if the target on the associated dependency line is out-of-date with
473 cc a.o b.o c.o \-o program
476 cc \-c a.c
478 cc \-c b.c
480 cc \-c c.c
486 on the dependency line is out-of-date, not the sources.
489 .Ix 0 ref out-of-date
491 .CW "cc \-c a.c" '' ``
494 is out-of-date. Because of the `:' operator,
505 will be considered out-of-date).
506 .Ix 0 ref out-of-date
513 If they are any combination of `@' and `\-', they cause PMake to do
533 The other special character is the `\-'. In case you didn't know,
537 non-zero if something went wrong. For this reason, PMake will consider
538 an error to have occurred if one of the shells it invokes returns a non-zero
540 whatever it's doing and exit with a non-zero status itself (any other
543 This behavior can be altered, however, by placing a `\-' at the front
545 .CW "\-mv index index.old" ''), (``
546 certain command-line arguments,
548 a case, the non-zero status is simply ignored and PMake keeps chugging
560 .B \-B
562 .Ix 0 ref flags -B
563 flag (it stands for backwards-compatible) that forces each command to
565 of which I discourage since they are now old-fashioned.\|.\|.\|.
571 that need to get input from the terminal won't work right \*- they'll
589 all upper-case letters (you don't
591 to use all upper-case letters.
594 Just tradition). Variables are assigned-to using lines of the form
600 appended-to by
607 conditionally assigned-to (if the variable isn't already defined) by
613 and assigned-to with expansion (i.e. the value is expanded (see below)
614 before being assigned to the variable\*-useful for placing a value at
629 VARIABLE != shell-command
631 .Ix 0 def variable assignment shell-output
634 .I shell-command
655 .CW "\-I/sprite/src/lib/libc \-O" ,'' ``
658 CFLAGS = \-I/sprite/src/lib/libc \-O
663 .CW "\-I/sprite/src/lib/libc \-O"
689 .B \-V ,
690 .B \-B
692 .B \-M .
694 .B \-V
696 .Ix 0 ref flags -V
697 .Ix 0 ref flags -B
698 .Ix 0 ref flags -M
709 variable is expanded (the expansion of an inner variable has no effect
724 Command-line variables.
725 .Ix 0 ref variable command-line
743 all its dependency lines), those sources that were out-of-date, etc.
753 The list of the sources for the target that were considered out-of-date.
797 .xH 3 Command-line Variables
799 .Ix 0 def variable command-line
800 Command-line variables are set when PMake is first invoked by giving a
803 pmake "CFLAGS = -I/sprite/src/lib/libc -O"
807 be a command-line variable with the given value. Any assignments to
809 in the makefile will have no effect, because once it
810 is set, there is (almost) nothing you can do to change a command-line
811 variable (the search order, you see). Command-line variables may be
817 command-line variables are performed before the makefile is read, thus
837 effect can no doubt be accomplished using the shell's own command
842 Global variables are those set or appended-to in the makefile.
847 period and always contain upper-case letters, only. The variables are
864 .B \-f
894 is examined by PMake for command-line flags, variable assignments,
902 top-most one.
908 cc $(.ALLSRC) \-o $(.TARGET)
911 cc \-c a.c
913 cc \-c b.c
915 cc \-c c.c
931 if PMake is operating in full-compatibility mode).
932 .Ix 0 ref flags -M
937 PMake was specifically designed to re-create several targets at once,
941 .B \-L
943 .B \-J
945 .Ix 0 ref flags -L
946 .Ix 0 ref flags -J
958 There is no way to change it. Thus you cannot run two of them at once
975 The other problem comes from improperly-specified dependencies that
976 worked in Make because of its sequential, depth-first way of examining
1009 It has no way to regulate input to different jobs,
1016 are two choices: (1) use one of the uncommonly-available makefile
1061 to you as no surprise when you write
1064 cc -o $(.TARGET) $(.ALLSRC)
1075 cc -c $(.ALLSRC)
1080 cc -c main.c defs.h
1085 cc -c main.c
1087 cc -c parse.c
1089 cc -c output.c
1110 There is no way to alter the way compilations are performed short of
1123 $(CC) $(CFLAGS) -o $(.TARGET) $(.ALLSRC)
1125 $(CC) $(CFLAGS) -c main.c
1127 $(CC) $(CFLAGS) -c parse.c
1129 $(CC) $(CFLAGS) -c output.c
1142 $(CC) $(CFLAGS) -o $(.TARGET) $(.ALLSRC)
1144 $(CC) $(CFLAGS) -c $(.PREFIX).c
1151 Once you've written the makefile comes the sometimes-difficult task of
1155 .B \-n
1156 .Ix 0 ref flags -n
1159 .B \-n
1167 .CW "-d m" '' ``
1168 .Ix 0 ref flags -d
1170 .CW "-p 2" .'' ``
1171 .Ix 0 ref flags -p
1176 .CW "-p 2" '' ``
1180 .CW "-p 2" '' ``
1215 They may appear in any order, interspersed with command-line variable
1218 .IP "\fB\-d\fP \fIwhat\fP"
1219 .Ix 0 def flags -d
1243 last modified; whether it is out-of-date; etc.
1249 The application of suffix-transformation rules. (See chapter 3)
1262 .B \-d
1266 .B \- ,
1269 .IP "\fB\-f\fP \fImakefile\fP"
1270 .Ix 0 def flags -f
1279 is ``\-'', PMake uses the standard input. This is useful for making
1282 .IP \fB\-h\fP
1283 .Ix 0 def flags -h
1287 .B \-J
1289 .B \-L )
1293 .IP \fB\-i\fP
1294 .Ix 0 def flags -i
1295 If you give this flag, PMake will ignore non-zero status returned
1296 by any of its shells. It's like placing a `\-' before all the commands
1298 .IP \fB\-k\fP
1299 .Ix 0 def flags -k
1301 .B \-i
1303 .B \-i ,
1305 .B \-k
1311 .IP \fB\-l\fP
1312 .Ix 0 def flags -l
1320 .B \-l
1322 prevent \fIyou\fP from invoking PMake twice in the same place \*- if
1324 .IP "\fB\-m\fP \fIdirectory\fP"
1325 .Ix 0 def flags -m
1328 .B \-m
1333 .IP \fB\-n\fP
1334 .Ix 0 def flags -n
1336 out-of-date targets in the makefile. Rather, PMake will simply print
1340 .IP "\fB\-p\fP \fInumber\fP"
1341 .Ix 0 def flags -p
1346 is a bitwise-or of 1 and 2 where 1 means it should print the input
1348 everything has been re-created. Thus
1349 .CW "\-p 3"
1350 would print it twice\*-once before processing and once after (you
1353 .IP \fB\-q\fP
1354 .Ix 0 def flags -q
1355 If you give PMake this flag, it will not try to re-create anything. It
1356 will just see if anything is out-of-date and exit non-zero if so.
1357 .IP \fB\-r\fP
1358 .Ix 0 def flags -r
1363 .IP \fB\-s\fP
1364 .Ix 0 def flags -s
1368 .IP \fB\-t\fP
1369 .Ix 0 def flags -t
1370 Rather than try to re-create a target, PMake will simply ``touch'' it
1371 so as to make it appear up-to-date. If the target didn't exist before,
1374 .IP \fB\-v\fP
1375 .Ix 0 def flags -v
1376 This is a mixed-compatibility flag intended to mimic the System V
1378 .B \-B ,
1380 .B \-V
1387 .IP \fB\-x\fP
1388 .Ix 0 def flags -x
1393 .IP \fB\-B\fP
1395 .Ix 0 def flags -B
1396 Forces PMake to be as backwards-compatible with Make as possible while
1411 .IP \fB\-C\fP
1412 .Ix 0 def flags -C
1415 .B \-C
1420 .B \-C
1435 .IP "\fB\-D\fP \fIvariable\fP"
1436 .Ix 0 def flags -D
1439 as its value. The variable is a global variable, not a command-line
1444 .IP "\fB\-I\fP \fIdirectory\fP"
1445 .Ix 0 def flags -I
1450 .IP "\fB\-J\fP \fInumber\fP"
1451 .Ix 0 def flags -J
1454 .IP "\fB\-L\fP \fInumber\fP"
1455 .Ix 0 def flags -L
1460 .IP \fB\-M\fP
1462 .Ix 0 def flags -M
1465 PMake, but it is non-parallel. This is the mode PMake enters if you
1468 .IP \fB\-P\fP
1469 .Ix 0 def flags -P
1472 once, each wanting to write its own two cent's-worth to the screen.
1486 .B \-P
1488 .IP \fB\-V\fP
1489 .Ix 0 def flags -V
1491 .B \-V
1494 .IP \fB\-W\fP
1495 .Ix 0 def flags -W
1501 up about anything non-fatal.
1502 .IP \fB\-X\fP
1503 .Ix 0 def flags -X
1507 Several flags may follow a single `\-'. Those flags that require
1510 pmake -fDnI server.mk DEBUG /chip2/X/server/include
1545 .CW - ', `
1549 .CW - '). `
1559 assigned-to using the
1563 operator, appended-to using the
1567 operator, conditionally (if the variable is undefined) assigned-to
1572 operator, and assigned-to with variable expansion with the
1580 .Ix 0 ref variable assignment shell-output
1606 .B \-n ,
1607 .B "\-d m" ,
1609 .B "\-p 2"
1614 .xH 1 Short-cuts and Other Nice Things
1644 suffix is usually a text file to be processed by Troff with the \-ms
1662 $(CC) $(CFLAGS) -c $(.IMPSRC)
1675 .CW \-c
1680 .CW "pmake -h" '' ``
1702 .B \-g
1708 .CW -g
1709 .CW "CFLAGS = -g" '') (``
1719 $(CC) -o $(.TARGET) $(.ALLSRC)
1730 cc -c a.c
1732 cc -c b.c
1734 cc -c c.c
1741 files \*- it's not mentioned anywhere in the new makefile. This is
1755 -rw-rw-r-- 1 deboor 34 Sep 7 00:43 Makefile
1756 -rw-rw-r-- 1 deboor 119 Oct 3 19:39 a.c
1757 -rw-rw-r-- 1 deboor 201 Sep 7 00:43 a.o
1758 -rw-rw-r-- 1 deboor 69 Sep 7 00:43 b.c
1763 .CW "pmake -d s" ''. ``
1769 applying .o -> .out to "a.o"
1772 applying .c -> .o to "a.c"
1775 applying .c -> .o to "b.c"
1788 --- a.o ---
1789 cc -c a.c
1790 --- b.o ---
1791 cc -c b.c
1792 --- a.out ---
1806 line \*- the earlier a suffix appears, the earlier it is checked as
1811 dependency line with no sources) and redefine them in the order you
1812 want. (Previously-defined transformation rules will be automatically
1813 redefined as the suffixes they involve are re-entered.)
1848 cc -c $(.IMPSRC)
1850 cc -o $(.TARGET) $(.IMPSRC)
1855 .CW "pmake -rd ms jive.out" ,'' ``
1864 applying .l -> .c to "jive.l"
1865 applying .c -> .o to "jive.c"
1866 applying .o -> .out to "jive.o"
1902 \(->
1904 \(->
1906 \(->
1910 three-step transformation, this is what PMake printed for the rest of
1915 applying .c -> .o to "jive.c"
1918 applying .l -> .c to "jive.l"
1920 Examining jive.l...modified 17:16:01 Oct 4, 1987...up-to-date
1921 Examining jive.c...nonexistent...out-of-date
1922 --- jive.c ---
1926 Examining jive.o...nonexistent...out-of-date
1927 --- jive.o ---
1928 cc -c jive.c
1929 Examining jive.out...nonexistent...out-of-date
1930 --- jive.out ---
1931 cc -o jive.out jive.o
1975 .B \-h
1977 .Ix 0 ref flags -h
1979 .B \-m
1981 .Ix 0 ref flags -m
1982 For files in double-quotes, the search is more complex:
1990 .B \-I
2002 You are free to use PMake variables in the filename\*-PMake will
2004 searching method with either angle brackets or double-quotes
2038 rm -f $(.TARGET)
2044 rm -f $(.TARGET)
2061 re-create everything without an error.
2066 period and are made up of all upper-case letters. There are various
2088 .B \-t
2090 .Ix 0 ref flags -t
2094 This attribute causes its shell script to be executed while having no
2113 echo -n '(load "' >> input
2114 echo -n ${i} >> input
2126 echo '(load-system)' > input
2135 .B \-t
2137 .Ix 0 ref flags -t
2171 if they all had `\-' before them.
2197 not-too-distant future.
2204 sources was out-of-date. In addition, the target's name,
2217 will need those libraries before it can be re-created. You can do
2221 cc -o $(.TARGET) $(.ALLSRC)
2232 In this case, PMake will re-create the
2255 .B \-t
2257 .Ix 0 ref flags -t
2265 it's out-of-date) even if you gave the
2266 .B \-n
2268 .B \-t
2271 pmake -n
2276 .B \-n
2287 .B "\-L 0"
2297 .B \-p
2299 .Ix 0 ref flags -p
2309 When PMake is interrupted (you type control-C at the keyboard), it
2310 will attempt to clean up after itself by removing any half-made
2316 .Ix 0 ref operator double-colon
2333 target's commands are added to the end. If more than one .USE-marked
2354 rm -f $(.TARGET)
2368 There is no limit to the number of times I could use the
2377 only target that may appear on the left-hand-side of the operator.
2381 begin with a period and consist of upper-case letters only.
2409 re-created (so long as no errors occurred). It also serves the extra
2426 .B \-i
2427 flag when you invoke PMake \*- errors are ignored for all commands.
2428 .Ix 0 ref flags -i
2444 .B \-I
2457 .CW "-I/usr/local/X/lib/bitmaps" '' ``
2462 cc $(.INCLUDES) -c xprogram.c
2479 .B \-L ,
2485 .B \-L
2501 .B \-f
2503 .B \-r
2504 flags have no effect.
2510 if, in fact, it has no known suffix. Only one suffix may be so
2517 directory. If you give no sources, it will clear out any directories
2539 attribute to each source on the dependency line, unless there are no
2567 attribute to each of its sources. If there are no sources on the
2569 .B \-s
2570 flag and no commands will be echoed.
2576 dependency line with no sources, PMake will forget about all the
2602 You may apply as many modifiers as you want \*- each one is applied to
2623 .CW [0-9]
2631 .CW "$(CFLAGS:M-[ID]*)" '' ``
2633 .CW \-I
2635 .CW \-D
2644 .IP "S/\fIsearch-string\fP/\fIreplacement-string\fP/[g]"
2648 .I search-string
2650 .I replacement-string ,
2656 .I search-string
2660 .I search-string
2667 .I search-string
2669 .I replacement-string ,
2675 .I search-string
2677 regular-expression/wildcard characters have any special meaning save
2685 .I search-string
2688 colon or exclamation point to separate the two strings. This so-called
2742 $(\fIVARIABLE\fP:\fIsearch-string\fP=\fIreplacement\fP)
2750 assembly-language source file (suffix
2752 Each program can be assembled into two versions, one with error-checking
2765 (Hint: assume the error-checking versions have
2776 What do you do? Hint: no further variable expansion is performed after
2844 $(CC) -o $(.TARGET) $(.ALLSRC)
2849 .CW "cc -o mumble ../lib/mumble.c" .'' ``
2866 \&\*- when it is first encountered \*- so any changes to the
2871 the directories each time, my experience suggests that the caching seldom
2874 rules through nonexistent files \*- the number of extra file-system
2891 .CW -lm
2894 and the linker thinks they're out-of-date if you so much as look at
2901 is out-of-date:
2904 library is out-of-date.
2907 .CW \-l name'' ``
2930 file is out-of-date. When figuring out how to make an archived member target
2931 (not the file itself, but the file in the archive \*- the
2971 rm -f $(.TARGET:T)
2979 that doesn't exist, the archived object file), the out-of-date ones
2982 a table of contents placed in the archive and the newly-archived
3013 rm -f $(.MEMBER)
3018 # Re-archive the out-of-date members and recreate the library's table of
3100 are only used if no targets were given on the command line).
3154 double-quotes, or a number. The standard C numeric conventions (except
3170 contains a non-zero value and
3200 .CW \-g
3202 .CW \-O
3209 .CW "pmake -D DEBUG" )
3213 CFLAGS += -g
3215 CFLAGS += -O
3227 FORMATTER = ditroff -Plaser_printer
3230 FORMATTER = nroff -Pdot_matrix_printer
3242 is used to execute the commands to re-create targets. PMake also allows you
3259 word and, if no other keywords are specified (other than
3266 .IP "\fBquiet=\fP\fIecho-off command\fP"
3272 off, echoing is expected to remain off until the echo-on command is given.
3273 .IP "\fBecho=\fP\fIecho-on command\fP"
3275 .IP "\fBfilter=\fP\fIprinted echo-off command\fP"
3276 Many shells will echo the echo-off command when it is given. This
3278 echo-off command. Wherever PMake sees this string in the shell's
3287 or the next flag begins with a `\-', the flags will be passed to the
3293 PMake wishes error-checking to be on from the very start. To this end,
3295 an initial `\-' apply as for the
3298 Just as for echo-control, error-control is achieved by inserting
3301 shell doesn't have error-control as commands, but I'll get into that
3306 another use if the shell doesn't do error-control, but I'll tell you
3308 .IP "\fBhasErrCtl=\fP\fIyes or no\fP"
3312 .B no .
3318 error-control, but you'd be wrong. If
3322 PMake uses the check and ignore commands in a straight-forward manner.
3324 .B no ,
3340 usual C backslash-characters (\en is newline, \er is return, \eb is
3341 backspace, \e' escapes a single-quote inside single-quotes, \e"
3342 escapes a double-quote inside double-quotes). Now for an example.
3359 quiet="set -" \e
3360 echo="set -x" \e
3361 filter="+ set - " \e
3365 check="set -e" \e
3379 .CW "set -" .
3382 .CW "set -x" .
3385 .CW "+ set - "
3387 .CW \-x
3389 .CW \-v
3396 .CW \-x
3400 specification begins with a \-.
3402 The flag to use to turn error-checking on from the start is
3403 .CW \-e .
3405 The shell can turn error-checking on and off, and the commands to do
3409 .CW "set -e" ,
3418 hasErrCtl=no \e
3420 ignore="sh -c '%s || exit 0\en"
3426 sh -c '\fIcmd\fP || true'
3436 to be executed only if the first command exited non-zero, and if the
3442 There are three (well, 3 \(12) levels of backwards-compatibility built
3446 .B \-B
3448 .B \-V )
3450 .xH 3 DEFCON 3 \*- Variable Expansion
3467 .B \-V
3471 .xH 3 DEFCON 2 \*- The Number of the Beast
3478 .B \-B
3484 install :: .MAKE
3485 (cd src; $(.PMAKE) install)
3486 (cd lib; $(.PMAKE) install)
3487 (cd man; $(.PMAKE) install)
3489 .Ix 0 ref operator double-colon
3495 .B \-n
3500 the install, leaving the main shell in the directory in which it started.
3501 .xH 3 "DEFCON 1 \*- Imitation is the Not the Highest Form of Flattery"
3511 .B \-M
3521 sources for each target are made in strict left-to-right order, etc.
3529 If no special characters exist in a command line, PMake will break the
3574 that the traversal is breadth-first and occurs in two passes.
3600 If the node has no children, it is placed at the end of
3606 is out-of-date. If it is, it is passed to a function that will execute
3610 examination queue. Likewise, if the node is up-to-date. Only those
3613 instructed it to create. When the examination queue is empty and no
3620 script. If there were no errors during the entire process but there
3623 a depth-first traversal of the graph to find all the targets that
3640 link -o $(.TARGET) $(.IMPSRC)
3642 asm -o $(.TARGET) -DDO_ERROR_CHECKING $(.IMPSRC)
3644 asm -o $(.TARGET) $(.IMPSRC)
3647 The trick to this one lies in the ``:='' variable-assignment operator
3648 and the ``:S'' variable-expansion modifier.
3669 it), since, as it says in the hint, PMake does no further substitution
3690 .Gp "command-line variable"
3702 source. `:' gives a straight time-wise dependency (if the target is
3703 older than the source, the target is out-of-date), while `!' provides
3704 simply an ordering and always considers the target out-of-date. `::'
3713 defined in the environment, but not over command-line or local variables.
3742 It has no effect on the variable itself.
3772 looking at it at the time \*- sort of like the wave/particle duality