Lines Matching +full:double +full:- +full:buffering
33 .EH 'PSD:12-%''PMake \*- A Tutorial'
34 .OH 'PMake \*- A Tutorial''PSD:12-%'
36 .\" into a table-of-contents, properly indented, etc. If the first argument
56 .\" CW is used to place a string in fixed-width or switch to a
57 .\" fixed-width font.
64 .\" Anything I put in a display I want to be in fixed-width
76 .po -0.5i
84 \D's -1u'\D't 5u'
86 …50u'\D'l 71u 0u'\D'l 50u 50u'\D'l 0u 71u'\D'l -50u 50u'\D'l -71u 0u'\D'l -50u -50u'\D'l 0u -71u'\D…
91 \h'53u'\D'p 14 68u 0u 46u 46u 0u 68u -46u 46u -68u 0u -47u -46u 0u -68u 47u -46u'
98 \h'85u'\v'0.85n'\h-\w\\*(g9u/2u\&\\*(g9
102 \D't 3u'\D's -1u'
115 PMake \*- A Tutorial
143 PMake is almost fully-compatible with Make, with which you may already
166 ``out-of-date.'' This file is known as a ``makefile'' and is usually
168 kept in the top-most directory of the system to be built. While you
177 .B \-f
179 .CW "pmake -f program.mk" ''). ``
180 .Ix 0 ref flags -f
206 the C files will need to be re-compiled should the header file be
215 one- or two-character operator.
235 the target can be re-created. The third operator is very similar to
237 out-of-date if it has no sources. These operations are represented by
238 the colon, the exclamation point and the double-colon, respectively, and are
244 ``out-of-date'' (and in need of creation) if
251 .Ix 0 def out-of-date
253 Under this operation, steps will be taken to re-create the target only
254 if it is found to be out-of-date by using these two rules.
258 If an exclamation point is used, the target will always be re-created,
260 and re-created, if necessary.
262 .Ix 0 def operator double-colon
264 If a double-colon is used, a target is out-of-date if:
274 If the target is out-of-date according to these rules, it will be re-created.
307 cannot be made by linking together .c files \*- it must be
310 it isn't the .c files that need to be re-created, it's the .o files.
311 If you think of dependencies in these terms \*- which files (targets)
312 need to be created from which files (sources) \*- you should have no problems.
333 Both targets and sources may contain the standard C-Shell wildcard
342 but the non-curly-brace ones may only appear in the final component
346 These enclose a comma-separated list of options and cause the pattern
371 .CW a-z , (
374 .CW [A-Za-z]
381 actually `re-created,' as he likes to spell it?''
382 The re-creation is accomplished by commands you place in the makefile.
386 .Ix 0 ref re-creation
405 .Ix 0 ref operator double-colon
409 If the double-colon was used, each dependency line for the target
411 if the target on the associated dependency line is out-of-date with
419 cc a.o b.o c.o \-o program
422 cc \-c a.c
424 cc \-c b.c
426 cc \-c c.c
432 on the dependency line is out-of-date, not the sources.
435 .Ix 0 ref out-of-date
437 .CW "cc \-c a.c" '' ``
440 is out-of-date. Because of the `:' operator,
451 will be considered out-of-date).
452 .Ix 0 ref out-of-date
459 If they are any combination of `@' and `\-', they cause PMake to do
479 The other special character is the `\-'. In case you didn't know,
483 non-zero if something went wrong. For this reason, PMake will consider
484 an error to have occurred if one of the shells it invokes returns a non-zero
486 whatever it's doing and exit with a non-zero status itself (any other
489 This behavior can be altered, however, by placing a `\-' at the front
491 .CW "\-mv index index.old" ''), (``
492 certain command-line arguments,
494 a case, the non-zero status is simply ignored and PMake keeps chugging
506 .B \-B
508 .Ix 0 ref flags -B
509 flag (it stands for backwards-compatible) that forces each command to
511 of which I discourage since they are now old-fashioned.\|.\|.\|.
517 that need to get input from the terminal won't work right \*- they'll
535 all upper-case letters (you don't
537 to use all upper-case letters.
540 Just tradition). Variables are assigned-to using lines of the form
546 appended-to by
553 conditionally assigned-to (if the variable isn't already defined) by
559 and assigned-to with expansion (i.e. the value is expanded (see below)
560 before being assigned to the variable\*-useful for placing a value at
575 VARIABLE != shell-command
577 .Ix 0 def variable assignment shell-output
580 .I shell-command
601 .CW "\-I/sprite/src/lib/libc \-O" ,'' ``
604 CFLAGS = \-I/sprite/src/lib/libc \-O
609 .CW "\-I/sprite/src/lib/libc \-O"
635 .B \-V ,
636 .B \-B
638 .B \-M .
640 .B \-V
642 .Ix 0 ref flags -V
643 .Ix 0 ref flags -B
644 .Ix 0 ref flags -M
670 Command-line variables.
671 .Ix 0 ref variable command-line
689 all its dependency lines), those sources that were out-of-date, etc.
699 The list of the sources for the target that were considered out-of-date.
743 .xH 3 Command-line Variables
745 .Ix 0 def variable command-line
746 Command-line variables are set when PMake is first invoked by giving a
749 pmake "CFLAGS = -I/sprite/src/lib/libc -O"
753 be a command-line variable with the given value. Any assignments to
756 is set, there is (almost) nothing you can do to change a command-line
757 variable (the search order, you see). Command-line variables may be
763 command-line variables are performed before the makefile is read, thus
788 Global variables are those set or appended-to in the makefile.
793 period and always contain upper-case letters, only. The variables are
810 .B \-f
840 is examined by PMake for command-line flags, variable assignments,
848 top-most one.
854 cc $(.ALLSRC) \-o $(.TARGET)
857 cc \-c a.c
859 cc \-c b.c
861 cc \-c c.c
877 if PMake is operating in full-compatibility mode).
878 .Ix 0 ref flags -M
883 PMake was specifically designed to re-create several targets at once,
887 .B \-L
889 .B \-J
891 .Ix 0 ref flags -L
892 .Ix 0 ref flags -J
921 The other problem comes from improperly-specified dependencies that
922 worked in Make because of its sequential, depth-first way of examining
962 are two choices: (1) use one of the uncommonly-available makefile
1010 cc -o $(.TARGET) $(.ALLSRC)
1021 cc -c $(.ALLSRC)
1026 cc -c main.c defs.h
1031 cc -c main.c
1033 cc -c parse.c
1035 cc -c output.c
1069 $(CC) $(CFLAGS) -o $(.TARGET) $(.ALLSRC)
1071 $(CC) $(CFLAGS) -c main.c
1073 $(CC) $(CFLAGS) -c parse.c
1075 $(CC) $(CFLAGS) -c output.c
1088 $(CC) $(CFLAGS) -o $(.TARGET) $(.ALLSRC)
1090 $(CC) $(CFLAGS) -c $(.PREFIX).c
1097 Once you've written the makefile comes the sometimes-difficult task of
1101 .B \-n
1102 .Ix 0 ref flags -n
1105 .B \-n
1113 .CW "-d m" '' ``
1114 .Ix 0 ref flags -d
1116 .CW "-p 2" .'' ``
1117 .Ix 0 ref flags -p
1122 .CW "-p 2" '' ``
1126 .CW "-p 2" '' ``
1161 They may appear in any order, interspersed with command-line variable
1164 .IP "\fB\-d\fP \fIwhat\fP"
1165 .Ix 0 def flags -d
1189 last modified; whether it is out-of-date; etc.
1195 The application of suffix-transformation rules. (See chapter 3)
1208 .B \-d
1212 .B \- ,
1215 .IP "\fB\-f\fP \fImakefile\fP"
1216 .Ix 0 def flags -f
1225 is ``\-'', PMake uses the standard input. This is useful for making
1228 .IP \fB\-h\fP
1229 .Ix 0 def flags -h
1233 .B \-J
1235 .B \-L )
1239 .IP \fB\-i\fP
1240 .Ix 0 def flags -i
1241 If you give this flag, PMake will ignore non-zero status returned
1242 by any of its shells. It's like placing a `\-' before all the commands
1244 .IP \fB\-k\fP
1245 .Ix 0 def flags -k
1247 .B \-i
1249 .B \-i ,
1251 .B \-k
1257 .IP \fB\-l\fP
1258 .Ix 0 def flags -l
1266 .B \-l
1268 prevent \fIyou\fP from invoking PMake twice in the same place \*- if
1270 .IP "\fB\-m\fP \fIdirectory\fP"
1271 .Ix 0 def flags -m
1274 .B \-m
1279 .IP \fB\-n\fP
1280 .Ix 0 def flags -n
1282 out-of-date targets in the makefile. Rather, PMake will simply print
1286 .IP "\fB\-p\fP \fInumber\fP"
1287 .Ix 0 def flags -p
1292 is a bitwise-or of 1 and 2 where 1 means it should print the input
1294 everything has been re-created. Thus
1295 .CW "\-p 3"
1296 would print it twice\*-once before processing and once after (you
1299 .IP \fB\-q\fP
1300 .Ix 0 def flags -q
1301 If you give PMake this flag, it will not try to re-create anything. It
1302 will just see if anything is out-of-date and exit non-zero if so.
1303 .IP \fB\-r\fP
1304 .Ix 0 def flags -r
1309 .IP \fB\-s\fP
1310 .Ix 0 def flags -s
1314 .IP \fB\-t\fP
1315 .Ix 0 def flags -t
1316 Rather than try to re-create a target, PMake will simply ``touch'' it
1317 so as to make it appear up-to-date. If the target didn't exist before,
1320 .IP \fB\-v\fP
1321 .Ix 0 def flags -v
1322 This is a mixed-compatibility flag intended to mimic the System V
1324 .B \-B ,
1326 .B \-V
1333 .IP \fB\-x\fP
1334 .Ix 0 def flags -x
1339 .IP \fB\-B\fP
1341 .Ix 0 def flags -B
1342 Forces PMake to be as backwards-compatible with Make as possible while
1357 .IP \fB\-C\fP
1358 .Ix 0 def flags -C
1361 .B \-C
1366 .B \-C
1381 .IP "\fB\-D\fP \fIvariable\fP"
1382 .Ix 0 def flags -D
1385 as its value. The variable is a global variable, not a command-line
1390 .IP "\fB\-I\fP \fIdirectory\fP"
1391 .Ix 0 def flags -I
1396 .IP "\fB\-J\fP \fInumber\fP"
1397 .Ix 0 def flags -J
1400 .IP "\fB\-L\fP \fInumber\fP"
1401 .Ix 0 def flags -L
1406 .IP \fB\-M\fP
1408 .Ix 0 def flags -M
1411 PMake, but it is non-parallel. This is the mode PMake enters if you
1414 .IP \fB\-P\fP
1415 .Ix 0 def flags -P
1418 once, each wanting to write its own two cent's-worth to the screen.
1428 its children) and buffering it until an entire line is received, then
1432 .B \-P
1434 .IP \fB\-V\fP
1435 .Ix 0 def flags -V
1437 .B \-V
1440 .IP \fB\-W\fP
1441 .Ix 0 def flags -W
1447 up about anything non-fatal.
1448 .IP \fB\-X\fP
1449 .Ix 0 def flags -X
1453 Several flags may follow a single `\-'. Those flags that require
1456 pmake -fDnI server.mk DEBUG /chip2/X/server/include
1491 .CW - ', `
1495 .CW - '). `
1505 assigned-to using the
1509 operator, appended-to using the
1513 operator, conditionally (if the variable is undefined) assigned-to
1518 operator, and assigned-to with variable expansion with the
1526 .Ix 0 ref variable assignment shell-output
1552 .B \-n ,
1553 .B "\-d m" ,
1555 .B "\-p 2"
1560 .xH 1 Short-cuts and Other Nice Things
1590 suffix is usually a text file to be processed by Troff with the \-ms
1608 $(CC) $(CFLAGS) -c $(.IMPSRC)
1621 .CW \-c
1626 .CW "pmake -h" '' ``
1648 .B \-g
1654 .CW -g
1655 .CW "CFLAGS = -g" '') (``
1665 $(CC) -o $(.TARGET) $(.ALLSRC)
1676 cc -c a.c
1678 cc -c b.c
1680 cc -c c.c
1687 files \*- it's not mentioned anywhere in the new makefile. This is
1701 -rw-rw-r-- 1 deboor 34 Sep 7 00:43 Makefile
1702 -rw-rw-r-- 1 deboor 119 Oct 3 19:39 a.c
1703 -rw-rw-r-- 1 deboor 201 Sep 7 00:43 a.o
1704 -rw-rw-r-- 1 deboor 69 Sep 7 00:43 b.c
1709 .CW "pmake -d s" ''. ``
1715 applying .o -> .out to "a.o"
1718 applying .c -> .o to "a.c"
1721 applying .c -> .o to "b.c"
1734 --- a.o ---
1735 cc -c a.c
1736 --- b.o ---
1737 cc -c b.c
1738 --- a.out ---
1752 line \*- the earlier a suffix appears, the earlier it is checked as
1758 want. (Previously-defined transformation rules will be automatically
1759 redefined as the suffixes they involve are re-entered.)
1794 cc -c $(.IMPSRC)
1796 cc -o $(.TARGET) $(.IMPSRC)
1801 .CW "pmake -rd ms jive.out" ,'' ``
1810 applying .l -> .c to "jive.l"
1811 applying .c -> .o to "jive.c"
1812 applying .o -> .out to "jive.o"
1848 \(->
1850 \(->
1852 \(->
1856 three-step transformation, this is what PMake printed for the rest of
1861 applying .c -> .o to "jive.c"
1864 applying .l -> .c to "jive.l"
1866 Examining jive.l...modified 17:16:01 Oct 4, 1987...up-to-date
1867 Examining jive.c...non-existent...out-of-date
1868 --- jive.c ---
1872 Examining jive.o...non-existent...out-of-date
1873 --- jive.o ---
1874 cc -c jive.c
1875 Examining jive.out...non-existent...out-of-date
1876 --- jive.out ---
1877 cc -o jive.out jive.o
1921 .B \-h
1923 .Ix 0 ref flags -h
1925 .B \-m
1927 .Ix 0 ref flags -m
1928 For files in double-quotes, the search is more complex:
1936 .B \-I
1948 You are free to use PMake variables in the filename\*-PMake will
1950 searching method with either angle brackets or double-quotes
1984 rm -f $(.TARGET)
1990 rm -f $(.TARGET)
2007 re-create everything without an error.
2012 period and are made up of all upper-case letters. There are various
2034 .B \-t
2036 .Ix 0 ref flags -t
2059 echo -n '(load "' >> input
2060 echo -n ${i} >> input
2072 echo '(load-system)' > input
2081 .B \-t
2083 .Ix 0 ref flags -t
2117 if they all had `\-' before them.
2143 not-too-distant future.
2150 sources was out-of-date. In addition, the target's name,
2163 will need those libraries before it can be re-created. You can do
2167 cc -o $(.TARGET) $(.ALLSRC)
2178 In this case, PMake will re-create the
2201 .B \-t
2203 .Ix 0 ref flags -t
2211 it's out-of-date) even if you gave the
2212 .B \-n
2214 .B \-t
2217 pmake -n
2222 .B \-n
2233 .B "\-L 0"
2243 .B \-p
2245 .Ix 0 ref flags -p
2255 When PMake is interrupted (you type control-C at the keyboard), it
2256 will attempt to clean up after itself by removing any half-made
2262 .Ix 0 ref operator double-colon
2279 target's commands are added to the end. If more than one .USE-marked
2300 rm -f $(.TARGET)
2323 only target that may appear on the left-hand-side of the operator.
2327 begin with a period and consist of upper-case letters only.
2355 re-created (so long as no errors occurred). It also serves the extra
2372 .B \-i
2373 flag when you invoke PMake \*- errors are ignored for all commands.
2374 .Ix 0 ref flags -i
2390 .B \-I
2403 .CW "-I/usr/local/X/lib/bitmaps" '' ``
2408 cc $(.INCLUDES) -c xprogram.c
2425 .B \-L ,
2431 .B \-L
2447 .B \-f
2449 .B \-r
2515 .B \-s
2548 You may apply as many modifiers as you want \*- each one is applied to
2569 .CW [0-9]
2577 .CW "$(CFLAGS:M-[ID]*)" '' ``
2579 .CW \-I
2581 .CW \-D
2590 .IP "S/\fIsearch-string\fP/\fIreplacement-string\fP/[g]"
2594 .I search-string
2596 .I replacement-string ,
2602 .I search-string
2606 .I search-string
2613 .I search-string
2615 .I replacement-string ,
2621 .I search-string
2623 regular-expression/wildcard characters have any special meaning save
2631 .I search-string
2634 colon or exclamation point to separate the two strings. This so-called
2688 $(\fIVARIABLE\fP:\fIsearch-string\fP=\fIreplacement\fP)
2696 assembly-language source file (suffix
2698 Each program can be assembled into two versions, one with error-checking
2711 (Hint: assume the error-checking versions have
2790 $(CC) -o $(.TARGET) $(.ALLSRC)
2795 .CW "cc -o mumble ../lib/mumble.c" .'' ``
2812 \&\*- when it is first encountered \*- so any changes to the
2820 rules through non-existent files \*- the number of extra file-system
2833 program you want. The main problem with archives is they double the
2837 .CW -lm
2840 and the linker thinks they're out-of-date if you so much as look at
2847 is out-of-date:
2850 library is out-of-date.
2853 .CW \-l name'' ``
2876 file is out-of-date. When figuring out how to make an archived member target
2877 (not the file itself, but the file in the archive \*- the
2917 rm -f $(.TARGET:T)
2925 that doesn't exist, the archived object file), the out-of-date ones
2928 a table of contents placed in the archive and the newly-archived
2959 rm -f $(.MEMBER)
2964 # Re-archive the out-of-date members and recreate the library's table of
3100 double-quotes, or a number. The standard C numeric conventions (except
3116 contains a non-zero value and
3146 .CW \-g
3148 .CW \-O
3155 .CW "pmake -D DEBUG" )
3159 CFLAGS += -g
3161 CFLAGS += -O
3173 FORMATTER = ditroff -Plaser_printer
3176 FORMATTER = nroff -Pdot_matrix_printer
3188 is used to execute the commands to re-create targets. PMake also allows you
3212 .IP "\fBquiet=\fP\fIecho-off command\fP"
3218 off, echoing is expected to remain off until the echo-on command is given.
3219 .IP "\fBecho=\fP\fIecho-on command\fP"
3221 .IP "\fBfilter=\fP\fIprinted echo-off command\fP"
3222 Many shells will echo the echo-off command when it is given. This
3224 echo-off command. Wherever PMake sees this string in the shell's
3233 or the next flag begins with a `\-', the flags will be passed to the
3239 PMake wishes error-checking to be on from the very start. To this end,
3241 an initial `\-' apply as for the
3244 Just as for echo-control, error-control is achieved by inserting
3247 shell doesn't have error-control as commands, but I'll get into that
3252 another use if the shell doesn't do error-control, but I'll tell you
3264 error-control, but you'd be wrong. If
3268 PMake uses the check and ignore commands in a straight-forward manner.
3285 double quotes (the quotes will be stripped off) and may contain the
3286 usual C backslash-characters (\en is newline, \er is return, \eb is
3287 backspace, \e' escapes a single-quote inside single-quotes, \e"
3288 escapes a double-quote inside double-quotes). Now for an example.
3305 quiet="set -" \e
3306 echo="set -x" \e
3307 filter="+ set - " \e
3311 check="set -e" \e
3325 .CW "set -" .
3328 .CW "set -x" .
3331 .CW "+ set - "
3333 .CW \-x
3335 .CW \-v
3342 .CW \-x
3346 specification begins with a \-.
3348 The flag to use to turn error-checking on from the start is
3349 .CW \-e .
3351 The shell can turn error-checking on and off, and the commands to do
3355 .CW "set -e" ,
3366 ignore="sh -c '%s || exit 0\en"
3372 sh -c '\fIcmd\fP || true'
3382 to be executed only if the first command exited non-zero, and if the
3388 There are three (well, 3 \(12) levels of backwards-compatibility built
3392 .B \-B
3394 .B \-V )
3396 .xH 3 DEFCON 3 \*- Variable Expansion
3413 .B \-V
3417 .xH 3 DEFCON 2 \*- The Number of the Beast
3424 .B \-B
3435 .Ix 0 ref operator double-colon
3441 .B \-n
3447 .xH 3 "DEFCON 1 \*- Imitation is the Not the Highest Form of Flattery"
3457 .B \-M
3467 sources for each target are made in strict left-to-right order, etc.
3520 that the traversal is breadth-first and occurs in two passes.
3552 is out-of-date. If it is, it is passed to a function that will execute
3556 examination queue. Likewise, if the node is up-to-date. Only those
3569 a depth-first traversal of the graph to find all the targets that
3586 link -o $(.TARGET) $(.IMPSRC)
3588 asm -o $(.TARGET) -DDO_ERROR_CHECKING $(.IMPSRC)
3590 asm -o $(.TARGET) $(.IMPSRC)
3593 The trick to this one lies in the ``:='' variable-assignment operator
3594 and the ``:S'' variable-expansion modifier.
3636 .Gp "command-line variable"
3648 source. `:' gives a straight time-wise dependency (if the target is
3649 older than the source, the target is out-of-date), while `!' provides
3650 simply an ordering and always considers the target out-of-date. `::'
3659 defined in the environment, but not over command-line or local variables.
3718 looking at it at the time \*- sort of like the wave/particle duality