forked from simonster/binica
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmsg
executable file
·708 lines (525 loc) · 32.9 KB
/
msg
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
MAKE(1) FreeBSD General Commands Manual MAKE(1)
NNAAMMEE
mmaakkee - maintain program dependencies
SSYYNNOOPPSSIISS
mmaakkee [--BBPPSSeeiikknnqqrrssttvv] [--DD _v_a_r_i_a_b_l_e] [--dd _f_l_a_g_s] [--EE _v_a_r_i_a_b_l_e] [--ff _m_a_k_e_f_i_l_e]
[--II _d_i_r_e_c_t_o_r_y] [--jj _m_a_x___j_o_b_s] [--mm _d_i_r_e_c_t_o_r_y] [--VV _v_a_r_i_a_b_l_e]
[_v_a_r_i_a_b_l_e=_v_a_l_u_e] [_t_a_r_g_e_t _._._.]
DDEESSCCRRIIPPTTIIOONN
MMaakkee is a program designed to simplify the maintenance of other programs.
Its input is a list of specifications describing dependency relationships
between the generation of files and programs. The first of `_m_a_k_e_f_i_l_e'
and `_M_a_k_e_f_i_l_e' that can be found in either the current directory or a
special object directory (see `_._O_B_J_D_I_R') will be read for this list of
specifications. If the file `_._d_e_p_e_n_d' can be found, it is also read (see
mkdep(1)).
This manual page is intended as a reference document only. For a more
thorough introduction to mmaakkee and makefiles, please refer to _M_a_k_e _- _A
_T_u_t_o_r_i_a_l.
The options are as follows:
--BB Try to be backwards compatible by executing a single shell per
command and by executing the commands to make the sources of a
dependency line in sequence. This is turned on by default unless
--jj is used.
--DD _v_a_r_i_a_b_l_e
Define _v_a_r_i_a_b_l_e to be 1, in the global context.
--dd _f_l_a_g_s
Turn on debugging, and specify which portions of mmaakkee are to
print debugging information. Argument _f_l_a_g_s is one or more of
the following:
_A Print all possible debugging information; equivalent to
specifying all of the debugging flags.
_a Print debugging information about archive searching and
caching.
_c Print debugging information about conditional evaluation.
_d Print debugging information about directory searching and
caching.
_f Print debugging information about the execution of for
loops. Currently a no-op.
_g_1 Print the input graph before making anything.
_g_2 Print the input graph after making everything, or before
exiting on error.
_j Print debugging information about running multiple
shells.
_l Print commands in Makefiles regardless of whether or not
they are prefixed by @ or other "quiet" flags. Also
known as "loud" behavior.
_m Print debugging information about making targets, includ-
ing modification dates.
_s Print debugging information about suffix-transformation
rules.
_t Print debugging information about target list mainte-
nance.
_v Print debugging information about variable assignment.
--EE _v_a_r_i_a_b_l_e
Specify a variable whose environment value (if any) will override
macro assignments within makefiles.
--ee Specify that environment values override macro assignments within
makefiles for all variables.
--ff _m_a_k_e_f_i_l_e
Specify a makefile to read instead of the default `_m_a_k_e_f_i_l_e' and
`_M_a_k_e_f_i_l_e'. If _m_a_k_e_f_i_l_e is `-', standard input is read. Multiple
makefiles may be specified, and are read in the order specified.
--II _d_i_r_e_c_t_o_r_y
Specify a directory in which to search for makefiles and included
makefiles. The system makefile directory (or directories, see
the --mm option) is automatically included as part of this list.
--ii Ignore non-zero exit of shell commands in the makefile. Equiva-
lent to specifying `-' before each command line in the makefile.
--jj _m_a_x___j_o_b_s
Specify the maximum number of jobs that mmaakkee may have running at
any one time. Turns compatibility mode off, unless the _B flag is
also specified.
--kk Continue processing after errors are encountered, but only on
those targets that do not depend on the target whose creation
caused the error.
--mm _d_i_r_e_c_t_o_r_y
Specify a directory in which to search for sys.mk and makefiles
included via the <...> style. Multiple directories can be added
to form a search path. This path will override the default sys-
tem include path: _/_u_s_r_/_s_h_a_r_e_/_m_k. Furthermore, the system include
path will be appended to the search path used for "..."-style in-
clusions (see the --II option).
--nn Display the commands that would have been executed, but do not
actually execute them.
--PP Collate the output of a given job and display it only when the
job finishes, instead of mixing the output of parallel jobs to-
gether. This option has no effect unless --jj is used too.
--qq Do not execute any commands, but exit 0 if the specified targets
are up-to-date and 1, otherwise.
--rr Do not use the built-in rules specified in the system makefile.
--SS Stop processing when an error is encountered. Default behaviour.
This is needed to negate the --kk option during recursive builds.
--ss Do not echo any commands as they are executed. Equivalent to
specifying `@@' before each command line in the makefile.
--tt Rather than re-building a target as specified in the makefile,
create it or update its modification time to make it appear up-
to-date.
--VV _v_a_r_i_a_b_l_e
Print mmaakkee's idea of the value of _v_a_r_i_a_b_l_e, in the global con-
text. Do not build any targets. Multiple instances of this op-
tion may be specified; the variables will be printed one per
line, with a blank line for each null or undefined variable.
--vv Be extra verbose. For multi-job makes, this will cause file ban-
ners to be generated.
_v_a_r_i_a_b_l_e=_v_a_l_u_e
Set the value of the variable _v_a_r_i_a_b_l_e to _v_a_l_u_e.
There are seven different types of lines in a makefile: file dependency
specifications, shell commands, variable assignments, include statements,
conditional directives, for loops, and comments.
In general, lines may be continued from one line to the next by ending
them with a backslash (`\'). The trailing newline character and initial
whitespace on the following line are compressed into a single space.
FFIILLEE DDEEPPEENNDDEENNCCYY SSPPEECCIIFFIICCAATTIIOONNSS
Dependency lines consist of one or more targets, an operator, and zero or
more sources. This creates a relationship where the targets ``depend''
on the sources and are usually created from them. The exact relationship
between the target and the source is determined by the operator that sep-
arates them. The three operators are as follows:
:: A target is considered out-of-date if its modification time is less
than those of any of its sources. Sources for a target accumulate
over dependency lines when this operator is used. The target is
removed if mmaakkee is interrupted.
!! Targets are always re-created, but not until all sources have been
examined and re-created as necessary. Sources for a target accumu-
late over dependency lines when this operator is used. The target
is removed if mmaakkee is interrupted.
:::: If no sources are specified, the target is always re-created. Oth-
erwise, a target is considered out-of-date if any of its sources
has been modified more recently than the target. Sources for a
target do not accumulate over dependency lines when this operator
is used. The target will not be removed if mmaakkee is interrupted.
Targets and sources may contain the shell wildcard expressions `?', `*',
`[]' and `{}'. The expressions `?', `*' and `[]' may only be used as part
of the final component of the target or source, and must be used to de-
scribe existing files. The expression `{}' need not necessarily be used
to describe existing files. Expansion is in directory order, not alpha-
betically as done in the shell.
SSHHEELLLL CCOOMMMMAANNDDSS
Each target may have associated with it a series of shell commands, nor-
mally used to create the target. Each of the commands in this script
_m_u_s_t be preceded by a tab. While any target may appear on a dependency
line, only one of these dependencies may be followed by a creation
script, unless the `::::' operator is used.
If the first or first two characters of the command line are `@@' and/or
`--', the command is treated specially. A `@@' causes the command not to
be echoed before it is executed. A `--' causes any non-zero exit status
of the command line to be ignored.
VVAARRIIAABBLLEE AASSSSIIGGNNMMEENNTTSS
Variables in mmaakkee are much like variables in the shell, and, by tradi-
tion, consist of all upper-case letters. The five operators that can be
used to assign values to variables are as follows:
== Assign the value to the variable. Any previous value is overrid-
den.
++== Append the value to the current value of the variable.
??== Assign the value to the variable if it is not already defined.
::== Assign with expansion, i.e. expand the value before assigning it
to the variable. Normally, expansion is not done until the vari-
able is referenced.
!!== Expand the value and pass it to the shell for execution and as-
sign the result to the variable. Any newlines in the result are
replaced with spaces.
Any whitespace before the assigned _v_a_l_u_e is removed; if the value is be-
ing appended, a single space is inserted between the previous contents of
the variable and the appended value.
Variables are expanded by surrounding the variable name with either curly
braces (`{}') or parentheses (`()') and preceding it with a dollar sign
(`$'). If the variable name contains only a single letter, the surround-
ing braces or parentheses are not required. This shorter form is not
recommended.
Variable substitution occurs at two distinct times, depending on where
the variable is being used. Variables in dependency lines are expanded
as the line is read. Variables in shell commands are expanded when the
shell command is executed.
The four different classes of variables (in order of increasing prece-
dence) are:
Environment variables
Variables defined as part of mmaakkee's environment.
Global variables
Variables defined in the makefile or in included makefiles.
Command line variables
Variables defined as part of the command line.
Local variables
Variables that are defined specific to a certain target. The
seven local variables are as follows:
_._A_L_L_S_R_C The list of all sources for this target; also known as
`_>'.
_._A_R_C_H_I_V_E The name of the archive file; also known as `_!'.
_._I_M_P_S_R_C The name/path of the source from which the target is to
be transformed (the ``implied'' source); also known as
`_<'.
_._M_E_M_B_E_R The name of the archive member; also known as `_%'.
_._O_O_D_A_T_E The list of sources for this target that were deemed
out-of-date; also known as `_?'.
_._P_R_E_F_I_X The file prefix of the file, containing only the file
portion, no suffix or preceding directory components;
also known as `_*'.
_._T_A_R_G_E_T The name of the target; also known as `_@'.
The shorter forms `_@', `_!', `_<', `_%', `_?', `_>', and `_*' are per-
mitted for backward compatibility and are not recommended. The
six variables `_@_F', `_@_D', `_<_F', `_<_D', `_*_F', and `_*_D' are permit-
ted for compatibility with AT&T System V UNIX makefiles and are
not recommended.
Four of the local variables may be used in sources on dependency
lines because they expand to the proper value for each target on
the line. These variables are `_._T_A_R_G_E_T', `_._P_R_E_F_I_X', `_._A_R_C_H_I_V_E',
and `_._M_E_M_B_E_R'.
In addition, mmaakkee sets or knows about the following internal variables or
environment variables:
_$ A single dollar sign `$', i.e. `$$' expands to a single dol-
lar sign.
_M_A_K_E The name that mmaakkee was executed with (_a_r_g_v[0]).
_._C_U_R_D_I_R A path to the directory where mmaakkee was executed.
_._O_B_J_D_I_R A path to the directory where the targets are built. At
startup, mmaakkee searches for an alternate directory to place
target files. It will attempt to change into this special di-
rectory and will search this directory for makefiles not found
in the current directory. The following directories are tried
in order:
1. ${MAKEOBJDIRPREFIX}/`cwd`
2. ${MAKEOBJDIR}
3. obj.${MACHINE}
4. obj
5. /usr/obj/`cwd`
The first directory that mmaakkee successfully changes into is
used. If either MAKEOBJDIRPREFIX or MAKEOBJDIR is defined but
mmaakkee is unable to change into the corresponding directory,
then the current directory is used without checking the re-
mainder of the list. If they are undefined and mmaakkee is unable
to change into any of the remaining three directories, then
the current directory is used.
_._M_A_K_E_F_L_A_G_S
The environment variable MAKEFLAGS may contain anything that
may be specified on mmaakkee's command line. Its contents are
stored in mmaakkee's _._M_A_K_E_F_L_A_G_S variable. Anything specified on
mmaakkee's command line is appended to the _._M_A_K_E_F_L_A_G_S variable
which is then entered into the environment as MAKEFLAGS for
all programs which mmaakkee executes.
_M_F_L_A_G_S A synonym for _._M_A_K_E_F_L_A_G_S provided for backward compatibility.
PWD Alternate path to the current directory. Supported if built
with WANT_ENV_PWD defined. mmaakkee normally sets `_._C_U_R_D_I_R' to
the canonical path given by getcwd(3). However, if the envi-
ronment variable PWD is set and gives a path to the current
directory, then mmaakkee sets `_._C_U_R_D_I_R' to the value of PWD in-
stead. PWD is always set to the value of `_._O_B_J_D_I_R' for all
programs which mmaakkee executes.
_._T_A_R_G_E_T_S List of targets mmaakkee is currently building.
_._I_N_C_L_U_D_E_S See ..IINNCCLLUUDDEESS special target.
_._L_I_B_S See ..LLIIBBSS special target.
_M_A_C_H_I_N_E Name of the machine architecture mmaakkee is running on, obtained
from the MACHINE environment variable, or through uname(2) if
not defined.
_M_A_C_H_I_N_E___A_R_C_H
Name of the machine architecture mmaakkee was compiled for, de-
fined at compilation time.
_V_P_A_T_H Makefiles may assign a colon-delimited list of directories to
_V_P_A_T_H. These directories will be searched for source files by
mmaakkee after mmaakkee has finished parsing all input makefiles.
Variable expansion may be modified to select or modify each word of the
variable (where a ``word'' is whitespace-delimited sequence of charac-
ters). The general format of a variable expansion is as follows:
{variable[:modifier[:...]]}
Each modifier begins with a colon and one of the following special char-
acters. The colon may be escaped with a backslash (`\').
EE Replaces each word in the variable with its suffix.
HH Replaces each word in the variable with everything but the
last component.
MM_p_a_t_t_e_r_n Select only those words that match the rest of the modifier.
The standard shell wildcard characters (`*', `?', and `[]')
may be used. The wildcard characters may be escaped with a
backslash (`\').
NN_p_a_t_t_e_r_n This is identical to MM, but selects all words which do not
match the rest of the modifier.
QQ Quotes every shell meta-character in the variable, so that it
can be passed safely through recursive invocations of mmaakkee.
RR Replaces each word in the variable with everything but its
suffix.
SS/_o_l_d___s_t_r_i_n_g/_n_e_w___s_t_r_i_n_g/[gg]
Modify the first occurrence of _o_l_d___s_t_r_i_n_g in each word of the
variable's value, replacing it with _n_e_w___s_t_r_i_n_g. If a `g' is
appended to the last slash of the pattern, all occurrences in
each word are replaced. If _o_l_d___s_t_r_i_n_g begins with a caret
(`^'), _o_l_d___s_t_r_i_n_g is anchored at the beginning of each word.
If _o_l_d___s_t_r_i_n_g ends with a dollar sign (`$'), it is anchored
at the end of each word. Inside _n_e_w___s_t_r_i_n_g, an ampersand
(`&') is replaced by _o_l_d___s_t_r_i_n_g. Any character may be used as
a delimiter for the parts of the modifier string. The an-
choring, ampersand, and delimiter characters may be escaped
with a backslash (`\').
Variable expansion occurs in the normal fashion inside both
_o_l_d___s_t_r_i_n_g and _n_e_w___s_t_r_i_n_g with the single exception that a
backslash is used to prevent the expansion of a dollar sign
(`$'), not a preceding dollar sign as is usual.
TT Replaces each word in the variable with its last component.
_o_l_d___s_t_r_i_n_g_=_n_e_w___s_t_r_i_n_g
This is the AT&T System V UNIX style variable substitution.
It must be the last modifier specified. If _o_l_d___s_t_r_i_n_g or
_n_e_w___s_t_r_i_n_g do not contain the pattern matching character _%
then it is assumed that they are anchored at the end of each
word, so only suffixes or entire words may be replaced. Oth-
erwise _% is the substring of _o_l_d___s_t_r_i_n_g to be replaced in
_n_e_w___s_t_r_i_n_g
DDIIRREECCTTIIVVEESS,, CCOONNDDIITTIIOONNAALLSS,, AANNDD FFOORR LLOOOOPPSS
Directives, conditionals, and for loops reminiscent of the C programming
language are provided in mmaakkee. All such structures are identified by a
line beginning with a single dot (`.') character. The following direc-
tives are supported:
..iinncclluuddee _<_f_i_l_e_>
..iinncclluuddee _"_f_i_l_e_"
Include the specified makefile. Variables between the angle
brackets or double quotes are expanded to form the file name. If
angle brackets are used, the included makefile is expected to be
in the system makefile directory. If double quotes are used, the
including makefile's directory and any directories specified us-
ing the --II option are searched before the system makefile direc-
tory.
..uunnddeeff _v_a_r_i_a_b_l_e
Un-define the specified global variable. Only global variables
may be un-defined.
..eerrrroorr _m_e_s_s_a_g_e
Terminate processing of the makefile immediately. The filename
of the makefile, the line on which the error was encountered and
the specified message are printed to standard output and mmaakkee
terminates with exit code 1. Variables in the message are ex-
panded.
Conditionals are used to determine which parts of the Makefile to pro-
cess. They are used similarly to the conditionals supported by the C
pre-processor. The following conditionals are supported:
..iiff [!]_e_x_p_r_e_s_s_i_o_n [_o_p_e_r_a_t_o_r _e_x_p_r_e_s_s_i_o_n _._._.]
Test the value of an expression.
..iiffddeeff [!]_v_a_r_i_a_b_l_e [_o_p_e_r_a_t_o_r _v_a_r_i_a_b_l_e _._._.]
Test the value of a variable.
..iiffnnddeeff [!]_v_a_r_i_a_b_l_e [_o_p_e_r_a_t_o_r _v_a_r_i_a_b_l_e _._._.]
Test the value of a variable.
..iiffmmaakkee [!]_t_a_r_g_e_t [_o_p_e_r_a_t_o_r _t_a_r_g_e_t _._._.]
Test the target being built.
..iiffnnmmaakkee [!]_t_a_r_g_e_t [_o_p_e_r_a_t_o_r _t_a_r_g_e_t _._._.]
Test the target being built.
..eellssee Reverse the sense of the last conditional.
..eelliiff [!]_e_x_p_r_e_s_s_i_o_n [_o_p_e_r_a_t_o_r _e_x_p_r_e_s_s_i_o_n _._._.]
A combination of `..eellssee' followed by `..iiff'.
..eelliiffddeeff [!]_v_a_r_i_a_b_l_e [_o_p_e_r_a_t_o_r _v_a_r_i_a_b_l_e _._._.]
A combination of `..eellssee' followed by `..iiffddeeff'.
..eelliiffnnddeeff [!]_v_a_r_i_a_b_l_e [_o_p_e_r_a_t_o_r _v_a_r_i_a_b_l_e _._._.]
A combination of `..eellssee' followed by `..iiffnnddeeff'.
..eelliiffmmaakkee [!]_t_a_r_g_e_t [_o_p_e_r_a_t_o_r _t_a_r_g_e_t _._._.]
A combination of `..eellssee' followed by `..iiffmmaakkee'.
..eelliiffnnmmaakkee [!]_t_a_r_g_e_t [_o_p_e_r_a_t_o_r _t_a_r_g_e_t _._._.]
A combination of `..eellssee' followed by `..iiffnnmmaakkee'.
..eennddiiff End the body of the conditional.
The _o_p_e_r_a_t_o_r may be any one of the following:
|||| logical OR
&&&& Logical AND; of higher precedence than `||||'.
As in C, mmaakkee will only evaluate a conditional as far as is necessary to
determine its value. Parentheses may be used to change the order of
evaluation. The boolean operator `!!' may be used to logically negate an
entire conditional. It is of higher precedence than `&&&&'.
The value of _e_x_p_r_e_s_s_i_o_n may be any of the following:
ddeeffiinneedd Takes a variable name as an argument and evaluates to true if
the variable has been defined.
mmaakkee Takes a target name as an argument and evaluates to true if
the target was specified as part of mmaakkee's command line or
was declared the default target (either implicitly or explic-
itly, see _._M_A_I_N) before the line containing the conditional.
eemmppttyy Takes a variable, with possible modifiers, and evaluates to
true if the expansion of the variable would result in an emp-
ty string.
eexxiissttss Takes a file name as an argument and evaluates to true if the
file exists. The file is searched for on the system search
path (see _._P_A_T_H).
ttaarrggeett Takes a target name as an argument and evaluates to true if
the target has been defined.
An _e_x_p_r_e_s_s_i_o_n may also be an arithmetic or string comparison. Variable
expansion is performed on both sides of the comparison, after which the
integral values are compared. A value is interpreted as hexadecimal if
it is preceded by 0x, otherwise it is decimal; octal numbers are not sup-
ported. The standard C relational operators are all supported. If after
variable expansion, either the left or right hand side of a `====' or `!!=='
operator is not an integral value, then string comparison is performed
between the expanded variables. If no relational operator is given, it
is assumed that the expanded variable is being compared against 0.
When mmaakkee is evaluating one of these conditional expressions, and it en-
counters a word it doesn't recognize, either the ``make'' or ``defined''
expression is applied to it, depending on the form of the conditional.
If the form is `..iiffddeeff' or `..iiffnnddeeff', the ``defined'' expression is ap-
plied. Similarly, if the form is `..iiffmmaakkee' or `..iiffnnmmaakkee', the ``make''
expression is applied.
If the conditional evaluates to true the parsing of the makefile contin-
ues as before. If it evaluates to false, the following lines are
skipped. In both cases this continues until a `..eellssee' or `..eennddiiff' is
found.
For loops are typically used to apply a set of rules to a list of files.
The syntax of a for loop is:
..ffoorr _v_a_r_i_a_b_l_e iinn _e_x_p_r_e_s_s_i_o_n
<make-rules>
..eennddffoorr
After the for _e_x_p_r_e_s_s_i_o_n is evaluated, it is split into words. The iter-
ation _v_a_r_i_a_b_l_e is successively set to each word, and substituted in the
mmaakkee--rruulleess inside the body of the for loop.
CCOOMMMMEENNTTSS
Comments begin with a hash (`#') character, anywhere but in a shell com-
mand line, and continue to the end of the line.
SSPPEECCIIAALL SSOOUURRCCEESS
..IIGGNNOORREE Ignore any errors from the commands associated with this tar-
get, exactly as if they all were preceded by a dash (`-').
..MMAAKKEE Execute the commands associated with this target even if the
--nn or --tt options were specified. Normally used to mark re-
cursive mmaakkee's.
..NNOOTTMMAAIINN Normally mmaakkee selects the first target it encounters as the
default target to be built if no target was specified. This
source prevents this target from being selected.
..OOPPTTIIOONNAALL If a target is marked with this attribute and mmaakkee can't fig-
ure out how to create it, it will ignore this fact and assume
the file isn't needed or already exists.
..PPRREECCIIOOUUSS When mmaakkee is interrupted, it removes any partially made tar-
gets. This source prevents the target from being removed.
..SSIILLEENNTT Do not echo any of the commands associated with this target,
exactly as if they all were preceded by an at sign (`@').
..UUSSEE Turn the target into mmaakkee's version of a macro. When the
target is used as a source for another target, the other tar-
get acquires the commands, sources, and attributes (except
for ..UUSSEE) of the source. If the target already has commands,
the ..UUSSEE target's commands are appended to them.
..WWAAIITT If special ..WWAAIITT source is appears in a dependency line, the
sources that precede it are made before the sources that suc-
ceed it in the line. Loops are not being detected and tar-
gets that form loops will be silently ignored.
SSPPEECCIIAALL TTAARRGGEETTSS
Special targets may not be included with other targets, i.e. they must be
the only target specified.
..BBEEGGIINN Any command lines attached to this target are executed before
anything else is done.
..DDEEFFAAUULLTT This is sort of a ..UUSSEE rule for any target (that was used on-
ly as a source) that mmaakkee can't figure out any other way to
create. Only the shell script is used. The ..IIMMPPSSRRCC variable
of a target that inherits ..DDEEFFAAUULLTT's commands is set to the
target's own name.
..EENNDD Any command lines attached to this target are executed after
everything else is done.
..IIGGNNOORREE Mark each of the sources with the ..IIGGNNOORREE attribute. If no
sources are specified, this is the equivalent of specifying
the --ii option.
..IINNCCLLUUDDEESS A list of suffixes that indicate files that can be included
in a source file. The suffix must have already been declared
with ..SSUUFFFFIIXXEESS; any suffix so declared will have the directo-
ries on its search path (see ..PPAATTHH) placed in the _._I_N_C_L_U_D_E_S
special variable, each preceeded by a --II flag.
..IINNTTEERRRRUUPPTT If mmaakkee is interrupted, the commands for this target will be
executed.
..LLIIBBSS This does for libraries what ..IINNCCLLUUDDEESS does for include
files, except that the flag used is --LL.
..MMAAIINN If no target is specified when mmaakkee is invoked, this target
will be built. This is always set, either explicitly, or im-
plicitly when mmaakkee selects the default target, to give the
user a way to refer to the default target on the command
line.
..MMAAKKEEFFLLAAGGSS This target provides a way to specify flags for mmaakkee when the
makefile is used. The flags are as if typed to the shell,
though the --ff option will have no effect.
..NNOOTTPPAARRAALLLLEELL
Disable parallel mode.
..NNOO__PPAARRAALLLLEELL
Same as above, for compatibility with other pmake variants.
..OORRDDEERR The named targets are made in sequence.
..PPAATTHH The sources are directories which are to be searched for
files not found in the current directory. If no sources are
specified, any previously specified directories are deleted.
Where possible, use of ..PPAATTHH is preferred over use of the
_V_P_A_T_H variable.
..PPAATTHH_s_u_f_f_i_x
The sources are directories which are to be searched for suf-
fixed files not found in the current directory. MMaakkee first
searches the suffixed search path, before reverting to the
default path if the file is not found there. This form is
required for ..LLIIBBSS and ..IINNCCLLUUDDEESS to work.
..PPHHOONNYY Apply the ..PPHHOONNYY attribute to any specified sources. Targets
with this attribute are always considered to be out of date.
..PPRREECCIIOOUUSS Apply the ..PPRREECCIIOOUUSS attribute to any specified sources. If
no sources are specified, the ..PPRREECCIIOOUUSS attribute is applied
to every target in the file.
..SSIILLEENNTT Apply the ..SSIILLEENNTT attribute to any specified sources. If no
sources are specified, the ..SSIILLEENNTT attribute is applied to
every command in the file.
..SSUUFFFFIIXXEESS Each source specifies a suffix to mmaakkee. If no sources are
specified, any previous specified suffices are deleted.
CCOOMMPPAATTIIBBIILLIITTYY
Older versions of mmaakkee used MAKE instead of MAKEFLAGS. This was removed
for POSIX compatibility. The internal variable _M_A_K_E is set to the same
value as _._M_A_K_E; support for this may be removed in the future.
Most of the more esoteric features of mmaakkee should probably be avoided for
greater compatibility.
EENNVVIIRROONNMMEENNTT
MMaakkee uses the following environment variables, if they exist: MACHINE,
MAKE, MAKEFLAGS, MAKEOBJDIR, MAKEOBJDIRPREFIX, and PWD.
FFIILLEESS
.depend list of dependencies
Makefile list of dependencies
makefile list of dependencies
obj object directory
sys.mk system makefile
/usr/share/mk system makefile directory
/usr/share/doc/psd/12.make PMake tutorial
/usr/obj default MAKEOBJDIRPREFIX directory.
BBUUGGSS
The determination of _._O_B_J_D_I_R is contorted to the point of absurdity.
In the presence of several ..MMAAIINN special targets, mmaakkee silently ignores
all but the first.
_._T_A_R_G_E_T_S is not set to the default target when mmaakkee is invoked without a
target name and no ..MMAAIINN special target exists.
The evaluation of _e_x_p_r_e_s_s_i_o_n in a test is very simple-minded. Currently,
the only form that works is `.if ${VAR} op something' For instance, you
should write tests as `.if ${VAR} = string' not the other way around,
which doesn't work.
For loops are expanded before tests, so a fragment such as:
.for TMACHINE in ${SHARED_ARCHS}
.if ${TMACHINE} = ${MACHINE}
...
.endif
.endfor
won't work, and should be rewritten the other way around.
SSEEEE AALLSSOO
mkdep(1)
_P_M_a_k_e _- _A _T_u_t_o_r_i_a_l.
HHIISSTTOORRYY
A mmaakkee command appeared in Version 7 AT&T UNIX.
BSD March 19, 1994 11