~ubuntu-branches/ubuntu/oneiric/pmake/oneiric

« back to all changes in this revision

Viewing changes to make.1

  • Committer: Bazaar Package Importer
  • Author(s): Sam Hocevar (Debian packages)
  • Date: 2005-07-07 10:20:56 UTC
  • mfrom: (0.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20050707102056-3nh411zy3wbwuwyr
Tags: 1.111-1
* New upstream snapshot.
* This version properly parses arguments and does not crash when parameters
  are missing (Closes: #287336, #316394).
* debian/control:
  + Set policy to 3.6.2.1.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
.\"     $NetBSD: make.1,v 1.101 2004/02/05 23:51:46 wiz Exp $
 
1
.\"     $NetBSD: make.1,v 1.118 2005/06/27 09:51:09 wiz Exp $
2
2
.\"
3
3
.\" Copyright (c) 1990, 1993
4
4
.\"     The Regents of the University of California.  All rights reserved.
29
29
.\"
30
30
.\"     from: @(#)make.1        8.4 (Berkeley) 3/19/94
31
31
.\"
32
 
.Dd February 6, 2004
 
32
.Dd June 27, 2005
33
33
.Dt MAKE 1
34
34
.Os
35
35
.Sh NAME
51
51
.Op Fl I Ar directory
52
52
.Ek
53
53
.Bk -words
 
54
.Op Fl J Ar private
 
55
.Ek
 
56
.Bk -words
54
57
.Op Fl j Ar max_jobs
55
58
.Ek
56
59
.Bk -words
57
 
.Op Fl J Ar private
58
 
.Ek
59
 
.Bk -words
60
60
.Op Fl m Ar directory
61
61
.Ek
62
62
.Bk -words
132
132
.It Ar m
133
133
Print debugging information about making targets, including modification
134
134
dates.
 
135
.It Ar n
 
136
Don't delete the temporary command scripts created in
 
137
.Pa /tmp
 
138
when running commands.
 
139
These are created via
 
140
.Xr mkstemp 3
 
141
and have names of the form
 
142
.Pa /tmp/makeXXXXX .
 
143
.Em NOTE:
 
144
This can create many file in /tmp so use with care.
135
145
.It Ar s
136
146
Print debugging information about suffix-transformation rules.
137
147
.It Ar t
148
158
makefiles.
149
159
.It Fl f Ar makefile
150
160
Specify a makefile to read instead of the default
151
 
.Ql Pa makefile
152
 
and
 
161
.Ql Pa makefile .
153
162
If
154
163
.Ar makefile
155
164
is
156
165
.Ql Fl ,
157
166
standard input is read.
158
 
Multiple makefile's may be specified, and are read in the order specified.
 
167
Multiple makefiles may be specified, and are read in the order specified.
159
168
.It Fl I Ar directory
160
169
Specify a directory in which to search for makefiles and included makefiles.
161
170
The system makefile directory (or directories, see the
341
350
Targets and sources may contain the shell wildcard values
342
351
.Ql \&? ,
343
352
.Ql * ,
344
 
.Ql []
 
353
.Ql [] ,
345
354
and
346
355
.Ql {} .
347
356
The values
348
357
.Ql \&? ,
349
 
.Ql *
 
358
.Ql * ,
350
359
and
351
360
.Ql []
352
361
may only be used as part of the final
367
376
.Ql Ic \&::
368
377
operator is used.
369
378
.Pp
370
 
If the first or first two characters of the command line are
371
 
.Ql Ic @
372
 
and/or
 
379
If the first characters of the command line are any combination of
 
380
.Ql Ic @ ,
 
381
.Ql Ic + ,
 
382
or
373
383
.Ql Ic \- ,
374
384
the command is treated specially.
375
385
A
376
386
.Ql Ic @
377
387
causes the command not to be echoed before it is executed.
378
388
A
 
389
.Ql Ic +
 
390
causes the command to be executed even when
 
391
.Fl n
 
392
is given.
 
393
This is similar to the effect of the .MAKE special source,
 
394
except that the effect can be limited to a single line of a script.
 
395
A
379
396
.Ql Ic \-
380
397
causes any non-zero exit status of the command line to be ignored.
381
398
.Sh VARIABLE ASSIGNMENTS
514
531
A path to the directory where
515
532
.Nm
516
533
was executed.
 
534
Refer to the description of
 
535
.Ql Ev PWD
 
536
for more details.
517
537
.It Ev MAKE
518
538
The name that
519
539
.Nm
576
596
could be done as ${MAKE_PRINT_VAR_ON_ERROR:@v@$v='${$v}'${.newline}@}.
577
597
.It Va .OBJDIR
578
598
A path to the directory where the targets are built.
 
599
Its value is determined by trying to
 
600
.Xr chdir 2
 
601
to the following directories in order and using the first match:
 
602
.Bl -enum
 
603
.It
 
604
.Ev ${MAKEOBJDIRPREFIX}${.CURDIR}
 
605
.Pp
 
606
(Only if
 
607
.Ql Ev MAKEOBJDIRPREFIX
 
608
is set in the environment or on the command line.)
 
609
.It
 
610
.Ev ${MAKEOBJDIR}
 
611
.Pp
 
612
(Only if
 
613
.Ql Ev MAKEOBJDIR
 
614
is set in the environment or on the command line.)
 
615
.It
 
616
.Ev ${.CURDIR} Ns Pa /obj. Ns Ev ${MACHINE}
 
617
.It
 
618
.Ev ${.CURDIR} Ns Pa /obj
 
619
.It
 
620
.Pa /usr/obj/ Ns Ev ${.CURDIR}
 
621
.It
 
622
.Ev ${.CURDIR}
 
623
.El
 
624
.Pp
 
625
Variable expansion is performed on the value before it's used,
 
626
so expressions such as
 
627
.Dl ${.CURDIR:C,^/usr/src,/var/obj,}
 
628
may be used.
 
629
.Pp
 
630
.Ql Va .OBJDIR
 
631
may be modified in the makefile as a global variable.
 
632
In all cases, 
 
633
.Nm
 
634
will
 
635
.Xr chdir 2
 
636
to
 
637
.Ql Va .OBJDIR
 
638
and set
 
639
.Ql Ev PWD
 
640
to that directory before executing any targets.
 
641
.
579
642
.It Va .PARSEDIR
580
643
A path to the directory of the current
581
644
.Ql Pa Makefile
614
677
instead.
615
678
This behaviour is disabled if
616
679
.Ql Ev MAKEOBJDIRPREFIX
617
 
is set.
 
680
is set or
 
681
.Ql Ev MAKEOBJDIR
 
682
contains a variable transform.
618
683
.Ql Ev PWD
619
684
is set to the value of
620
685
.Ql Va .OBJDIR
657
722
.Ar pattern .
658
723
.It Cm \&:O
659
724
Order every word in variable alphabetically.
 
725
To sort words in
 
726
reverse order use the
 
727
.Ql Cm \&:O:[-1..1]
 
728
combination of modifiers.
 
729
.It Cm \&:Ox
 
730
Randomize words in variable.
 
731
The results will be different each time you are referring to the
 
732
modified variable; use the assignment with expansion
 
733
.Pq Ql Cm \&:=
 
734
to prevent such behaviour.
 
735
For example,
 
736
.Bd -literal -offset indent
 
737
LIST=                   uno due tre quattro
 
738
RANDOM_LIST=            ${LIST:Ox}
 
739
STATIC_RANDOM_LIST:=    ${LIST:Ox}
 
740
 
 
741
all:
 
742
        @echo "${RANDOM_LIST}"
 
743
        @echo "${RANDOM_LIST}"
 
744
        @echo "${STATIC_RANDOM_LIST}"
 
745
        @echo "${STATIC_RANDOM_LIST}"
 
746
.Ed
 
747
may produce output similar to:
 
748
.Bd -literal -offset indent
 
749
quattro due tre uno
 
750
tre due quattro uno
 
751
due uno quattro tre
 
752
due uno quattro tre
 
753
.Ed
660
754
.It Cm \&:Q
661
755
Quotes every shell meta-character in the variable, so that it can be passed
662
756
safely through recursive invocations of
791
885
.Sm off
792
886
.It Cm \&:\&? Ar true_string Cm \&: Ar false_string
793
887
.Sm on
794
 
If the variable evaluates to true, return as its value the
 
888
If the variable (actually an expression; see below)
 
889
evaluates to true, return as its value the
795
890
.Ar true_string ,
796
891
otherwise return the
797
892
.Ar false_string .
967
1062
.\" :[*]
968
1063
.It Cm \&*
969
1064
Causes subsequent modifiers to treat the value as a single word
970
 
(possibly containing embedded white space).  Analogous to the effect of
 
1065
(possibly containing embedded white space).
 
1066
Analogous to the effect of
971
1067
\&"$*\&"
972
1068
in Bourne shell.
973
1069
.\" :[0]
977
1073
.\" :[*]
978
1074
.It Cm \&@
979
1075
Causes subsequent modifiers to treat the value as a sequence of words
980
 
delimited by white space.  Analogous to the effect of
 
1076
delimited by white space.
 
1077
Analogous to the effect of
981
1078
\&"$@\&"
982
1079
in Bourne shell.
983
1080
.\" :[#]
1176
1273
string comparison is performed between the expanded
1177
1274
variables.
1178
1275
If no relational operator is given, it is assumed that the expanded
1179
 
variable is being compared against 0.
 
1276
variable is being compared against 0 or an empty string in the case
 
1277
of a string comparison.
1180
1278
.Pp
1181
1279
When
1182
1280
.Nm
1236
1334
Comments begin with a hash
1237
1335
.Pq Ql \&#
1238
1336
character, anywhere but in a shell
1239
 
command line, and continue to the end of the line.
 
1337
command line, and continue to the end of an unescaped new line.
1240
1338
.Sh SPECIAL SOURCES (ATTRIBUTES)
1241
1339
.Bl -tag -width .IGNOREx
1242
1340
.It Ic .EXEC
1479
1577
and
1480
1578
.Ev PWD .
1481
1579
.Pp
1482
 
If
1483
1580
.Ev MAKEOBJDIRPREFIX
1484
 
is set, then
1485
 
.Nm
1486
 
will
1487
 
.Xr chdir 2
1488
 
to ${MAKEOBJDIRPREFIX}${.CURDIR} if it exists.
1489
 
Otherwise if
 
1581
and
1490
1582
.Ev MAKEOBJDIR
1491
 
and the named directory exists
 
1583
may only be set in the environment or on the command line to
1492
1584
.Nm
1493
 
will
1494
 
.Xr chdir 2
1495
 
to it.
1496
 
These actions are taken before any makefiles are read which is why they
1497
 
need to be set in the environment.
 
1585
and not as makefile variables;
 
1586
see the description of
 
1587
.Ql Va .OBJDIR
 
1588
for more details.
1498
1589
.Sh FILES
1499
1590
.Bl -tag -width /usr/share/mk -compact
1500
1591
.It .depend