#, fuzzy msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "POT-Creation-Date: 2018-12-08 14:50-0200\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" #. Put one translator per line, in the form NAME , YEAR1, YEAR2 msgctxt "_" msgid "translator-credits" msgstr "" #. (itstool) path: info/title #: book.translate.xml:17 msgid "PMake — A Tutorial" msgstr "" #. (itstool) path: info/author #: book.translate.xml:20 msgid "" "Adamde Boor" msgstr "" #. (itstool) path: info/copyright #: book.translate.xml:22 msgid "1988 1989 Adam de Boor" msgstr "" #. (itstool) path: info/copyright #: book.translate.xml:28 msgid "1989 Berkeley Softworks" msgstr "" #. (itstool) path: info/copyright #: book.translate.xml:33 msgid "" "1988 1989 1993 The Regents of " "the University of California." msgstr "" #. (itstool) path: legalnotice/para #: book.translate.xml:45 msgid "All rights reserved." msgstr "" #. (itstool) path: legalnotice/para #: book.translate.xml:47 msgid "" "This code is derived from software contributed to Berkeley by Adam de Boor." msgstr "" #. (itstool) path: legalnotice/para #: book.translate.xml:50 msgid "" "Redistribution and use in source and binary forms, with or without " "modification, are permitted provided that the following conditions are met:" msgstr "" #. (itstool) path: listitem/para #: book.translate.xml:56 msgid "" "Redistributions of source code must retain the above copyright notice, this " "list of conditions and the following disclaimer." msgstr "" #. (itstool) path: listitem/para #: book.translate.xml:61 msgid "" "Redistributions in binary form must reproduce the above copyright notice, " "this list of conditions and the following disclaimer in the documentation " "and/or other materials provided with the distribution." msgstr "" #. (itstool) path: listitem/para #: book.translate.xml:68 msgid "" "Neither the name of the University nor the names of its contributors may be " "used to endorse or promote products derived from this software without " "specific prior written permission." msgstr "" #. (itstool) path: important/para #: book.translate.xml:76 msgid "" "THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS \"AS IS\" AND ANY " "EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED " "WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE " "DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY " "DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES " "(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; " "LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND " "ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT " "(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF " "THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." msgstr "" #. (itstool) path: info/releaseinfo #: book.translate.xml:91 msgid "" "$FreeBSD: head/en_US.ISO8859-1/books/pmake/book.xml 43184 2013-11-13 07:52:" "45Z hrs $" msgstr "" #. (itstool) path: chapter/title #: book.translate.xml:101 msgid "Introduction" msgstr "" #. (itstool) path: chapter/para #: book.translate.xml:103 msgid "" "PMake is a program for creating other programs, " "or anything else you can think of for it to do. The basic idea behind " "PMake is that, for any given system, be it a " "program or a document or whatever, there will be some files that depend on " "the state of other files (on when they were last modified). " "PMake takes these dependencies, which you must " "specify, and uses them to build whatever it is you want it to build." msgstr "" #. (itstool) path: chapter/para #: book.translate.xml:112 msgid "" "PMake is almost fully-compatible with " "Make, with which you may already be familiar. " "PMake's most important feature is its ability to " "run several different jobs at once, making the creation of systems " "considerably faster. It also has a great deal more functionality than " "Make." msgstr "" #. (itstool) path: chapter/para #: book.translate.xml:119 msgid "" "This tutorial is divided into three main sections corresponding to basic, " "intermediate and advanced PMake usage. If you " "already know Make well, you will only need to " "skim (there are some aspects of " "PMake that I consider basic to its use that did " "not exist in Make). Things in make life much easier, while those in are strictly for those who know what they are doing. has definitions for the jargon I use and contains possible solutions to the problems presented " "throughout the tutorial." msgstr "" #. (itstool) path: chapter/title #: book.translate.xml:137 msgid "The Basics of PMake" msgstr "" #. (itstool) path: chapter/para #: book.translate.xml:139 msgid "" "PMake takes as input a file that tells which " "files depend on which other files to be complete and what to do about files " "that are out-of-date. This file is known as a " "makefile and is usually kept in the top-most directory of the " "system to be built. While you can call the makefile anything you want, " "PMake will look for Makefile " "and makefile (in that order) in the current directory " "if you do not tell it otherwise. To specify a different makefile, use the " " flag, e.g." msgstr "" #. (itstool) path: chapter/screen #: book.translate.xml:151 #, no-wrap msgid "" "% pmake -f program.mk" msgstr "" #. (itstool) path: chapter/para #: book.translate.xml:153 msgid "A makefile has four different types of lines in it:" msgstr "" #. (itstool) path: listitem/para #: book.translate.xml:157 msgid "File dependency specifications" msgstr "" #. (itstool) path: listitem/para #: book.translate.xml:161 book.translate.xml:1608 msgid "Creation commands" msgstr "" #. (itstool) path: listitem/para #: book.translate.xml:165 book.translate.xml:1612 msgid "Variable assignments" msgstr "" #. (itstool) path: listitem/para #: book.translate.xml:169 book.translate.xml:1616 msgid "Comments, include statements and conditional directives" msgstr "" #. (itstool) path: chapter/para #: book.translate.xml:173 msgid "" "Any line may be continued over multiple lines by ending it with a backslash. " "The backslash, following newline and any initial whitespace on the following " "line are compressed into a single space before the input line is examined by " "PMake." msgstr "" #. (itstool) path: section/title #: book.translate.xml:180 msgid "Dependency Lines" msgstr "" #. (itstool) path: section/para #: book.translate.xml:182 msgid "" "As mentioned in the introduction, in any system, there are dependencies " "between the files that make up the system. For instance, in a program made " "up of several C source files and one header file, the C files will need to " "be re-compiled should the header file be changed. For a document of several " "chapters and one macro file, the chapters will need to be reprocessed if any " "of the macros changes. These are dependencies and are specified by means of " "dependency lines in the makefile." msgstr "" #. (itstool) path: section/para #: book.translate.xml:191 msgid "" "On a dependency line, there are targets and sources, separated by a one- or " "two-character operator. The targets depend on the sources and " "are usually created from them. Any number of targets and sources may be " "specified on a dependency line. All the targets in the line are made to " "depend on all the sources. Targets and sources need not be actual files, but " "every source must be either an actual file or another target in the makefile." " If you run out of room, use a backslash at the end of the line to continue " "onto the next one." msgstr "" #. (itstool) path: section/para #: book.translate.xml:202 msgid "" "Any file may be a target and any file may be a source, but the relationship " "between the two (or however many) is determined by the operator that separates them. Three types of operators exist: one specifies " "that the datedness of a target is determined by the state of its sources, " "while another specifies other files (the sources) that need to be dealt with " "before the target can be re-created. The third operator is very similar to " "the first, with the additional condition that the target is out-of-date if " "it has no sources. These operations are represented by the colon, the " "exclamation point and the double-colon, respectively, and are mutually " "exclusive. Their exact semantics are as follows:" msgstr "" #. (itstool) path: row/entry #: book.translate.xml:219 msgid ":" msgstr "" #. (itstool) path: row/entry #: book.translate.xml:221 msgid "" "If a colon is used, a target on the line is considered to be out-of-" "date (and in need of creation) if any of the sources has been " "modified more recently than the target, or the target does not exist. Under " "this operation, steps will be taken to re-create the target only if it is " "found to be out-of-date by using these two rules." msgstr "" #. (itstool) path: row/entry #: book.translate.xml:231 msgid "!" msgstr "" #. (itstool) path: row/entry #: book.translate.xml:233 msgid "" "If an exclamation point is used, the target will always be re-created, but " "this will not happen until all of its sources have been examined and re-" "created, if necessary." msgstr "" #. (itstool) path: row/entry #: book.translate.xml:240 msgid "::" msgstr "" #. (itstool) path: row/entry #: book.translate.xml:242 msgid "" "If a double-colon is used, a target is out-of-date if any of " "the sources has been modified more recently than the target, or the target " "does not exist, or the target has no sources. If the target is out-of-date " "according to these rules, it will be re-created. This operator also does " "something else to the targets, but I will go into that in the next section " "(see )." msgstr "" #. (itstool) path: section/para #: book.translate.xml:256 msgid "" "Enough words, now for an example. Take that C program I mentioned earlier. " "Say there are three C files (a.c, b.c and c.c) each of which includes the file " "defs.h. The dependencies between the files could then " "be expressed as follows:" msgstr "" #. (itstool) path: section/programlisting #: book.translate.xml:263 #, no-wrap msgid "" "program : a.o b.o c.o\n" "\n" "a.o b.o c.o : defs.h\n" "\n" "a.o : a.c\n" "\n" "b.o : b.c\n" "\n" "c.o : c.c" msgstr "" #. (itstool) path: para/buildtarget #: book.translate.xml:277 msgid "program" msgstr "" #. (itstool) path: section/para #: book.translate.xml:273 msgid "" "You may be wondering at this point, where a.o, " "b.o and c.o came in and why they " "depend on defs.h and the C files do not. The reason is " "quite simple: <_:buildtarget-1/> cannot be made by linking together " ".c files—it must be made from .o " "files. Likewise, if you change defs.h, it is not the " ".c files that need to be re-created, it is the " ".o files. If you think of dependencies in these " "terms—which files (targets) need to be created from which files " "(sources)—you should have no problems." msgstr "" #. (itstool) path: section/para #: book.translate.xml:287 msgid "" "An important thing to notice about the above example, is that all the " ".o files appear as targets on more than one line. This " "is perfectly all right: the target is made to depend on all the sources " "mentioned on all the dependency lines. For example, a.o " "depends on both defs.h and a.c." msgstr "" #. (itstool) path: section/para #: book.translate.xml:294 msgid "" "The order of the dependency lines in the makefile is important: the first " "target on the first dependency line in the makefile will be the one that " "gets made if you do not say otherwise. That is why program comes first in " "the example makefile, above." msgstr "" #. (itstool) path: section/para #: book.translate.xml:300 msgid "" "Both targets and sources may contain the standard C-Shell wildcard " "characters ({, }, *, ?, [, and ]), but the non-curly-brace ones may only appear in the final " "component (the file portion) of the target or source. The characters mean " "the following things:" msgstr "" #. (itstool) path: row/entry #: book.translate.xml:311 msgid "{}" msgstr "" #. (itstool) path: row/entry #: book.translate.xml:313 msgid "" "These enclose a comma-separated list of options and cause the pattern to be " "expanded once for each element of the list. Each expansion contains a " "different element. For example, src/{whiffle,beep,fish}.c expands to the three words src/whiffle.c, " "src/beep.c, and src/fish.c. These " "braces may be nested and, unlike the other wildcard characters, the " "resulting words need not be actual files. All other wildcard characters are " "expanded using the files that exist when PMake is " "started." msgstr "" #. (itstool) path: row/entry #: book.translate.xml:328 msgid "*" msgstr "" #. (itstool) path: row/entry #: book.translate.xml:330 msgid "" "This matches zero or more characters of any sort. src/*.c will expand to the same three words as above as long as src " "contains those three files (and no other files that end in .c).>" msgstr "" #. (itstool) path: row/entry #: book.translate.xml:338 msgid "?" msgstr "" #. (itstool) path: row/entry #: book.translate.xml:340 msgid "Matches any single character." msgstr "" #. (itstool) path: row/entry #: book.translate.xml:344 msgid "[]" msgstr "" #. (itstool) path: row/entry #: book.translate.xml:346 msgid "" "This is known as a character class and contains either a list of single " "characters, or a series of character ranges (a-z, for " "example means all characters between a and z), or both. It matches any single character contained in the list. " "For example, [A-Za-z] will match all letters, while " "[0123456789] will match all numbers." msgstr "" #. (itstool) path: section/title #: book.translate.xml:362 msgid "Shell Commands" msgstr "" #. (itstool) path: section/para #: book.translate.xml:364 msgid "" "Is not that nice, you say to yourself, but how are " "files actually ``re-created'', as he likes to spell it? The re-" "creation is accomplished by commands you place in the makefile. These " "commands are passed to the Bourne shell (better known as /bin/sh) to be executed and are expected to do what is necessary to update " "the target file (PMake does not actually check to " "see if the target was created. It just assumes it is there)." msgstr "" #. (itstool) path: section/para #: book.translate.xml:374 msgid "" "Shell commands in a makefile look a lot like shell commands you would type " "at a terminal, with one important exception: each command in a makefile must " "be preceded by at least one tab." msgstr "" #. (itstool) path: section/para #: book.translate.xml:379 msgid "" "Each target has associated with it a shell script made up of one or more of " "these shell commands. The creation script for a target should immediately " "follow the dependency line for that target. While any given target may " "appear on more than one dependency line, only one of these dependency lines " "may be followed by a creation script, unless the :: " "operator was used on the dependency line." msgstr "" #. (itstool) path: section/para #: book.translate.xml:387 msgid "" "If the double-colon was used, each dependency line for the target may be " "followed by a shell script. That script will only be executed if the target " "on the associated dependency line is out-of-date with respect to the sources " "on that line, according to the rules I gave earlier. I'll give you a good " "example of this later on." msgstr "" #. (itstool) path: section/para #: book.translate.xml:394 msgid "To expand on the earlier makefile, you might add commands as follows:" msgstr "" #. (itstool) path: section/programlisting #: book.translate.xml:397 #, no-wrap msgid "" "program : a.o b.o c.o\n" " cc a.o b.o c.o -o program\n" "\n" "a.o b.o c.o : defs.h\n" "a.o : a.c\n" " cc -c a.c\n" "\n" "b.o : b.c\n" " cc -c b.c\n" "\n" "c.o : c.c\n" " cc -c c.c" msgstr "" #. (itstool) path: section/para #: book.translate.xml:410 msgid "" "Something you should remember when writing a makefile is, the commands will " "be executed if the target on the dependency line is out-of-date, not the " "sources. In this example, the command cc -c a.c will be " "executed if a.o is out-of-date. Because of the " ": operator, this means that should a.c or defs.h have been modified more recently " "than a.o, the command will be executed (a.o will be considered out-of-date)." msgstr "" #. (itstool) path: section/para #: book.translate.xml:421 msgid "" "Remember how I said the only difference between a makefile shell command and " "a regular shell command was the leading tab? I lied. There is another way in " "which makefile commands differ from regular ones. The first two characters " "after the initial whitespace are treated specially. If they are any " "combination of @ and -, they cause " "PMake to do different things." msgstr "" #. (itstool) path: section/para #: book.translate.xml:429 msgid "" "In most cases, shell commands are printed before they are actually executed. " "This is to keep you informed of what is going on. If an @ " "appears, however, this echoing is suppressed. In the case of an echo " "command, say" msgstr "" #. (itstool) path: section/programlisting #: book.translate.xml:435 #, no-wrap msgid "echo Linking index" msgstr "" #. (itstool) path: section/para #: book.translate.xml:437 msgid "it would be rather silly to see" msgstr "" #. (itstool) path: section/screen #: book.translate.xml:439 #, no-wrap msgid "echo Linking index\n" "Linking index" msgstr "" #. (itstool) path: section/para #: book.translate.xml:442 msgid "" "so PMake allows you to place an @ before the command to prevent the command from being printed:" msgstr "" #. (itstool) path: section/programlisting #: book.translate.xml:446 #, no-wrap msgid "@echo Linking index" msgstr "" #. (itstool) path: section/para #: book.translate.xml:448 msgid "" "The other special character is the -. In case you did not " "know, shell commands finish with a certain exit status. This " "status is made available by the operating system to whatever program invoked " "the command. Normally this status will be 0 if everything " "went ok and non-zero if something went wrong. For this reason, " "PMake will consider an error to have occurred if " "one of the shells it invokes returns a non-zero status. When it detects an " "error, PMake's usual action is to abort whatever " "it is doing and exit with a non-zero status itself (any other targets that " "were being created will continue being made, but nothing new will be started." " PMake will exit after the last job finishes). " "This behavior can be altered, however, by placing a - at " "the front of a command (e.g. -mv index index.old), " "certain command-line arguments, or doing other things, to be detailed later. " "In such a case, the non-zero status is simply ignored and " "PMake keeps chugging along." msgstr "" #. (itstool) path: section/para #: book.translate.xml:470 msgid "" "Because all the commands are given to a single shell to execute, such things " "as setting shell variables, changing directories, etc., last beyond the " "command in which they are found. This also allows shell compound commands " "(like for loops) to be entered in a natural manner. Since this could cause " "problems for some makefiles that depend on each command being executed by a " "single shell, PMake has a " "flag (it stands for backwards-compatible) that forces each command to be " "given to a separate shell. It also does several other things, all of which I " "discourage since they are now old-fashioned." msgstr "" #. (itstool) path: section/para #: book.translate.xml:483 msgid "" "A target's shell script is fed to the shell on its (the shell's) input " "stream. This means that any commands, such as ci " "that need to get input from the terminal will not work right – they will get " "the shell's input, something they probably will not find to their liking. A " "simple way around this is to give a command like this:" msgstr "" #. (itstool) path: section/screen #: book.translate.xml:490 #, no-wrap msgid "ci $(SRCS) < /dev/tty" msgstr "" #. (itstool) path: section/para #: book.translate.xml:492 msgid "" "This would force the program's input to come from the terminal. If you " "cannot do this for some reason, your only other alternative is to use " "PMake in its fullest compatibility mode. See " "Compatibility in ." msgstr "" #. (itstool) path: section/title #: book.translate.xml:501 msgid "Variables" msgstr "" #. (itstool) path: section/para #: book.translate.xml:503 msgid "" "PMake, like Make " "before it, has the ability to save text in variables to be recalled later at " "your convenience. Variables in PMake are used " "much like variables in the shell and, by tradition, consist of all upper-" "case letters (you do not have to use all upper-case letters. In fact there " "is nothing to stop you from calling a variable @^&$%$." " Just tradition). Variables are assigned-to using lines of the form:" msgstr "" #. (itstool) path: section/programlisting #: book.translate.xml:513 #, no-wrap msgid "VARIABLE = value" msgstr "" #. (itstool) path: section/para #: book.translate.xml:515 msgid "appended-to by:" msgstr "" #. (itstool) path: section/programlisting #: book.translate.xml:517 #, no-wrap msgid "VARIABLE += value" msgstr "" #. (itstool) path: section/para #: book.translate.xml:519 msgid "conditionally assigned-to (if the variable is not already defined) by:" msgstr "" #. (itstool) path: section/programlisting #: book.translate.xml:522 #, no-wrap msgid "VARIABLE ?= value" msgstr "" #. (itstool) path: section/para #: book.translate.xml:524 msgid "" "and assigned-to with expansion (i.e. the value is expanded (see below) " "before being assigned to the variable—useful for placing a value at the " "beginning of a variable, or other things) by:" msgstr "" #. (itstool) path: section/programlisting #: book.translate.xml:529 #, no-wrap msgid "VARIABLE := value" msgstr "" #. (itstool) path: section/para #: book.translate.xml:531 msgid "" "Any whitespace before value is stripped off. When appending, a space is " "placed between the old value and the stuff being appended." msgstr "" #. (itstool) path: section/para #: book.translate.xml:535 msgid "The final way a variable may be assigned to is using:" msgstr "" #. (itstool) path: section/programlisting #: book.translate.xml:537 #, no-wrap msgid "VARIABLE != shell-command" msgstr "" #. (itstool) path: section/para #: book.translate.xml:539 msgid "" "In this case, shell-command has all its variables expanded (see below) and " "is passed off to a shell to execute. The output of the shell is then placed " "in the variable. Any newlines (other than the final one) are replaced by " "spaces before the assignment is made. This is typically used to find the " "current directory via a line like:" msgstr "" #. (itstool) path: section/programlisting #: book.translate.xml:546 #, no-wrap msgid "CWD != pwd" msgstr "" #. (itstool) path: note/para #: book.translate.xml:549 msgid "" "This is intended to be used to execute commands that produce small amounts " "of output (e.g. pwd). The implementation is less " "than intelligent and will likely freeze if you execute something that " "produces thousands of bytes of output (8 Kb is the limit on many UNIX systems). The value of a variable may " "be retrieved by enclosing the variable name in parentheses or curly braces " "and preceding the whole thing with a dollar sign." msgstr "" #. (itstool) path: section/para #: book.translate.xml:560 msgid "" "For example, to set the variable CFLAGS to the string " "-I/sprite/src/lib/libc -O, you would place a line:" msgstr "" #. (itstool) path: section/programlisting #: book.translate.xml:564 #, no-wrap msgid "CFLAGS = -I/sprite/src/lib/libc -O" msgstr "" #. (itstool) path: section/para #: book.translate.xml:566 msgid "" "in the makefile and use the word $(CFLAGS) wherever you " "would like the string -I/sprite/src/lib/libc -O to appear." " This is called variable expansion." msgstr "" #. (itstool) path: note/para #: book.translate.xml:572 msgid "" "Unlike Make, PMake " "will not expand a variable unless it knows the variable exists. E.g. if you " "have a ${i} in a shell command and you have not assigned " "a value to the variable i (the empty string is considered " "a value, by the way), where Make would have " "substituted the empty string, PMake will leave " "the ${i} alone. To keep PMake " "from substituting for a variable it knows, precede the dollar sign with " "another dollar sign (e.g. to pass ${HOME} to the shell, " "use $${HOME}). This causes PMake, in effect, to expand the $ macro, which " "expands to a single $." msgstr "" #. (itstool) path: section/para #: book.translate.xml:590 msgid "" "For compatibility, Make's style of variable " "expansion will be used if you invoke PMake with " "any of the compatibility flags (, or " ". The flag alters just the variable " "expansion). There are two different times at which variable expansion occurs:" " when parsing a dependency line, the expansion occurs immediately upon " "reading the line. If any variable used on a dependency line is undefined, " "PMake will print a message and exit. Variables in " "shell commands are expanded when the command is executed. Variables used " "inside another variable are expanded whenever the outer variable is expanded " "(the expansion of an inner variable has no effect on the outer variable. For " "example, if the outer variable is used on a dependency line and in a shell " "command, and the inner variable changes value between when the dependency " "line is read and the shell command is executed, two different values will be " "substituted for the outer variable)." msgstr "" #. (itstool) path: section/para #: book.translate.xml:610 msgid "" "Variables come in four flavors, though they are all expanded the same and " "all look about the same. They are (in order of expanding scope):" msgstr "" #. (itstool) path: listitem/para #: book.translate.xml:616 msgid "Local variables." msgstr "" #. (itstool) path: listitem/para #: book.translate.xml:620 msgid "Command-line variables." msgstr "" #. (itstool) path: listitem/para #: book.translate.xml:624 msgid "Global variables." msgstr "" #. (itstool) path: listitem/para #: book.translate.xml:628 msgid "Environment variables." msgstr "" #. (itstool) path: section/para #: book.translate.xml:632 msgid "" "The classification of variables does not matter much, except that the " "classes are searched from the top (local) to the bottom (environment) when " "looking up a variable. The first one found wins." msgstr "" #. (itstool) path: section/title #: book.translate.xml:638 msgid "Local Variables" msgstr "" #. (itstool) path: section/para #: book.translate.xml:640 msgid "" "Each target can have as many as seven local variables. These are variables " "that are only visible within that target's shell script and " "contain such things as the target's name, all of its sources (from all its " "dependency lines), those sources that were out-of-date, etc. Four local " "variables are defined for all targets. They are:" msgstr "" #. (itstool) path: varlistentry/term #: book.translate.xml:649 msgid ".TARGET" msgstr "" #. (itstool) path: listitem/para #: book.translate.xml:652 msgid "The name of the target." msgstr "" #. (itstool) path: varlistentry/term #: book.translate.xml:657 msgid ".OODATE" msgstr "" #. (itstool) path: listitem/para #: book.translate.xml:660 msgid "" "The list of the sources for the target that were considered out-of-date. The " "order in the list is not guaranteed to be the same as the order in which the " "dependencies were given." msgstr "" #. (itstool) path: varlistentry/term #: book.translate.xml:668 msgid ".ALLSRC" msgstr "" #. (itstool) path: listitem/para #: book.translate.xml:671 msgid "" "The list of all sources for this target in the order in which they were " "given." msgstr "" #. (itstool) path: varlistentry/term #: book.translate.xml:677 msgid ".PREFIX" msgstr "" #. (itstool) path: listitem/para #: book.translate.xml:680 msgid "" "The target without its suffix and without any leading path. E.g. for the " "target ../../lib/compat/fsRead.c, this variable would " "contain fsRead." msgstr "" #. (itstool) path: section/para #: book.translate.xml:688 msgid "" "Three other local variables are set only for certain targets under special " "circumstances. These are the .IMPSRC, .ARCHIVE, and .MEMBER variables. When they are set and how " "they are used is described later." msgstr "" #. (itstool) path: section/para #: book.translate.xml:694 msgid "" "Four of these variables may be used in sources as well as in shell scripts. " "These are .TARGET, .PREFIX, ." "ARCHIVE and .MEMBER. The variables in the " "sources are expanded once for each target on the dependency line, providing " "what is known as a dynamic source, allowing you to specify " "several dependency lines at once. For example:" msgstr "" #. (itstool) path: section/programlisting #: book.translate.xml:703 #, no-wrap msgid "$(OBJS) : $(.PREFIX).c" msgstr "" #. (itstool) path: section/para #: book.translate.xml:705 msgid "" "will create a dependency between each object file and its corresponding C " "source file." msgstr "" #. (itstool) path: section/title #: book.translate.xml:710 msgid "Command-line Variables" msgstr "" #. (itstool) path: section/para #: book.translate.xml:712 msgid "" "Command-line variables are set when PMake is " "first invoked by giving a variable assignment as one of the arguments. For " "example:" msgstr "" #. (itstool) path: section/screen #: book.translate.xml:717 #, no-wrap msgid "pmake \"CFLAGS = -I/sprite/src/lib/libc -O\"" msgstr "" #. (itstool) path: section/para #: book.translate.xml:719 msgid "" "would make CFLAGS be a command-line variable with the given " "value. Any assignments to CFLAGS in the makefile will have no " "effect, because once it is set, there is (almost) nothing you can do to " "change a command-line variable (the search order, you see). Command-line " "variables may be set using any of the four assignment operators, though only " "= and ?= behave as you would expect " "them to, mostly because assignments to command-line variables are performed " "before the makefile is read, thus the values set in the makefile are " "unavailable at the time. += is the same as =, because the old value of the variable is sought only in the scope " "in which the assignment is taking place (for reasons of efficiency that I " "will not get into here). := and ?= " "will work if the only variables used are in the environment. != is sort of pointless to use from the command line, since the same " "effect can no doubt be accomplished using the shell's own command " "substitution mechanisms (backquotes and all that)." msgstr "" #. (itstool) path: section/title #: book.translate.xml:742 msgid "Global Variables" msgstr "" #. (itstool) path: section/para #: book.translate.xml:744 msgid "" "Global variables are those set or appended-to in the makefile. There are two " "classes of global variables: those you set and those PMake sets. As I said before, the ones you set can have any name you " "want them to have, except they may not contain a colon or an exclamation " "point. The variables PMake sets (almost) always " "begin with a period and always contain upper-case letters, only. The " "variables are as follows:" msgstr "" #. (itstool) path: varlistentry/term #: book.translate.xml:756 msgid ".PMAKE" msgstr "" #. (itstool) path: listitem/para #: book.translate.xml:759 msgid "" "The name by which PMake was invoked is stored in " "this variable. For compatibility, the name is also stored in the " "MAKE variable." msgstr "" #. (itstool) path: varlistentry/term #: book.translate.xml:767 msgid ".MAKEFLAGS" msgstr "" #. (itstool) path: listitem/para #: book.translate.xml:770 msgid "" "All the relevant flags with which PMake was " "invoked. This does not include such things as or " "variable assignments. Again for compatibility, this value is stored in the " "MFLAGS variable as well." msgstr "" #. (itstool) path: section/para #: book.translate.xml:780 msgid "" "Two other variables, .INCLUDES and .LIBS, are covered in the section on special targets in ." msgstr "" #. (itstool) path: section/para #: book.translate.xml:784 msgid "Global variables may be deleted using lines of the form:" msgstr "" #. (itstool) path: section/programlisting #: book.translate.xml:787 #, no-wrap msgid "#undef variable" msgstr "" #. (itstool) path: section/para #: book.translate.xml:789 msgid "" "The # must be the first character on the line. Note that " "this may only be done on global variables." msgstr "" #. (itstool) path: section/title #: book.translate.xml:795 msgid "Environment Variables" msgstr "" #. (itstool) path: section/para #: book.translate.xml:797 msgid "" "Environment variables are passed by the shell that invoked " "PMake and are given by PMake to each shell it invokes. They are expanded like any other " "variable, but they cannot be altered in any way." msgstr "" #. (itstool) path: section/para #: book.translate.xml:803 msgid "" "One special environment variable, PMAKE, is examined by " "PMake for command-line flags, variable " "assignments, etc., it should always use. This variable is examined before " "the actual arguments to PMake are. In addition, " "all flags given to PMake, either through the " "PMAKE variable or on the command line, are placed in this " "environment variable and exported to each shell PMake executes. Thus recursive invocations of PMake automatically receive the same flags as the top-most one." msgstr "" #. (itstool) path: section/para #: book.translate.xml:815 msgid "" "Using all these variables, you can compress the sample makefile even more:" msgstr "" #. (itstool) path: section/programlisting #: book.translate.xml:818 #, no-wrap msgid "" "OBJS = a.o b.o c.o\n" "\n" "program : $(OBJS)\n" " cc $(.ALLSRC) -o $(.TARGET)\n" "\n" "$(OBJS) : defs.h\n" "\n" "a.o : a.c\n" " cc -c a.c\n" "\n" "b.o : b.c\n" " cc -c b.c\n" "\n" "c.o : c.c\n" " cc -c c.c" msgstr "" #. (itstool) path: section/title #: book.translate.xml:837 msgid "Comments" msgstr "" #. (itstool) path: section/para #: book.translate.xml:839 msgid "" "Comments in a makefile start with a # character and " "extend to the end of the line. They may appear anywhere you want them, " "except in a shell command (though the shell will treat it as a comment, too)." " If, for some reason, you need to use the # in a variable " "or on a dependency line, put a backslash in front of it. PMake will compress the two into a single #." msgstr "" #. (itstool) path: note/para #: book.translate.xml:849 msgid "" "This is not true if PMake is operating in full-" "compatibility mode)." msgstr "" #. (itstool) path: section/title #: book.translate.xml:855 msgid "Parallelism" msgstr "" #. (itstool) path: section/para #: book.translate.xml:857 msgid "" "PMake was specifically designed to re-create " "several targets at once, when possible. You do not have to do anything " "special to cause this to happen (unless PMake was " "configured to not act in parallel, in which case you will have to make use " "of the and flags (see below)), but " "you do have to be careful at times." msgstr "" #. (itstool) path: section/para #: book.translate.xml:865 msgid "" "There are several problems you are likely to encounter. One is that some " "makefiles (and programs) are written in such a way that it is impossible for " "two targets to be made at once. The program xstr, " "for example, always modifies the files strings and " "x.c. There is no way to change it. Thus you cannot run " "two of them at once without something being trashed. Similarly, if you have " "commands in the makefile that always send output to the same file, you will " "not be able to make more than one target at once unless you change the file " "you use. You can, for instance, add a $$$$ to the end of " "the file name to tack on the process ID of the shell executing the command " "(each $$ expands to a single $, thus " "giving you the shell variable $$). Since only one shell " "is used for all the commands, you will get the same file name for each " "command in the script." msgstr "" #. (itstool) path: section/para #: book.translate.xml:883 msgid "" "The other problem comes from improperly-specified dependencies that worked " "in Make because of its sequential, depth-first " "way of examining them. While I do not want to go into depth on how " "PMake works (look in if " "you are interested), I will warn you that files in two different levels of " "the dependency tree may be examined in a different order in " "PMake than they were in Make. For example, given the makefile:" msgstr "" #. (itstool) path: section/programlisting #: book.translate.xml:894 #, no-wrap msgid "a :\n" "\n" "b c b : d" msgstr "" #. (itstool) path: para/buildtarget #: book.translate.xml:899 book.translate.xml:903 book.translate.xml:905 #: book.translate.xml:908 book.translate.xml:1101 msgid "c" msgstr "" #. (itstool) path: para/buildtarget #: book.translate.xml:900 book.translate.xml:1103 msgid "d" msgstr "" #. (itstool) path: para/buildtarget #: book.translate.xml:900 book.translate.xml:904 book.translate.xml:909 #: book.translate.xml:1105 msgid "b" msgstr "" #. (itstool) path: para/buildtarget #: book.translate.xml:901 book.translate.xml:1103 msgid "a" msgstr "" #. (itstool) path: section/para #: book.translate.xml:898 msgid "" "PMake will examine the targets in the order <_:" "buildtarget-1/>, <_:buildtarget-2/>, <_:buildtarget-3/>, <_:buildtarget-4/>. " "If the makefile's author expected PMake to abort " "before making <_:buildtarget-5/> if an error occurred while making <_:" "buildtarget-6/>, or if <_:buildtarget-7/> needed to exist before <_:" "buildtarget-8/> was made, (s)he will be sorely disappointed. The " "dependencies are incomplete, since in both these cases, <_:buildtarget-9/> " "would depend on <_:buildtarget-10/>. So watch out." msgstr "" #. (itstool) path: section/para #: book.translate.xml:911 msgid "" "Another problem you may face is that, while PMake " "is set up to handle the output from multiple jobs in a graceful fashion, the " "same is not so for input. It has no way to regulate input to different jobs, " "so if you use the redirection from /dev/tty I mentioned " "earlier, you must be careful not to run two of the jobs at once." msgstr "" #. (itstool) path: section/title #: book.translate.xml:921 msgid "Writing and Debugging a Makefile" msgstr "" #. (itstool) path: section/para #: book.translate.xml:923 msgid "" "Now you know most of what is in a Makefile, what do you " "do next? There are two choices: use one of the uncommonly-available makefile " "generators or write your own makefile (I leave out the third choice of " "ignoring PMake and doing everything by hand as " "being beyond the bounds of common sense)." msgstr "" #. (itstool) path: section/para #: book.translate.xml:931 msgid "" "When faced with the writing of a makefile, it is usually best to start from " "first principles: just what are you trying to do? What do you want the " "makefile finally to produce? To begin with a somewhat traditional example, " "let's say you need to write a makefile to create a program, expr, that takes standard infix expressions and converts them to prefix " "form (for no readily apparent reason). You have got three source files, in " "C, that make up the program: main.c, parse.c, and output.c. Harking back to my pithy " "advice about dependency lines, you write the first line of the file:" msgstr "" #. (itstool) path: section/programlisting #: book.translate.xml:944 #, no-wrap msgid "expr : main.o parse.o output.o" msgstr "" #. (itstool) path: section/para #: book.translate.xml:946 msgid "" "because you remember expr is made from .o files, not .c files. Similarly for the " ".o files you produce the lines:" msgstr "" #. (itstool) path: section/programlisting #: book.translate.xml:951 #, no-wrap msgid "" "main.o : main.c\n" "\n" "parse.o : parse.c\n" "\n" "output.o : output.c\n" "\n" "main.o parse.o output.o : defs.h" msgstr "" #. (itstool) path: section/para #: book.translate.xml:959 msgid "" "Great. You have now got the dependencies specified. What you need now is " "commands. These commands, remember, must produce the target on the " "dependency line, usually by using the sources you have listed. You remember " "about local variables? Good, so it should come to you as no surprise when " "you write:" msgstr "" #. (itstool) path: section/programlisting #: book.translate.xml:966 #, no-wrap msgid "expr : main.o parse.o output.o\n" " cc -o $(.TARGET) $(.ALLSRC)" msgstr "" #. (itstool) path: section/para #: book.translate.xml:969 msgid "" "Why use the variables? If your program grows to produce postfix expressions " "too (which, of course, requires a name change or two), it is one fewer place " "you have to change the file. You cannot do this for the object files, " "however, because they depend on their corresponding source files and " "defs.h, thus if you said:" msgstr "" #. (itstool) path: section/programlisting #: book.translate.xml:976 #, no-wrap msgid "cc -c $(.ALLSRC)" msgstr "" #. (itstool) path: section/para #: book.translate.xml:978 msgid "you will get (for main.o):" msgstr "" #. (itstool) path: section/programlisting #: book.translate.xml:980 #, no-wrap msgid "cc -c main.c defs.h" msgstr "" #. (itstool) path: section/para #: book.translate.xml:982 msgid "which is wrong. So you round out the makefile with these lines:" msgstr "" #. (itstool) path: section/programlisting #: book.translate.xml:985 #, no-wrap msgid "" "main.o : main.c\n" " cc -c main.c\n" "\n" "parse.o : parse.c\n" " cc -c parse.c\n" "\n" "output.o : output.c\n" " cc -c output.c" msgstr "" #. (itstool) path: section/para #: book.translate.xml:994 msgid "" "The makefile is now complete and will, in fact, create the program you want " "it to without unnecessary compilations or excessive typing on your part. " "There are two things wrong with it, however (aside from it being altogether " "too long, something I will address in ):" msgstr "" #. (itstool) path: listitem/para #: book.translate.xml:1002 msgid "" "The string main.o parse.o output.o is repeated twice, " "necessitating two changes when you add postfix (you were planning on that, " "were not you?). This is in direct violation of de Boor's First Rule of " "writing makefiles:" msgstr "" #. (itstool) path: listitem/para #: book.translate.xml:1008 msgid "" "Anything that needs to be written more than once should be placed in a " "variable. I cannot emphasize this enough as being very important to the " "maintenance of a makefile and its program." msgstr "" #. (itstool) path: listitem/para #: book.translate.xml:1015 msgid "" "There is no way to alter the way compilations are performed short of editing " "the makefile and making the change in all places. This is evil and violates " "de Boor's Second Rule, which follows directly from the first:" msgstr "" #. (itstool) path: listitem/para #: book.translate.xml:1020 msgid "" "Any flags or programs used inside a makefile should be placed in a variable " "so they may be changed, temporarily or permanently, with the greatest ease." msgstr "" #. (itstool) path: section/para #: book.translate.xml:1026 msgid "The makefile should more properly read:" msgstr "" #. (itstool) path: section/programlisting #: book.translate.xml:1028 #, no-wrap msgid "" "OBJS = main.o parse.o output.o\n" "\n" "expr : $(OBJS)\n" " $(CC) $(CFLAGS) -o $(.TARGET) $(.ALLSRC)\n" "\n" "main.o : main.c\n" " $(CC) $(CFLAGS) -c main.c\n" "\n" "parse.o : parse.c\n" " $(CC) $(CFLAGS) -c parse.c\n" "\n" "output.o : output.c\n" " $(CC) $(CFLAGS) -c output.c\n" "\n" "$(OBJS) : defs.h" msgstr "" #. (itstool) path: section/para #: book.translate.xml:1044 msgid "" "Alternatively, if you like the idea of dynamic sources mentioned in , you could write it like this:" msgstr "" #. (itstool) path: section/programlisting #: book.translate.xml:1048 #, no-wrap msgid "" "OBJS = main.o parse.o output.o\n" "\n" "expr : $(OBJS)\n" " $(CC) $(CFLAGS) -o $(.TARGET) $(.ALLSRC)\n" "\n" "$(OBJS) : $(.PREFIX).c defs.h\n" " $(CC) $(CFLAGS) -c $(.PREFIX).c" msgstr "" #. (itstool) path: section/para #: book.translate.xml:1056 msgid "" "These two rules and examples lead to de Boor's First Corollary: " "Variables are your friends." msgstr "" #. (itstool) path: section/para #: book.translate.xml:1060 msgid "" "Once you have written the makefile comes the sometimes-difficult task of " "making sure the darn thing works. Your most helpful tool to make sure the " "makefile is at least syntactically correct is the flag, " "which allows you to see if PMake will choke on " "the makefile. The second thing the flag lets you do is " "see what PMake would do without it actually doing " "it, thus you can make sure the right commands would be executed were you to " "give PMake its head." msgstr "" #. (itstool) path: section/para #: book.translate.xml:1071 msgid "" "When you find your makefile is not behaving as you hoped, the first question " "that comes to mind (after What time is it, anyway?) is " "Why not? In answering this, two flags will serve you well: " "-d m and -p 2. The first causes " "PMake to tell you as it examines each target in " "the makefile and indicate why it is deciding whatever it is deciding. You " "can then use the information printed for other targets to see where you went " "wrong. The -p 2 flag makes PMake " "print out its internal state when it is done, allowing you to see that you " "forgot to make that one chapter depend on that file of macros you just got a " "new version of. The output from -p 2 is intended to resemble " "closely a real makefile, but with additional information provided and with " "variables expanded in those commands PMake " "actually printed or executed." msgstr "" #. (itstool) path: section/para #: book.translate.xml:1090 msgid "" "Something to be especially careful about is circular dependencies. For " "example:" msgstr "" #. (itstool) path: section/programlisting #: book.translate.xml:1093 #, no-wrap msgid "a : b\n" "\n" "b : c d\n" "\n" "d : a" msgstr "" #. (itstool) path: section/para #: book.translate.xml:1099 msgid "" "In this case, because of how PMake works, <_:" "buildtarget-1/> is the only thing PMake will " "examine, because <_:buildtarget-2/> and <_:buildtarget-3/> will effectively " "fall off the edge of the universe, making it impossible to examine <_:" "buildtarget-4/> (or them, for that matter). PMake " "will tell you (if run in its normal mode) all the targets involved in any " "cycle it looked at (i.e. if you have two cycles in the graph (naughty, " "naughty), but only try to make a target in one of them, PMake will only tell you about that one. You will have to try to make " "the other to find the second cycle). When run as Make, it will only print the first target in the cycle." msgstr "" #. (itstool) path: section/title #: book.translate.xml:1117 msgid "Invoking PMake" msgstr "" #. (itstool) path: section/para #: book.translate.xml:1119 msgid "" "PMake comes with a wide variety of flags to " "choose from. They may appear in any order, interspersed with command-line " "variable assignments and targets to create. The flags are as follows:" msgstr "" #. (itstool) path: varlistentry/term #: book.translate.xml:1126 msgid "" msgstr "" #. (itstool) path: listitem/para #: book.translate.xml:1129 msgid "" "This causes PMake to spew out debugging " "information that may prove useful to you. If you cannot figure out why " "PMake is doing what it is doing, you might try " "using this flag. The what parameter is a string " "of single characters that tell PMake what aspects " "you are interested in. Most of what I describe will make little sense to " "you, unless you have dealt with Make before. Just " "remember where this table is and come back to it as you read on. The " "characters and the information they produce are as follows:" msgstr "" #. (itstool) path: row/entry #: book.translate.xml:1148 msgid "a" msgstr "" #. (itstool) path: row/entry #: book.translate.xml:1150 msgid "Archive searching and caching." msgstr "" #. (itstool) path: row/entry #: book.translate.xml:1154 msgid "c" msgstr "" #. (itstool) path: row/entry #: book.translate.xml:1156 msgid "Conditional evaluation." msgstr "" #. (itstool) path: row/entry #: book.translate.xml:1160 msgid "d" msgstr "" #. (itstool) path: row/entry #: book.translate.xml:1162 msgid "The searching and caching of directories." msgstr "" #. (itstool) path: row/entry #: book.translate.xml:1167 msgid "j" msgstr "" #. (itstool) path: row/entry #: book.translate.xml:1169 msgid "" "Various snippets of information related to the running of the multiple " "shells. Not particularly interesting." msgstr "" #. (itstool) path: row/entry #: book.translate.xml:1175 msgid "m" msgstr "" #. (itstool) path: row/entry #: book.translate.xml:1177 msgid "" "The making of each target: what target is being examined; when it was last " "modified; whether it is out-of-date; etc." msgstr "" #. (itstool) path: row/entry #: book.translate.xml:1183 msgid "p" msgstr "" #. (itstool) path: row/entry #: book.translate.xml:1185 msgid "Makefile parsing." msgstr "" #. (itstool) path: row/entry #: book.translate.xml:1189 msgid "r" msgstr "" #. (itstool) path: row/entry #: book.translate.xml:1191 msgid "Remote execution." msgstr "" #. (itstool) path: row/entry #: book.translate.xml:1195 msgid "s" msgstr "" #. (itstool) path: row/entry #: book.translate.xml:1197 msgid "" "The application of suffix-transformation rules. (See .)" msgstr "" #. (itstool) path: row/entry #: book.translate.xml:1202 msgid "t" msgstr "" #. (itstool) path: row/entry #: book.translate.xml:1204 msgid "The maintenance of the list of targets." msgstr "" #. (itstool) path: row/entry #: book.translate.xml:1208 msgid "v" msgstr "" #. (itstool) path: row/entry #: book.translate.xml:1210 msgid "Variable assignment." msgstr "" #. (itstool) path: listitem/para #: book.translate.xml:1216 msgid "" "Of these all, the m and s letters will " "be most useful to you. If the is the final argument or " "the argument from which it would get these key letters (see below for a note " "about which argument would be used) begins with a –, all of these debugging " "flags will be set, resulting in massive amounts of output." msgstr "" #. (itstool) path: varlistentry/term #: book.translate.xml:1227 msgid " makefile" msgstr "" #. (itstool) path: listitem/para #: book.translate.xml:1230 msgid "" "Specify a makefile to read different from the standard makefiles " "(Makefile or makefile). If " "makefile is -, PMake uses the " "standard input. This is useful for making quick and dirty makefiles." msgstr "" #. (itstool) path: varlistentry/term #: book.translate.xml:1240 msgid "" msgstr "" #. (itstool) path: listitem/para #: book.translate.xml:1243 msgid "" "Prints out a summary of the various flags PMake " "accepts. It can also be used to find out what level of concurrency was " "compiled into the version of PMake you are using " "(look at -J and -L) and various other " "information on how PMake was configured." msgstr "" #. (itstool) path: varlistentry/term #: book.translate.xml:1254 msgid "" msgstr "" #. (itstool) path: listitem/para #: book.translate.xml:1257 msgid "" "If you give this flag, PMake will ignore non-zero " "status returned by any of its shells. It is like placing a - before all the commands in the makefile." msgstr "" #. (itstool) path: varlistentry/term #: book.translate.xml:1265 msgid "" msgstr "" #. (itstool) path: listitem/para #: book.translate.xml:1268 msgid "" "This is similar to in that it allows PMake to continue when it sees an error, but unlike causes it to recognize the error and " "only continue work on those things that do not depend on the target, either " "directly or indirectly (through depending on something that depends on it), " "whose creation returned the error. The is for keep " "going." msgstr "" #. (itstool) path: varlistentry/term #: book.translate.xml:1281 msgid "" msgstr "" #. (itstool) path: listitem/para #: book.translate.xml:1284 msgid "" "PMake has the ability to lock a directory against " "other people executing it in the same directory (by means of a file called " "LOCK.make that it creates and checks for in the " "directory). This is a Good Thing because two people doing the same thing in " "the same place can be disastrous for the final product (too many cooks and " "all that). Whether this locking is the default is up to your system " "administrator. If locking is on, will turn it off, and " "vice versa. Note that this locking will not prevent you from invoking " "PMake twice in the same place–if you own the lock " "file, PMake will warn you about it but continue " "to execute." msgstr "" #. (itstool) path: varlistentry/term #: book.translate.xml:1301 msgid "" msgstr "" #. (itstool) path: listitem/para #: book.translate.xml:1304 msgid "" "Tells PMake another place to search for included " "makefiles via the <filename> style. Several " "-m options can be given to form a search path. If this " "construct is used the default system makefile search path is completely " "overridden." msgstr "" #. (itstool) path: varlistentry/term #: book.translate.xml:1314 msgid "" msgstr "" #. (itstool) path: listitem/para #: book.translate.xml:1317 msgid "" "This flag tells PMake not to execute the commands " "needed to update the out-of-date targets in the makefile. Rather, " "PMake will simply print the commands it would " "have executed and exit. This is particularly useful for checking the " "correctness of a makefile. If PMake does not do " "what you expect it to, it is a good chance the makefile is wrong." msgstr "" #. (itstool) path: varlistentry/term #: book.translate.xml:1328 msgid "" msgstr "" #. (itstool) path: listitem/para #: book.translate.xml:1331 msgid "" "This causes PMake to print its input in a " "reasonable form, though not necessarily one that would make immediate sense " "to anyone but me. The number is a bitwise OR of 1 and 2, where 1 means it " "should print the input before doing any processing and 2 says it should " "print it after everything has been re-created. Thus " "would print it twice-a-once before processing and once after (you might find " "the difference between the two interesting). This is mostly useful to me, " "but you may find it informative in some bizarre circumstances." msgstr "" #. (itstool) path: varlistentry/term #: book.translate.xml:1345 msgid "" msgstr "" #. (itstool) path: listitem/para #: book.translate.xml:1348 msgid "" "If you give PMake this flag, it will not try to " "re-create anything. It will just see if anything is out-of-date and exit non-" "zero if so." msgstr "" #. (itstool) path: varlistentry/term #: book.translate.xml:1355 msgid "" msgstr "" #. (itstool) path: listitem/para #: book.translate.xml:1358 msgid "" "When PMake starts up, it reads a default makefile " "that tells it what sort of system it is on and gives it some idea of what to " "do if you do not tell it anything. I will tell you about it in . If you give this flag, PMake " "will not read the default makefile." msgstr "" #. (itstool) path: varlistentry/term #: book.translate.xml:1368 msgid "" msgstr "" #. (itstool) path: listitem/para #: book.translate.xml:1371 msgid "" "This causes PMake to not print commands before " "they are executed. It is the equivalent of putting an @ " "before every command in the makefile." msgstr "" #. (itstool) path: varlistentry/term #: book.translate.xml:1379 msgid "" msgstr "" #. (itstool) path: listitem/para #: book.translate.xml:1382 msgid "" "Rather than try to re-create a target, PMake will " "simply touch it so as to make it appear up-to-date. If the " "target did not exist before, it will when PMake " "finishes, but if the target did exist, it will appear to have been updated." msgstr "" #. (itstool) path: varlistentry/term #: book.translate.xml:1392 msgid "" msgstr "" #. (itstool) path: listitem/para #: book.translate.xml:1395 msgid "" "Targets can still be created in parallel, however. This is the mode " "PMake will enter if it is invoked either as " "smake or vmake." msgstr "" #. (itstool) path: varlistentry/term #: book.translate.xml:1403 msgid "" msgstr "" #. (itstool) path: listitem/para #: book.translate.xml:1406 msgid "" "This tells PMake it is OK to export jobs to other " "machines, if they are available. It is used when running in Make mode, as " "exporting in this mode tends to make things run slower than if the commands " "were just executed locally." msgstr "" #. (itstool) path: varlistentry/term #: book.translate.xml:1415 msgid "" msgstr "" #. (itstool) path: listitem/para #: book.translate.xml:1418 msgid "" "Forces PMake to be as backwards-compatible with " "Make as possible while still being itself. This " "includes:" msgstr "" #. (itstool) path: listitem/para #: book.translate.xml:1424 msgid "Executing one shell per shell command" msgstr "" #. (itstool) path: listitem/para #: book.translate.xml:1428 msgid "" "Expanding anything that looks even vaguely like a variable, with the empty " "string replacing any variable PMake does not know." "" msgstr "" #. (itstool) path: listitem/para #: book.translate.xml:1434 msgid "" "Refusing to allow you to escape a # with a backslash." msgstr "" #. (itstool) path: listitem/para #: book.translate.xml:1439 msgid "" "Permitting undefined variables on dependency lines and conditionals (see " "below). Normally this causes PMake to abort." msgstr "" #. (itstool) path: varlistentry/term #: book.translate.xml:1448 msgid "" msgstr "" #. (itstool) path: listitem/para #: book.translate.xml:1451 msgid "" "This nullifies any and all compatibility mode flags you may have given or " "implied up to the time the is encountered. It is useful " "mostly in a makefile that you wrote for PMake to " "avoid bad things happening when someone runs PMake as make or has things set in the " "environment that tell it to be compatible. is not placed " "in the PMAKE environment variable or the .MAKEFLAGS or MFLAGS global variables." msgstr "" #. (itstool) path: varlistentry/term #: book.translate.xml:1465 msgid "" msgstr "" #. (itstool) path: listitem/para #: book.translate.xml:1468 msgid "" "Allows you to define a variable to have 1 as its value. The " "variable is a global variable, not a command-line variable. This is useful " "mostly for people who are used to the C compiler arguments and those using " "conditionals, which I will get into in ." msgstr "" #. (itstool) path: varlistentry/term #: book.translate.xml:1477 msgid "" msgstr "" #. (itstool) path: listitem/para #: book.translate.xml:1480 msgid "" "Tells PMake another place to search for included " "makefiles. Yet another thing to be explained in (, to be precise)." msgstr "" #. (itstool) path: varlistentry/term #: book.translate.xml:1488 msgid "" msgstr "" #. (itstool) path: listitem/para #: book.translate.xml:1491 msgid "" "Gives the absolute maximum number of targets to create at once on both local " "and remote machines." msgstr "" #. (itstool) path: varlistentry/term #: book.translate.xml:1497 msgid "" msgstr "" #. (itstool) path: listitem/para #: book.translate.xml:1500 msgid "" "This specifies the maximum number of targets to create on the local machine " "at once. This may be 0, though you should be wary of " "doing this, as PMake may hang until a remote " "machine becomes available, if one is not available when it is started." msgstr "" #. (itstool) path: varlistentry/term #: book.translate.xml:1510 msgid "" msgstr "" #. (itstool) path: listitem/para #: book.translate.xml:1513 msgid "" "This is the flag that provides absolute, complete, full compatibility with " "Make. It still allows you to use all but a few of " "the features of PMake, but it is non-parallel. " "This is the mode PMake enters if you call it " "make." msgstr "" #. (itstool) path: varlistentry/term #: book.translate.xml:1523 msgid "" msgstr "" #. (itstool) path: listitem/para #: book.translate.xml:1526 msgid "" "When creating targets in parallel, several shells are executing at once, " "each wanting to write its own two cents'-worth to the screen. This output " "must be captured by PMake in some way in order to " "prevent the screen from being filled with garbage even more indecipherable " "than you usually see. PMake has two ways of doing " "this, one of which provides for much cleaner output and a clear separation " "between the output of different jobs, the other of which provides a more " "immediate response so one can tell what is really happening. The former is " "done by notifying you when the creation of a target starts, capturing the " "output and transferring it to the screen all at once when the job finishes. " "The latter is done by catching the output of the shell (and its children) " "and buffering it until an entire line is received, then printing that line " "preceded by an indication of which job produced the output. Since I prefer " "this second method, it is the one used by default. The first method will be " "used if you give the flag to PMake." msgstr "" #. (itstool) path: varlistentry/term #: book.translate.xml:1549 msgid "" msgstr "" #. (itstool) path: listitem/para #: book.translate.xml:1552 msgid "" "As mentioned before, the flag tells PMake to use Make's style of expanding " "variables, substituting the empty string for any variable it does not know." msgstr "" #. (itstool) path: varlistentry/term #: book.translate.xml:1561 msgid "" msgstr "" #. (itstool) path: listitem/para #: book.translate.xml:1564 msgid "" "There are several times when PMake will print a " "message at you that is only a warning, i.e. it can continue to work in spite " "of your having done something silly (such as forgotten a leading tab for a " "shell command). Sometimes you are well aware of silly things you have done " "and would like PMake to stop bothering you. This " "flag tells it to shut up about anything non-fatal." msgstr "" #. (itstool) path: varlistentry/term #: book.translate.xml:1575 msgid "" msgstr "" #. (itstool) path: listitem/para #: book.translate.xml:1578 msgid "" "This flag causes PMake to not attempt to export " "any jobs to another machine." msgstr "" #. (itstool) path: section/para #: book.translate.xml:1584 msgid "" "Several flags may follow a single -. Those flags that " "require arguments take them from successive parameters. For example:" msgstr "" #. (itstool) path: section/screen #: book.translate.xml:1588 #, no-wrap msgid "pmake -fDnI server.mk DEBUG /chip2/X/server/include" msgstr "" #. (itstool) path: section/para #: book.translate.xml:1590 msgid "" "will cause PMake to read server.mk as the input makefile, define the variable DEBUG as a global variable and look for included makefiles in the " "directory /chip2/X/server/include." msgstr "" #. (itstool) path: section/title #: book.translate.xml:1598 msgid "Summary" msgstr "" #. (itstool) path: section/para #: book.translate.xml:1600 msgid "A makefile is made of four types of lines:" msgstr "" #. (itstool) path: listitem/para #: book.translate.xml:1604 msgid "Dependency lines" msgstr "" #. (itstool) path: section/para #: book.translate.xml:1620 msgid "" "A dependency line is a list of one or more targets, an operator (:, ::, or !), and a list of " "zero or more sources. Sources may contain wildcards and certain local " "variables." msgstr "" #. (itstool) path: section/para #: book.translate.xml:1625 msgid "" "A creation command is a regular shell command preceded by a tab. In " "addition, if the first two characters after the tab (and other whitespace) " "are a combination of @ or -, " "PMake will cause the command to not be printed " "(if the character is @) or errors from it to be ignored " "(if -). A blank line, dependency line or variable " "assignment terminates a creation script. There may be only one creation " "script for each target with a : or ! " "operator." msgstr "" #. (itstool) path: section/para #: book.translate.xml:1635 msgid "" "Variables are places to store text. They may be unconditionally assigned-to " "using the = operator, appended-to using the += operator, conditionally (if the variable is undefined) assigned-to " "with the ?= operator, and assigned-to with variable " "expansion with the := operator. The output of a shell " "command may be assigned to a variable using the != " "operator. Variables may be expanded (their value inserted) by enclosing " "their name in parentheses or curly braces, preceded by a dollar sign. A " "dollar sign may be escaped with another dollar sign. Variables are not " "expanded if PMake does not know about them. There " "are seven local variables: .TARGET, .ALLSRC, .OODATE, .PREFIX, ." "IMPSRC, .ARCHIVE, and .MEMBER. Four of them (.TARGET, .PREFIX, .ARCHIVE, and .MEMBER) may " "be used to specify dynamic sources. Variables are good. Know " "them. Love them. Live them." msgstr "" #. (itstool) path: section/para #: book.translate.xml:1655 msgid "" "Debugging of makefiles is best accomplished using the , " ", and flags." msgstr "" #. (itstool) path: chapter/title #: book.translate.xml:1666 msgid "Short-cuts and Other Nice Things" msgstr "" #. (itstool) path: chapter/para #: book.translate.xml:1668 msgid "" "Based on what I have told you so far, you may have gotten the impression " "that PMake is just a way of storing away commands " "and making sure you do not forget to compile something. Good. That is just " "what it is. However, the ways I have described have been inelegant, at best, " "and painful, at worst. This chapter contains things that make the writing of " "makefiles easier and the makefiles themselves shorter and easier to modify " "(and, occasionally, simpler). In this chapter, I assume you are somewhat " "more familiar with Sprite (or UNIX, if that is what you are using) than I did in , just so you are on your toes. So without further ado…" msgstr "" #. (itstool) path: section/title #: book.translate.xml:1681 msgid "Transformation Rules" msgstr "" #. (itstool) path: section/para #: book.translate.xml:1683 msgid "" "As you know, a file's name consists of two parts: a base name, which gives " "some hint as to the contents of the file, and a suffix, which usually " "indicates the format of the file. Over the years, as UNIX has developed, naming conventions, with " "regard to suffixes, have also developed that have become almost as " "incontrovertible as Law. E.g. a file ending in .c is " "assumed to contain C source code; one with a .o suffix " "is assumed to be a compiled, relocatable object file that may be linked into " "any program; a file with a .ms suffix is usually a text " "file to be processed by Troff with the -" "ms macro package, and so on. One of the best aspects of both " "Make and PMake comes " "from their understanding of how the suffix of a file pertains to its " "contents and their ability to do things with a file based solely on its " "suffix. This ability comes from something known as a transformation rule. A " "transformation rule specifies how to change a file with one suffix into a " "file with another suffix." msgstr "" #. (itstool) path: section/para #: book.translate.xml:1704 msgid "" "A transformation rule looks much like a dependency line, except the target " "is made of two known suffixes stuck together. Suffixes are made known to " "PMake by placing them as sources on a dependency " "line whose target is the special target .SUFFIXES. E.g.:" msgstr "" #. (itstool) path: section/programlisting #: book.translate.xml:1711 #, no-wrap msgid ".SUFFIXES : .o .c\n" ".c.o :\n" " $(CC) $(CFLAGS) -c $(.IMPSRC)" msgstr "" #. (itstool) path: section/para #: book.translate.xml:1715 msgid "" "The creation script attached to the target is used to trans form a file with " "the first suffix (in this case, .c) into a file with " "the second suffix (here, .o). In addition, the target " "inherits whatever attributes have been applied to the transformation rule. " "The simple rule given above says that to transform a C source file into an " "object file, you compile it using cc with the " " flag. This rule is taken straight from the system " "makefile. Many transformation rules (and suffixes) are defined there, and I " "refer you to it for more examples (type pmake -h to find " "out where it is)." msgstr "" #. (itstool) path: section/para #: book.translate.xml:1730 msgid "" "There are several things to note about the transformation rule given above:" msgstr "" #. (itstool) path: listitem/para #: book.translate.xml:1735 msgid "" "The .IMPSRC variable. This variable is set to the " "implied source (the file from which the target is being " "created; the one with the first suffix), which, in this case, is the " ".c file." msgstr "" #. (itstool) path: listitem/para #: book.translate.xml:1744 msgid "" "The CFLAGS variable. Almost all of the transformation rules " "in the system makefile are set up using variables that you can alter in your " "makefile to tailor the rule to your needs. In this case, if you want all " "your C files to be compiled with the flag, to provide " "information for dbx, you would set the CFLAGS variable to " "contain (CFLAGS = -g) and " "PMake would take care of the rest." msgstr "" #. (itstool) path: section/para #: book.translate.xml:1757 msgid "" "To give you a quick example, the makefile in " "could be changed to this:" msgstr "" #. (itstool) path: section/programlisting #: book.translate.xml:1760 #, no-wrap msgid "" "OBJS = a.o b.o c.o\n" "program : $(OBJS)\n" " $(CC) -o $(.TARGET) $(.ALLSRC)\n" "$(OBJS) : defs.h" msgstr "" #. (itstool) path: footnote/para #: book.translate.xml:1768 msgid "" "This is also somewhat cleaner, I think, than the dynamic source solution " "presented in ." msgstr "" #. (itstool) path: section/para #: book.translate.xml:1765 msgid "" "The transformation rule I gave above takes the place of the 6 lines <_:" "footnote-1/>:" msgstr "" #. (itstool) path: section/programlisting #: book.translate.xml:1773 #, no-wrap msgid "" "a.o : a.c\n" " cc -c a.c\n" "b.o : b.c\n" " cc -c b.c\n" "c.o : c.c\n" " cc -c c.c" msgstr "" #. (itstool) path: section/para #: book.translate.xml:1780 msgid "" "Now you may be wondering about the dependency between the .o and .c files – it is not mentioned anywhere " "in the new makefile. This is because it is not needed: one of the effects of " "applying a transformation rule is the target comes to depend on the implied " "source. That's why it is called the implied source." msgstr "" #. (itstool) path: section/para #: book.translate.xml:1788 msgid "For a more detailed example. Say you have a makefile like this:" msgstr "" #. (itstool) path: section/programlisting #: book.translate.xml:1791 #, no-wrap msgid "a.out : a.o b.o\n" " $(CC) $(.ALLSRC)" msgstr "" #. (itstool) path: section/para #: book.translate.xml:1794 msgid "and a directory set up like this:" msgstr "" #. (itstool) path: section/screen #: book.translate.xml:1796 #, no-wrap msgid "" "total 4\n" "-rw-rw-r-- 1 deboor 34 Sep 7 00:43 Makefile\n" "-rw-rw-r-- 1 deboor 119 Oct 3 19:39 a.c\n" "-rw-rw-r-- 1 deboor 201 Sep 7 00:43 a.o\n" "-rw-rw-r-- 1 deboor 69 Sep 7 00:43 b.c" msgstr "" #. (itstool) path: section/para #: book.translate.xml:1802 msgid "" "While just typing pmake will do the right thing, it is " "much more informative to type pmake -d s. This will show " "you what PMake is up to as it processes the files." " In this case, PMake prints the following:" msgstr "" #. (itstool) path: section/screen #: book.translate.xml:1809 #, no-wrap msgid "" "Suff_FindDeps (a.out)\n" " using existing source a.o\n" " applying .o -> .out to \"a.o\"\n" "Suff_FindDeps (a.o)\n" " trying a.c...got it\n" " applying .c -> .o to \"a.c\"\n" "Suff_FindDeps (b.o)\n" " trying b.c...got it\n" " applying .c -> .o to \"b.c\"\n" "Suff_FindDeps (a.c)\n" " trying a.y...not there\n" " trying a.l...not there\n" " trying a.c,v...not there\n" " trying a.y,v...not there\n" " trying a.l,v...not there\n" "Suff_FindDeps (b.c)\n" " trying b.y...not there\n" " trying b.l...not there\n" " trying b.c,v...not there\n" " trying b.y,v...not there\n" " trying b.l,v...not there\n" "--- a.o ---\n" "cc -c a.c\n" "--- b.o ---\n" "cc -c b.c\n" "--- a.out ---\n" "cc a.o b.o" msgstr "" #. (itstool) path: section/para #: book.translate.xml:1837 msgid "" "Suff_FindDeps is the name of a function in " "PMake that is called to check for implied sources " "for a target using transformation rules. The transformations it tries are, " "naturally enough, limited to the ones that have been defined (a " "transformation may be defined multiple times, by the way, but only the most " "recent one will be used). You will notice, however, that there is a definite " "order to the suffixes that are tried. This order is set by the relative " "positions of the suffixes on the .SUFFIXES line – the " "earlier a suffix appears, the earlier it is checked as the source of a " "transformation. Once a suffix has been defined, the only way to change its " "position in the pecking order is to remove all the suffixes (by having a " ".SUFFIXES dependency line with no sources) and redefine " "them in the order you want. (Previously-defined transformation rules will be " "automatically redefined as the suffixes they involve are re-entered.) " "Another way to affect the search order is to make the dependency explicit. " "In the above example, a.out depends on a.o and b.o. Since a transformation exists from " ".o to .out, PMake uses that, as indicated by the using existing " "source a.o message." msgstr "" #. (itstool) path: section/para #: book.translate.xml:1864 msgid "" "The search for a transformation starts from the suffix of the target and " "continues through all the defined transformations, in the order dictated by " "the suffix ranking, until an existing file with the same base (the target " "name minus the suffix and any leading directories) is found. At that point, " "one or more transformation rules will have been found to change the one " "existing file into the target." msgstr "" #. (itstool) path: section/para #: book.translate.xml:1872 msgid "" "For example, ignoring what's in the system makefile for now, say you have a " "makefile like this:" msgstr "" #. (itstool) path: section/screen #: book.translate.xml:1875 #, no-wrap msgid "" ".SUFFIXES : .out .o .c .y .l\n" ".l.c :\n" " lex $(.IMPSRC)\n" " mv lex.yy.c $(.TARGET)\n" ".y.c :\n" " yacc $(.IMPSRC)\n" " mv y.tab.c $(.TARGET)\n" ".c.o :\n" " cc -c $(.IMPSRC)\n" ".o.out :\n" " cc -o $(.TARGET) $(.IMPSRC)" msgstr "" #. (itstool) path: section/para #: book.translate.xml:1887 msgid "" "and the single file jive.l. If you were to type " "pmake -rd ms jive.out, you would get the following output " "for jive.out:" msgstr "" #. (itstool) path: section/screen #: book.translate.xml:1892 #, no-wrap msgid "" "Suff_FindDeps (jive.out)\n" " trying jive.o...not there\n" " trying jive.c...not there\n" " trying jive.y...not there\n" " trying jive.l...got it\n" " applying .l -> .c to \"jive.l\"\n" " applying .c -> .o to \"jive.c\"\n" " applying .o -> .out to \"jive.o\"" msgstr "" #. (itstool) path: section/para #: book.translate.xml:1901 msgid "" "and this is why: PMake starts with the target " "jive.out, figures out its suffix (.out) and looks for things it can transform to a .out file. In this case, it only finds .o, so it " "looks for the file jive.o. It fails to find it, so it " "looks for transformations into a .o file. Again it has " "only one choice: .c. So it looks for jive.c and, as you know, fails to find it. At this point it has two " "choices: it can create the .c file from either a " ".y file or a .l file. Since " ".y came first on the .SUFFIXES line, " "it checks for jive.y first, but can not find it, so it " "looks for jive.l and, lo and behold, there it is. At " "this point, it has defined a transformation path as follows:" msgstr "" #. (itstool) path: section/literallayout #: book.translate.xml:1919 #, no-wrap msgid "" ".l -> .c -> ." "o -> .out" msgstr "" #. (itstool) path: section/para #: book.translate.xml:1921 msgid "" "and applies the transformation rules accordingly. For completeness, and to " "give you a better idea of what PMake actually did " "with this three-step transformation, this is what PMake printed for the rest of the process:" msgstr "" #. (itstool) path: section/screen #: book.translate.xml:1927 #, no-wrap msgid "" "Suff_FindDeps (jive.o)\n" " using existing source jive.c\n" " applying .c -> .o to \"jive.c\"\n" "Suff_FindDeps (jive.c)\n" " using existing source jive.l\n" " applying .l -> .c to \"jive.l\"\n" "Suff_FindDeps (jive.l)\n" "Examining jive.l...modified 17:16:01 Oct 4, 1987...up-to-date\n" "Examining jive.c...non-existent...out-of-date\n" "--- jive.c ---\n" "lex jive.l\n" "... meaningless lex output deleted ...\n" "mv lex.yy.c jive.c\n" "Examining jive.o...non-existent...out-of-date\n" "--- jive.o ---\n" "cc -c jive.c\n" "Examining jive.out...non-existent...out-of-date\n" "--- jive.out ---\n" "cc -o jive.out jive.o" msgstr "" #. (itstool) path: para/buildtarget #. (itstool) path: entry/buildtarget #: book.translate.xml:1952 book.translate.xml:2578 msgid ".NULL" msgstr "" #. (itstool) path: section/para #: book.translate.xml:1947 msgid "" "One final question remains: what does PMake do " "with targets that have no known suffix? PMake " "simply pretends it actually has a known suffix and searches for " "transformations accordingly. The suffix it chooses is the source for the <_:" "buildtarget-1/> target mentioned later. In the system makefile, ." "out is chosen as the null suffix because most " "people use PMake to create programs. You are, " "however, free and welcome to change it to a suffix of your own choosing. The " "null suffix is ignored, however, when PMake is in " "compatibility mode (see )." msgstr "" #. (itstool) path: section/title #: book.translate.xml:1963 msgid "Including Other Makefiles" msgstr "" #. (itstool) path: section/para #: book.translate.xml:1965 msgid "" "Just as for programs, it is often useful to extract certain parts of a " "makefile into another file and just include it in other makefiles somehow. " "Many compilers allow you say something like:" msgstr "" #. (itstool) path: section/programlisting #: book.translate.xml:1970 #, no-wrap msgid "#include \"defs.h\"" msgstr "" #. (itstool) path: section/para #: book.translate.xml:1972 msgid "" "to include the contents of defs.h in the source file. " "PMake allows you to do the same thing for " "makefiles, with the added ability to use variables in the filenames. An " "include directive in a makefile looks either like this:" msgstr "" #. (itstool) path: section/programlisting #: book.translate.xml:1978 #, no-wrap msgid "#include <file>" msgstr "" #. (itstool) path: section/para #: book.translate.xml:1980 msgid "or this:" msgstr "" #. (itstool) path: section/programlisting #: book.translate.xml:1982 #, no-wrap msgid "#include \"file\"" msgstr "" #. (itstool) path: section/para #: book.translate.xml:1984 msgid "" "The difference between the two is where PMake " "searches for the file: the first way, PMake will " "look for the file only in the system makefile directory (or directories) (to " "find out what that directory is, give PMake the " "-h flag). The system makefile directory search path can " "be overridden via the option. For files in double-" "quotes, the search is more complex:" msgstr "" #. (itstool) path: listitem/para #: book.translate.xml:1996 msgid "The directory of the makefile that's including the file." msgstr "" #. (itstool) path: listitem/para #: book.translate.xml:2001 msgid "" "The current directory (the one in which you invoked PMake)." msgstr "" #. (itstool) path: listitem/para #: book.translate.xml:2006 msgid "" "The directories given by you using flags, in the order " "in which you gave them." msgstr "" #. (itstool) path: listitem/para #: book.translate.xml:2012 msgid "" "Directories given by .PATH dependency lines (see )." msgstr "" #. (itstool) path: listitem/para #: book.translate.xml:2018 msgid "The system makefile directory." msgstr "" #. (itstool) path: section/para #: book.translate.xml:2022 msgid "in that order." msgstr "" #. (itstool) path: section/para #: book.translate.xml:2024 msgid "" "You are free to use PMake variables in the " "filename – PMake will expand them before " "searching for the file. You must specify the searching method with either " "angle brackets or double-quotes outside of a variable expansion. I.e. the " "following:" msgstr "" #. (itstool) path: section/programlisting #: book.translate.xml:2030 #, no-wrap msgid "SYSTEM = <command.mk>\n" "\n" "#include $(SYSTEM)" msgstr "" #. (itstool) path: section/para #: book.translate.xml:2034 msgid "will not work." msgstr "" #. (itstool) path: section/title #: book.translate.xml:2038 msgid "Saving Commands" msgstr "" #. (itstool) path: section/para #: book.translate.xml:2040 msgid "" "There may come a time when you will want to save certain commands to be " "executed when everything else is done. For instance: you are making several " "different libraries at one time and you want to create the members in " "parallel. Problem is, ranlib is another one of " "those programs that can not be run more than once in the same directory at " "the same time (each one creates a file called __.SYMDEF " "into which it stuffs information for the linker to use. Two of them running " "at once will overwrite each other's file and the result will be garbage for " "both parties). You might want a way to save the ranlib commands til the end " "so they can be run one after the other, thus keeping them from trashing each " "other's file. PMake allows you to do this by " "inserting an ellipsis (...) as a command between commands to " "be run at once and those to be run later." msgstr "" #. (itstool) path: section/para #: book.translate.xml:2057 msgid "" "So for the ranlib case above, you might do this:" msgstr "" #. (itstool) path: section/programlisting #: book.translate.xml:2060 #, no-wrap msgid "" "lib1.a : $(LIB1OBJS)\n" " rm -f $(.TARGET)\n" " ar cr $(.TARGET) $(.ALLSRC)\n" " ...\n" " ranlib $(.TARGET)\n" "\n" "lib2.a : $(LIB2OBJS)\n" " rm -f $(.TARGET)\n" " ar cr $(.TARGET) $(.ALLSRC)\n" " ...\n" " ranlib $(.TARGET)" msgstr "" #. (itstool) path: section/para #: book.translate.xml:2072 msgid "This would save both" msgstr "" #. (itstool) path: section/programlisting #: book.translate.xml:2074 #, no-wrap msgid "ranlib $(.TARGET)" msgstr "" #. (itstool) path: section/para #: book.translate.xml:2076 msgid "" "commands until the end, when they would run one after the other (using the " "correct value for the .TARGET variable, of course)." msgstr "" #. (itstool) path: section/para #: book.translate.xml:2080 msgid "" "Commands saved in this manner are only executed if PMake manages to re-create everything without an error." msgstr "" #. (itstool) path: section/title #: book.translate.xml:2086 msgid "Target Attributes" msgstr "" #. (itstool) path: section/para #: book.translate.xml:2088 msgid "" "PMake allows you to give attributes to targets by " "means of special sources. Like everything else PMake uses, these sources begin with a period and are made up of all " "upper-case letters. There are various reasons for using them, and I will try " "to give examples for most of them. Others you will have to find uses for " "yourself. Think of it as an exercise for the reader. By " "placing one (or more) of these as a source on a dependency line, you are " "marking the target(s) with that attribute. That is just the " "way I phrase it, so you know." msgstr "" #. (itstool) path: section/para #: book.translate.xml:2100 msgid "" "Any attributes given as sources for a transformation rule are applied to the " "target of the transformation rule when the rule is applied." msgstr "" #. (itstool) path: row/entry #: book.translate.xml:2111 msgid ".DONTCARE" msgstr "" #. (itstool) path: row/entry #: book.translate.xml:2113 msgid "" "If a target is marked with this attribute and PMake can not figure out how to create it, it will ignore this fact " "and assume the file is not really needed or actually exists and " "PMake just can not find it. This may prove wrong, " "but the error will be noted later on, not when PMake tries to create the target so marked. This attribute also " "prevents PMake from attempting to touch the " "target if it is given the flag." msgstr "" #. (itstool) path: row/entry #: book.translate.xml:2127 msgid ".EXEC" msgstr "" #. (itstool) path: para/buildtarget #: book.translate.xml:2142 msgid "COMPILE" msgstr "" #. (itstool) path: para/programlisting #: book.translate.xml:2145 #, no-wrap msgid "" "system : init a.fasl b.fasl c.fasl\n" " for i in $(.ALLSRC);\n" " do\n" " echo -n '(load \"' >> input\n" " echo -n ${i} >> input\n" " echo '\")' >> input\n" " done\n" " echo '(dump \"$(.TARGET)\")' >> input\n" " lisp < input\n" "\n" "a.fasl : a.l init COMPILE\n" "b.fasl : b.l init COMPILE\n" "c.fasl : c.l init COMPILE\n" "COMPILE : .USE\n" " echo '(compile \"$(.ALLSRC)\")' >> input\n" "init : .EXEC\n" " echo '(load-system)' > input" msgstr "" #. (itstool) path: entry/para #: book.translate.xml:2129 msgid "" "This attribute causes its shell script to be executed while having no effect " "on targets that depend on it. This makes the target into a sort of " "subroutine. An example. Say you have some LISP files that need to be " "compiled and loaded into a LISP process. To do this, you echo LISP commands " "into a file and execute a LISP with this file as its input when everything " "is done. Say also that you have to load other files from another system " "before you can compile your files and further, that you do not want to go " "through the loading and dumping unless one of your files has changed. Your " "makefile might look a little bit like this (remember, this is an educational " "example, and do not worry about the <_:buildtarget-1/> rule, all will soon " "become clear, grasshopper): <_:programlisting-2/> .EXEC " "sources, do not appear in the local variables of targets that depend on them " "(nor are they touched if PMake is given the " " flag). Note that all the rules, not just that for " "system, include init as a source. This is because none of the other targets " "can be made until init has been made, thus they depend on it." msgstr "" #. (itstool) path: row/entry #: book.translate.xml:2174 msgid ".EXPORT" msgstr "" #. (itstool) path: row/entry #: book.translate.xml:2176 msgid "" "This is used to mark those targets whose creation should be sent to another " "machine if at all possible. This may be used by some exportation schemes if " "the exportation is expensive. You should ask your system administrator if it " "is necessary." msgstr "" #. (itstool) path: row/entry #: book.translate.xml:2185 msgid ".EXPORTSAME" msgstr "" #. (itstool) path: row/entry #: book.translate.xml:2187 msgid "" "Tells the export system that the job should be exported to a machine of the " "same architecture as the current one. Certain operations (e.g. running text " "through nroff) can be performed the same on any architecture (CPU and " "operating system type), while others (e.g. compiling a program with cc) must " "be performed on a machine with the same architecture. Not all export systems " "will support this attribute." msgstr "" #. (itstool) path: row/entry #: book.translate.xml:2199 msgid ".IGNORE" msgstr "" #. (itstool) path: row/entry #: book.translate.xml:2201 msgid "" "Giving a target the .IGNORE attribute causes " "PMake to ignore errors from any of the target's " "commands, as if they all had - before them." msgstr "" #. (itstool) path: row/entry #: book.translate.xml:2209 msgid ".INVISIBLE" msgstr "" #. (itstool) path: para/programlisting #: book.translate.xml:2218 #, no-wrap msgid "" "prog1 : $(PROG1OBJS) prog2 MAKEINSTALL\n" "prog2 : $(PROG2OBJS) .INVISIBLE MAKEINSTALL" msgstr "" #. (itstool) path: para/buildtarget #: book.translate.xml:2226 msgid "prog2" msgstr "" #. (itstool) path: entry/para #: book.translate.xml:2211 msgid "" "This allows you to specify one target as a source for another without the " "one affecting the other's local variables. Useful if, say, you have a " "makefile that creates two programs, one of which is used to create the " "other, so it must exist before the other is created. You could say <_:" "programlisting-1/> where MAKEINSTALL is some complex " ".USE rule (see below) that depends on the ." "ALLSRC variable containing the right things. Without the ." "INVISIBLE attribute for <_:buildtarget-2/>, the " "MAKEINSTALL rule could not be applied. This is not as " "useful as it should be, and the semantics may change (or the whole thing go " "away) in the not-too-distant future." msgstr "" #. (itstool) path: row/entry #: book.translate.xml:2235 msgid ".JOIN" msgstr "" #. (itstool) path: para/programlisting #: book.translate.xml:2257 #, no-wrap msgid "" "program : $(OBJS) libraries\n" " cc -o $(.TARGET) $(.ALLSRC)\n" "\n" "libraries : lib1.a lib2.a lib3.a lib4.a .JOIN\n" " ranlib $(.OODATE)" msgstr "" #. (itstool) path: entry/para #: book.translate.xml:2237 msgid "" "This is another way to avoid performing some operations in parallel while " "permitting everything else to be done so. Specifically it forces the " "target's shell script to be executed only if one or more of the sources was " "out-of-date. In addition, the target's name, in both its .TARGET variable and all the local variables of any target that depends on " "it, is replaced by the value of its .ALLSRC variable. As " "an example, suppose you have a program that has four libraries that compile " "in the same directory along with, and at the same time as, the program. You " "again have the problem with ranlib that I mentioned earlier, only this time " "it is more severe: you can not just put the ranlib off to the end since the " "program will need those libraries before it can be re-created. You can do " "something like this: <_:programlisting-1/> In this case, PMake will re-create the $(OBJS) as necessary, " "along with lib1.a, lib2.a, " "lib3.a and lib4.a. It will then " "execute ranlib on any library that was changed and set program's ." "ALLSRC variable to contain what's in $(OBJS) " "followed by lib1.a lib2.a " "lib3.a lib4.a. In case you " "are wondering, it is called .JOIN because it joins " "together different threads of the input graph at the target " "marked with the attribute. Another aspect of the .JOIN " "attribute is it keeps the target from being created if the or flag. By doing this, you " "can start at the top of a system and type <_:literallayout-1/> and have it " "descend the directory tree (if your makefiles are set up correctly), " "printing what it would have executed if you had not included the flag. Giving a target this " "attribute tells PMake that the target is " "definitely not the Main Target. This allows you to place targets in an " "included makefile and have PMake create something " "else by default." msgstr "" #. (itstool) path: row/entry #: book.translate.xml:2342 msgid ".PRECIOUS" msgstr "" #. (itstool) path: row/entry #: book.translate.xml:2344 msgid "" "When PMake is interrupted (you type control-C at " "the keyboard), it will attempt to clean up after itself by removing any half-" "made targets. If a target has the .PRECIOUS attribute, " "however, PMake will leave it alone. An additional " "side effect of the :: operator is to mark the targets as " ".PRECIOUS." msgstr "" #. (itstool) path: row/entry #: book.translate.xml:2356 msgid ".SILENT" msgstr "" #. (itstool) path: row/entry #: book.translate.xml:2358 msgid "" "Marking a target with this attribute keeps its commands from being printed " "when they are executed, just as if they had an @ in front " "of them." msgstr "" #. (itstool) path: row/entry #: book.translate.xml:2365 msgid ".USE" msgstr "" #. (itstool) path: para/programlisting #: book.translate.xml:2388 #, no-wrap msgid "" "lib1.a : $(LIB1OBJS) MAKELIB\n" "lib2.a : $(LIB2OBJS) MAKELIB\n" "\n" "MAKELIB : .USE\n" " rm -f $(.TARGET)\n" " ar cr $(.TARGET) $(.ALLSRC)\n" " ...\n" " ranlib $(.TARGET)" msgstr "" #. (itstool) path: para/buildtarget #: book.translate.xml:2403 book.translate.xml:2406 msgid "MAKELIB" msgstr "" #. (itstool) path: entry/para #: book.translate.xml:2367 msgid "" "By giving a target this attribute, you turn it into PMake's " "equivalent of a macro. When the target is used as a source for another " "target, the other target acquires the commands, sources and attributes " "(except .USE) of the source. If the target already has " "commands, the .USE target's commands are added to the end." " If more than one .USE-marked source is given to a " "target, the rules are applied sequentially. The typical .USE rule (as I call them) will use the sources of the target to which " "it is applied (as stored in the .ALLSRC variable for the " "target) as its arguments, if you will. For example, you " "probably noticed that the commands for creating lib1.a " "and lib2.a in the example in section were exactly the same. You can use the .USE attribute to eliminate the repetition, like so: <_:programlisting-1/" "> Several system makefiles (not to be confused with The System Makefile) " "make use of these .USE rules to make your life easier " "(they are in the default, system makefile directory...take a look). Note " "that the .USE rule source itself (<_:buildtarget-2/>) " "does not appear in any of the targets's local variables. There is no limit " "to the number of times I could use the <_:buildtarget-3/> rule. If there " "were more libraries, I could continue with lib3.a : $(LIB3OBJS) " "MAKELIB and so on and so forth." msgstr "" #. (itstool) path: section/title #: book.translate.xml:2417 msgid "Special Targets" msgstr "" #. (itstool) path: section/para #: book.translate.xml:2419 msgid "" "As there were in Make, so there are certain " "targets that have special meaning to PMake. When " "you use one on a dependency line, it is the only target that may appear on " "the left-hand-side of the operator. As for the attributes and variables, all " "the special targets begin with a period and consist of upper-case letters " "only. I will not describe them all in detail because some of them are rather " "complex and I will describe them in more detail than you will want in . The targets are as follows:" msgstr "" #. (itstool) path: entry/buildtarget #: book.translate.xml:2437 book.translate.xml:2465 msgid ".BEGIN" msgstr "" #. (itstool) path: row/entry #: book.translate.xml:2439 msgid "" "Any commands attached to this target are executed before anything else is " "done. You can use it for any initialization that needs doing." msgstr "" #. (itstool) path: entry/buildtarget #: book.translate.xml:2446 book.translate.xml:2454 book.translate.xml:2456 msgid ".DEFAULT" msgstr "" #. (itstool) path: row/entry #: book.translate.xml:2448 msgid "" "This is sort of a .USE rule for any target (that was used " "only as a source) that PMake can not figure out " "any other way to create. It is only sort of a .USE rule because only the shell script attached to the <_:buildtarget-1/" "> target is used. The .IMPSRC variable of a target that " "inherits <_:buildtarget-2/>'s commands is set to the target's own name." msgstr "" #. (itstool) path: entry/buildtarget #. (itstool) path: para/buildtarget #: book.translate.xml:2462 book.translate.xml:3811 msgid ".END" msgstr "" #. (itstool) path: row/entry #: book.translate.xml:2464 msgid "" "This serves a function similar to <_:buildtarget-1/>, in that commands " "attached to it are executed once everything has been re-created (so long as " "no errors occurred). It also serves the extra function of being a place on " "which PMake can hang commands you put off to the " "end. Thus the script for this target will be executed before any of the " "commands you save with the ...." msgstr "" #. (itstool) path: entry/buildtarget #: book.translate.xml:2477 msgid ".EXPORT" msgstr "" #. (itstool) path: row/entry #: book.translate.xml:2479 msgid "" "The sources for this target are passed to the exportation system compiled " "into PMake. Some systems will use these sources " "to configure themselves. You should ask your system administrator about this." "" msgstr "" #. (itstool) path: entry/buildtarget #: book.translate.xml:2487 book.translate.xml:2615 msgid ".IGNORE" msgstr "" #. (itstool) path: row/entry #: book.translate.xml:2489 msgid "" "This target marks each of its sources with the .IGNORE " "attribute. If you do not give it any sources, then it is like giving the " " flag when you invoke PMake – " "errors are ignored for all commands." msgstr "" #. (itstool) path: entry/buildtarget #: book.translate.xml:2498 book.translate.xml:2542 msgid ".INCLUDES" msgstr "" #. (itstool) path: para/buildtarget #. (itstool) path: entry/buildtarget #: book.translate.xml:2506 book.translate.xml:2589 book.translate.xml:2605 #: book.translate.xml:2901 book.translate.xml:2912 book.translate.xml:2916 msgid ".PATH" msgstr "" #. (itstool) path: para/programlisting #: book.translate.xml:2514 #, no-wrap msgid "" ".SUFFIXES : .bitmap\n" ".PATH.bitmap : /usr/local/X/lib/bitmaps\n" ".INCLUDES : .bitmap" msgstr "" #. (itstool) path: para/programlisting #: book.translate.xml:2523 #, no-wrap msgid "cc $(.INCLUDES) -c xprogram.c" msgstr "" #. (itstool) path: entry/para #: book.translate.xml:2500 msgid "" "The sources for this target are taken to be suffixes that indicate a file " "that can be included in a program source file. The suffix must have already " "been declared with .SUFFIXES (see below). Any suffix so " "marked will have the directories on its search path (see <_:buildtarget-1/>, " "below) placed in the .INCLUDES variable, each preceded by " "a flag. This variable can then be used as an argument " "for the compiler in the normal fashion. The .h suffix " "is already marked in this way in the system makefile. E.g. if you have <_:" "programlisting-2/> PMake will place -I/" "usr/local/X/lib/bitmaps in the .INCLUDES " "variable and you can then say <_:programlisting-3/> (Note: the ." "INCLUDES variable is not actually filled in until the entire " "makefile has been read.)" msgstr "" #. (itstool) path: entry/buildtarget #: book.translate.xml:2531 msgid ".INTERRUPT" msgstr "" #. (itstool) path: row/entry #: book.translate.xml:2533 msgid "" "When PMake is interrupted, it will execute the " "commands in the script for this target, if it exists." msgstr "" #. (itstool) path: entry/buildtarget #. (itstool) path: para/buildtarget #: book.translate.xml:2539 book.translate.xml:3009 msgid ".LIBS" msgstr "" #. (itstool) path: row/entry #: book.translate.xml:2541 msgid "" "This does for libraries what <_:buildtarget-1/> does for include files, " "except the flag used is , as required by those linkers " "that allow you to tell them where to find libraries. The variable used is " ".LIBS. Be forewarned that PMake may not have been compiled to do this if the linker on your " "system does not accept the flag, though the ." "LIBS variable will always be defined once the makefile has been " "read." msgstr "" #. (itstool) path: entry/buildtarget #. (itstool) path: para/buildtarget #: book.translate.xml:2556 book.translate.xml:3178 book.translate.xml:3180 #: book.translate.xml:3774 msgid ".MAIN" msgstr "" #. (itstool) path: row/entry #: book.translate.xml:2558 msgid "" "If you did not give a target (or targets) to create when you invoked " "PMake, it will take the sources of this target as " "the targets to create." msgstr "" #. (itstool) path: entry/buildtarget #. (itstool) path: para/buildtarget #: book.translate.xml:2566 book.translate.xml:3656 msgid ".MAKEFLAGS" msgstr "" #. (itstool) path: row/entry #: book.translate.xml:2568 msgid "" "This target provides a way for you to always specify flags for " "PMake when the makefile is used. The flags are " "just as they would be typed to the shell (except you can not use shell " "variables unless they are in the environment), though the flags have no effect." msgstr "" #. (itstool) path: row/entry #: book.translate.xml:2580 msgid "" "This allows you to specify what suffix PMake " "should pretend a file has if, in fact, it has no known suffix. Only one " "suffix may be so designated. The last source on the dependency line is the " "suffix that is used (you should, however, only give one suffix...)." msgstr "" #. (itstool) path: row/entry #: book.translate.xml:2591 msgid "" "If you give sources for this target, PMake will " "take them as directories in which to search for files it cannot find in the " "current directory. If you give no sources, it will clear out any directories " "added to the search path before. Since the effects of this all get very " "complex, we will leave it till to give you a " "complete explanation." msgstr "" #. (itstool) path: entry/buildtarget #: book.translate.xml:2602 book.translate.xml:3203 msgid ".PATHsuffix" msgstr "" #. (itstool) path: row/entry #: book.translate.xml:2604 msgid "" "This does a similar thing to <_:buildtarget-1/>, but it does it only for " "files with the given suffix. The suffix must have been defined already. Look " "at Search Paths () for more information." msgstr "" #. (itstool) path: entry/buildtarget #: book.translate.xml:2613 msgid ".PRECIOUS" msgstr "" #. (itstool) path: row/entry #: book.translate.xml:2615 msgid "" "Similar to <_:buildtarget-1/>, this gives the .PRECIOUS " "attribute to each source on the dependency line, unless there are no " "sources, in which case the .PRECIOUS attribute is given " "to every target in the file." msgstr "" #. (itstool) path: entry/buildtarget #: book.translate.xml:2623 msgid ".RECURSIVE" msgstr "" #. (itstool) path: row/entry #: book.translate.xml:2625 msgid "" "This target applies the .MAKE attribute to all its " "sources. It does nothing if you do not give it any sources." msgstr "" #. (itstool) path: entry/buildtarget #. (itstool) path: para/buildtarget #: book.translate.xml:2631 book.translate.xml:3348 msgid ".SHELL" msgstr "" #. (itstool) path: row/entry #: book.translate.xml:2633 msgid "" "PMake is not constrained to only using the Bourne " "shell to execute the commands you put in the makefile. You can tell it some " "other shell to use with this target. Check out () " "for more information." msgstr "" #. (itstool) path: entry/buildtarget #: book.translate.xml:2642 book.translate.xml:2645 msgid ".SILENT" msgstr "" #. (itstool) path: row/entry #: book.translate.xml:2644 msgid "" "When you use <_:buildtarget-1/> as a target, it applies the ." "SILENT attribute to each of its sources. If there are no sources " "on the dependency line, then it is as if you gave PMake the flag and no commands will be echoed." msgstr "" #. (itstool) path: entry/buildtarget #: book.translate.xml:2655 book.translate.xml:2662 msgid ".SUFFIXES" msgstr "" #. (itstool) path: row/entry #: book.translate.xml:2657 msgid "" "This is used to give new file suffixes for PMake " "to handle. Each source is a suffix PMake should " "recognize. If you give a <_:buildtarget-1/> dependency line with no sources, " "PMake will forget about all the suffixes it knew " "(this also nukes the null suffix). For those targets that need to have " "suffixes defined, this is how you do it." msgstr "" #. (itstool) path: section/para #: book.translate.xml:2673 msgid "In addition to these targets, a line of the form:" msgstr "" #. (itstool) path: section/programlisting #: book.translate.xml:2675 #, no-wrap msgid "attribute : sources" msgstr "" #. (itstool) path: section/para #: book.translate.xml:2677 msgid "applies the attribute to all the targets listed as sources." msgstr "" #. (itstool) path: section/title #: book.translate.xml:2681 msgid "Modifying Variable Expansion" msgstr "" #. (itstool) path: section/para #: book.translate.xml:2683 msgid "" "Variables need not always be expanded verbatim. PMake defines several modifiers that may be applied to a variable's " "value before it is expanded. You apply a modifier by placing it after the " "variable name with a colon between the two, like so:" msgstr "" #. (itstool) path: section/programlisting #: book.translate.xml:2689 #, no-wrap msgid "${VARIABLE:modifier}" msgstr "" #. (itstool) path: section/para #: book.translate.xml:2691 msgid "" "Each modifier is a single character followed by something specific to the " "modifier itself. You may apply as many modifiers as you want – each one is " "applied to the result of the previous and is separated from the previous by " "another colon." msgstr "" #. (itstool) path: section/para #: book.translate.xml:2697 msgid "" "There are seven ways to modify a variable's expansion, most of which come " "from the C shell variable modification characters:" msgstr "" #. (itstool) path: varlistentry/term #: book.translate.xml:2703 msgid "Mpattern" msgstr "" #. (itstool) path: listitem/para #: book.translate.xml:2706 msgid "" "This is used to select only those words (a word is a series of characters " "that are neither spaces nor tabs) that match the given pattern. The pattern " "is a wildcard pattern like that used by the shell, where * means 0 or more characters of any sort; " "? is any single character; [abcd] " "matches any single character that is either a, " "b, c or d (there " "may be any number of characters between the brackets); [0-9] matches any single character that is between 0 " "and 9 (i.e. any digit. This form may be freely mixed with " "the other bracket form), and \\ is used to escape any of " "the characters *, ?, [ or :, leaving them as regular characters to " "match themselves in a word. For example, the system makefile " "<makedepend.mk> uses $(CFLAGS:M-[ID]*) to extract all the and " "flags that would be passed to the C compiler. This allows it to properly " "locate include files and generate the correct dependencies." msgstr "" #. (itstool) path: varlistentry/term #: book.translate.xml:2736 msgid "Npattern" msgstr "" #. (itstool) path: listitem/para #: book.translate.xml:2739 msgid "" "This is identical to :M except it substitutes all words " "that do not match the given pattern." msgstr "" #. (itstool) path: varlistentry/term #: book.translate.xml:2746 msgid "S/search-string/replacement-string/[g]" msgstr "" #. (itstool) path: listitem/para #: book.translate.xml:2749 msgid "" "Causes the first occurrence of search-string in the variable to be replaced " "by replacement-string, unless the flag is given at the " "end, in which case all occurrences of the string are replaced. The " "substitution is performed on each word in the variable in turn. If search-" "string begins with a ^, the string must match starting at " "the beginning of the word. If search-string ends with a $, the string must match to the end of the word (these two may be " "combined to force an exact match). If a backslash precedes these two " "characters, however, they lose their special meaning. Variable expansion " "also occurs in the normal fashion inside both the search-string and the " "replacement-string, except that a backslash is used to prevent the expansion " "of a $, not another dollar sign, as is usual. Note that " "search-string is just a string, not a pattern, so none of the usual " "regularexpression/wildcard characters have any special meaning save " "^ and $. In the replacement string, " "the & character is replaced by the search-string " "unless it is preceded by a backslash. You are allowed to use any character " "except colon or exclamation point to separate the two strings. This so-" "called delimiter character may be placed in either string by preceding it " "with a backslash." msgstr "" #. (itstool) path: varlistentry/term #: book.translate.xml:2780 msgid "T" msgstr "" #. (itstool) path: listitem/para #: book.translate.xml:2783 msgid "" "Replaces each word in the variable expansion by its last component (its " "tail). For example, given:" msgstr "" #. (itstool) path: listitem/programlisting #: book.translate.xml:2787 #, no-wrap msgid "OBJS = ../lib/a.o b /usr/lib/libm.a\n" "TAILS = $(OBJS:T)" msgstr "" #. (itstool) path: listitem/para #: book.translate.xml:2790 msgid "" "the variable TAILS would expand to a.o b libm.a." "" msgstr "" #. (itstool) path: varlistentry/term #: book.translate.xml:2796 msgid "H" msgstr "" #. (itstool) path: listitem/para #: book.translate.xml:2799 msgid "" "This is similar to :T, except that every word is replaced " "by everything but the tail (the head). Using the same " "definition of OBJS, the string $(OBJS:H) would expand to ../lib /usr/lib. Note that the " "final slash on the heads is removed and anything without a head is replaced " "by the empty string." msgstr "" #. (itstool) path: varlistentry/term #: book.translate.xml:2811 msgid "E" msgstr "" #. (itstool) path: listitem/para #: book.translate.xml:2814 msgid "" ":E replaces each word by its suffix (extension). So $(OBJS:E) would give you .o .a." msgstr "" #. (itstool) path: varlistentry/term #: book.translate.xml:2822 msgid "R" msgstr "" #. (itstool) path: listitem/para #: book.translate.xml:2825 msgid "" "This replaces each word by everything but the suffix (the root of the word). $(OBJS:R) expands to ../lib/" "a b /usr/lib/libm." msgstr "" #. (itstool) path: section/para #: book.translate.xml:2833 msgid "" "In addition, the System V style of substitution is also supported. This " "looks like:" msgstr "" #. (itstool) path: section/programlisting #: book.translate.xml:2836 #, no-wrap msgid "$(VARIABLE:search-string=replacement)" msgstr "" #. (itstool) path: section/para #: book.translate.xml:2838 msgid "" "It must be the last modifier in the chain. The search is anchored at the end " "of each word, so only suffixes or whole words may be replaced." msgstr "" #. (itstool) path: section/title #: book.translate.xml:2844 msgid "More Exercises" msgstr "" #. (itstool) path: section/bridgehead #. (itstool) path: chapter/bridgehead #: book.translate.xml:2846 book.translate.xml:3829 msgid "Exercise 3.1" msgstr "" #. (itstool) path: section/para #: book.translate.xml:2848 msgid "" "You have got a set programs, each of which is created from its own assembly-" "language source file (suffix .asm). Each program can be " "assembled into two versions, one with error-checking code assembled in and " "one without. You could assemble them into files with different suffixes " "(.eobj and .obj, for instance), " "but your linker only understands files that end in .obj." " To top it all off, the final executables must have the suffix ." "exe. How can you still use transformation rules to make your life " "easier (Hint: assume the errorchecking versions have ec tacked onto their " "prefix)?" msgstr "" #. (itstool) path: section/bridgehead #: book.translate.xml:2861 msgid "Exercise 3.2" msgstr "" #. (itstool) path: section/para #: book.translate.xml:2863 msgid "" "Assume, for a moment or two, you want to perform a sort of " "indirection by placing the name of a variable into another " "one, then you want to get the value of the first by expanding the second " "somehow. Unfortunately, PMake does not allow " "constructs like:" msgstr "" #. (itstool) path: section/programlisting #: book.translate.xml:2869 #, no-wrap msgid "$($(FOO))" msgstr "" #. (itstool) path: section/para #: book.translate.xml:2871 msgid "" "What do you do? Hint: no further variable expansion is performed after " "modifiers are applied, thus if you cause a $ to occur in " "the expansion, that is what will be in the result." msgstr "" #. (itstool) path: chapter/title #: book.translate.xml:2883 msgid "PMake for Gods" msgstr "" #. (itstool) path: chapter/para #: book.translate.xml:2885 msgid "" "This chapter is devoted to those facilities in PMake that allow you to do a great deal in a makefile with very " "little work, as well as do some things you could not do in " "Make without a great deal of work (and perhaps " "the use of other programs). The problem with these features, is they must be " "handled with care, or you will end up with a mess." msgstr "" #. (itstool) path: chapter/para #: book.translate.xml:2893 msgid "" "Once more, I assume a greater familiarity with UNIX or Sprite than I did in the previous two " "chapters." msgstr "" #. (itstool) path: section/title #: book.translate.xml:2897 msgid "Search Paths" msgstr "" #. (itstool) path: section/para #: book.translate.xml:2899 msgid "" "PMake supports the dispersal of files into " "multiple directories by allowing you to specify places to look for sources " "with <_:buildtarget-1/> targets in the makefile. The directories you give as " "sources for these targets make up a search path. Only those " "files used exclusively as sources are actually sought on a search path, the " "assumption being that anything listed as a target in the makefile can be " "created by the makefile and thus should be in the current directory." msgstr "" #. (itstool) path: section/para #: book.translate.xml:2909 msgid "" "There are two types of search paths in PMake: one " "is used for all types of files (including included makefiles) and is " "specified with a plain <_:buildtarget-1/> target (e.g. .PATH : RCS), while the other is specific to a certain type of file, as " "indicated by the file's suffix. A specific search path is indicated by " "immediately following the <_:buildtarget-2/> with the suffix of the file. " "For instance:" msgstr "" #. (itstool) path: section/programlisting #: book.translate.xml:2919 #, no-wrap msgid ".PATH.h : /sprite/lib/include /sprite/att/lib/include" msgstr "" #. (itstool) path: section/para #: book.translate.xml:2921 msgid "" "would tell PMake to look in the directories " "/sprite/lib/include and /sprite/att/lib/" "include for any files whose suffix is .h." msgstr "" #. (itstool) path: section/para #: book.translate.xml:2926 msgid "" "The current directory is always consulted first to see if a file exists. " "Only if it cannot be found there are the directories in the specific search " "path, followed by those in the general search path, consulted." msgstr "" #. (itstool) path: section/para #: book.translate.xml:2931 msgid "" "A search path is also used when expanding wildcard characters. If the " "pattern has a recognizable suffix on it, the path for that suffix will be " "used for the expansion. Otherwise the default search path is employed." msgstr "" #. (itstool) path: section/para #: book.translate.xml:2936 msgid "" "When a file is found in some directory other than the current one, all local " "variables that would have contained the target's name (.ALLSRC, and .IMPSRC) will instead contain the path to " "the file, as found by PMake. Thus if you have a " "file ../lib/mumble.c and a makefile like this:" msgstr "" #. (itstool) path: section/programlisting #: book.translate.xml:2945 #, no-wrap msgid "" ".PATH.c : ../lib\n" "mumble : mumble.c\n" " $(CC) -o $(.TARGET) $(.ALLSRC)" msgstr "" #. (itstool) path: section/para #: book.translate.xml:2949 msgid "" "the command executed to create mumble would be cc -o mumble ../lib/" "mumble.c. (as an aside, the command in this case is not strictly " "necessary, since it will be found using transformation rules if it is not " "given. This is because .out is the null suffix by " "default and a transformation exists from .c to " ".out. Just thought I would throw that in). If a file " "exists in two directories on the same search path, the file in the first " "directory on the path will be the one PMake uses. " "So if you have a large system spread over many directories, it would behoove " "you to follow a naming convention that avoids such conflicts." msgstr "" #. (itstool) path: section/para #: book.translate.xml:2964 msgid "" "Something you should know about the way search paths are implemented is that " "each directory is read, and its contents cached, exactly once – when it is " "first encountered – so any changes to the directories while " "PMake is running will not be noted when searching " "for implicit sources, nor will they be found when PMake attempts to discover when the file was last modified, unless " "the file was created in the current directory. While people have suggested " "that PMake should read the directories each time, " "my experience suggests that the caching seldom causes problems. In addition, " "not caching the directories slows things down enormously because of " "PMake's attempts to apply transformation rules " "through non-existent files – the number of extra file-system searches is " "truly staggering, especially if many files without suffixes are used and the " "null suffix is not changed from .out." msgstr "" #. (itstool) path: section/title #: book.translate.xml:2984 msgid "Archives and Libraries" msgstr "" #. (itstool) path: section/para #: book.translate.xml:2986 msgid "" "UNIX and Sprite allow you to " "merge files into an archive using the ar command. " "Further, if the files are relocatable object files, you can run " "ranlib on the archive and get yourself a library " "that you can link into any program you want. The main problem with archives " "is they double the space you need to store the archived files, since there " "is one copy in the archive and one copy out by itself. The problem with " "libraries is you usually think of them as rather than " "/usr/lib/libm.a and the linker thinks they are out-of-" "date if you so much as look at them." msgstr "" #. (itstool) path: section/para #: book.translate.xml:2998 msgid "" "PMake solves the problem with archives by " "allowing you to tell it to examine the files in the archives (so you can " "remove the individual files without having to regenerate them later). To " "handle the problem with libraries, PMake adds an " "additional way of deciding if a library is out-of-date: if the table of " "contents is older than the library, or is missing, the library is out-of-" "date." msgstr "" #. (itstool) path: section/para #: book.translate.xml:3007 msgid "" "A library is any target that looks like or that ends " "in a suffix that was marked as a library using the <_:buildtarget-1/> target." " .a is so marked in the system makefile. Members of an " "archive are specified as archive(member[member...]). Thus " "libdix.a(window.o) specifies the file window.o in the archive libdix.a. You may also use " "wildcards to specify the members of the archive. Just remember that most the " "wildcard characters will only find existing files. A file that is a member " "of an archive is treated specially. If the file does not exist, but it is in " "the archive, the modification time recorded in the archive is used for the " "file when determining if the file is out-of-date. When figuring out how to " "make an archived member target (not the file itself, but the file in the " "archive – the archive(member) target), special care is taken with the " "transformation rules, as follows:" msgstr "" #. (itstool) path: listitem/para #: book.translate.xml:3028 msgid "archive(member) is made to depend on member." msgstr "" #. (itstool) path: listitem/para #: book.translate.xml:3032 msgid "" "The transformation from the member's suffix to the archive's suffix is " "applied to the archive(member) target." msgstr "" #. (itstool) path: listitem/para #: book.translate.xml:3037 msgid "" "The archive(member)'s .TARGET variable is set to the name " "of the member if member is actually a target, or the path to the member file " "if member is only a source." msgstr "" #. (itstool) path: listitem/para #: book.translate.xml:3044 msgid "" "The .ARCHIVE variable for the archive(member) target is " "set to the name of the archive." msgstr "" #. (itstool) path: listitem/para #: book.translate.xml:3050 msgid "" "The .MEMBER variable is set to the actual string inside " "the parentheses. In most cases, this will be the same as the ." "TARGET variable." msgstr "" #. (itstool) path: listitem/para #: book.translate.xml:3057 msgid "" "The archive(member)'s place in the local variables of the targets that " "depend on it is taken by the value of its .TARGET " "variable." msgstr "" #. (itstool) path: section/para #: book.translate.xml:3063 msgid "Thus, a program library could be created with the following makefile:" msgstr "" #. (itstool) path: section/programlisting #: book.translate.xml:3066 #, no-wrap msgid "" ".o.a :\n" " ...\n" " rm -f $(.TARGET:T)\n" "OBJS = obj1.o obj2.o obj3.o\n" "libprog.a : libprog.a($(OBJS))\n" " ar cru $(.TARGET) $(.OODATE)\n" " ranlib $(.TARGET)" msgstr "" #. (itstool) path: section/para #: book.translate.xml:3074 msgid "" "This will cause the three object files to be compiled (if the corresponding " "source files were modified after the object file or, if that does not exist, " "the archived object file), the out-of-date ones archived in " "libprog.a, a table of contents placed in the archive " "and the newly-archived object files to be removed." msgstr "" #. (itstool) path: section/para #: book.translate.xml:3081 msgid "" "All this is used in the makelib.mk system makefile to " "create a single library with ease. This makefile looks like this:" msgstr "" #. (itstool) path: section/programlisting #: book.translate.xml:3085 #, no-wrap msgid "" "#\n" "# Rules for making libraries. The object files that make up the library\n" "# are removed once they are archived.\n" "#\n" "# To make several libraries in parallel, you should define the variable\n" "# \"many_libraries\". This will serialize the invocations of ranlib.\n" "#\n" "# To use, do something like this:\n" "#\n" "# OBJECTS = <files in the library>\n" "#\n" "# fish.a: fish.a($(OBJECTS)) MAKELIB\n" "#\n" "#\n" "\n" "#ifndef _MAKELIB_MK\n" "_MAKELIB_MK =\n" "\n" "#include <po.mk>\n" "\n" ".po.a .o.a :\n" " ...\n" " rm -f $(.MEMBER)\n" "\n" "ARFLAGS ?= crl\n" "\n" "#\n" "# Re-archive the out-of-date members and recreate the library's table of\n" "# contents using ranlib. If many_libraries is defined, put the ranlib\n" "# off til the end so many libraries can be made at once.\n" "#\n" "MAKELIB : .USE .PRECIOUS\n" " ar $(ARFLAGS) $(.TARGET) $(.OODATE)\n" "#ifndef no_ranlib\n" "# ifdef many_libraries\n" " ...\n" "# endif many_libraries\n" " ranlib $(.TARGET)\n" "#endif no_ranlib\n" "\n" "#endif _MAKELIB_MK" msgstr "" #. (itstool) path: section/title #: book.translate.xml:3129 msgid "On the Condition..." msgstr "" #. (itstool) path: section/para #: book.translate.xml:3131 msgid "" "Like the C compiler before it, PMake allows you " "to configure the makefile, based on the current environment, using " "conditional statements. A conditional looks like this:" msgstr "" #. (itstool) path: section/programlisting #: book.translate.xml:3136 #, no-wrap msgid "" "#if boolean expression\n" "lines\n" "#elif another boolean expression\n" "more lines\n" "#else\n" "still more lines\n" "#endif" msgstr "" #. (itstool) path: section/para #: book.translate.xml:3144 msgid "" "They may be nested to a maximum depth of 30 and may occur anywhere (except " "in a comment, of course). The # must the very first " "character on the line." msgstr "" #. (itstool) path: section/para #: book.translate.xml:3149 msgid "" "Each boolean expression is made up of terms that look like function calls, " "the standard C boolean operators &&, ||, and !, and the standard relational operators " "==, !=, >, " ">=, <, and <=, with == and != being " "overloaded to allow string comparisons as well. && represents logical AND; || is logical OR and " "! is logical NOT. The arithmetic and string operators " "take precedence over all three of these operators, while NOT takes " "precedence over AND, which takes precedence over OR. This precedence may be " "overridden with parentheses, and an expression may be parenthesized to your " "heart's content. Each term looks like a call on one of four functions:" msgstr "" #. (itstool) path: row/entry #: book.translate.xml:3173 book.translate.xml:3282 msgid "make" msgstr "" #. (itstool) path: row/entry #: book.translate.xml:3175 msgid "" "The syntax is make(target) where target is a target in the makefile. This is " "true if the given target was specified on the command line, or as the source " "for a <_:buildtarget-1/> target (note that the sources for <_:buildtarget-2/" "> are only used if no targets were given on the command line)." msgstr "" #. (itstool) path: row/entry #: book.translate.xml:3186 book.translate.xml:3270 msgid "defined" msgstr "" #. (itstool) path: row/entry #: book.translate.xml:3188 msgid "" "The syntax is defined(variable) and is true if variable " "is defined. Certain variables are defined in the system makefile that " "identify the system on which PMake is being run." msgstr "" #. (itstool) path: row/entry #: book.translate.xml:3197 msgid "exists" msgstr "" #. (itstool) path: row/entry #: book.translate.xml:3199 msgid "" "The syntax is exists(file) and is true if the file can be " "found on the global search path (i.e. that defined by .PATH targets, not by <_:buildtarget-1/> targets)." msgstr "" #. (itstool) path: row/entry #: book.translate.xml:3208 msgid "empty" msgstr "" #. (itstool) path: row/entry #: book.translate.xml:3210 msgid "" "This syntax is much like the others, except the string inside the " "parentheses is of the same form as you would put between parentheses when " "expanding a variable, complete with modifiers and everything. The function " "returns true if the resulting string is empty. An undefined variable in this " "context will cause at the very least a warning message about a malformed " "conditional, and at the worst will cause the process to stop once it has " "read the makefile. If you want to check for a variable being defined or " "empty, use the expression: !defined(var) || empty(var) as " "the definition of || will prevent the empty() from being evaluated and causing an error, if the variable is " "undefined. This can be used to see if a variable contains a given word, for " "example: #if !empty(var:Mword)" msgstr "" #. (itstool) path: section/para #: book.translate.xml:3234 msgid "" "The arithmetic and string operators may only be used to test the value of a " "variable. The lefthand side must contain the variable expansion, while the " "righthand side contains either a string, enclosed in double-quotes, or a " "number. The standard C numeric conventions (except for specifying an octal " "number) apply to both sides. E.g.:" msgstr "" #. (itstool) path: section/programlisting #: book.translate.xml:3241 #, no-wrap msgid "" "#if $(OS) == 4.3\n" "\n" "#if $(MACHINE) == \"sun3\"\n" "\n" "#if $(LOAD_ADDR) > 0xc000" msgstr "" #. (itstool) path: section/para #: book.translate.xml:3247 msgid "" "are all valid conditionals. In addition, the numeric value of a variable can " "be tested as a boolean as follows:" msgstr "" #. (itstool) path: section/programlisting #: book.translate.xml:3250 #, no-wrap msgid "#if $(LOAD)" msgstr "" #. (itstool) path: section/para #: book.translate.xml:3252 msgid "would see if LOAD contains a non-zero value and:" msgstr "" #. (itstool) path: section/programlisting #: book.translate.xml:3255 #, no-wrap msgid "#if !$(LOAD)" msgstr "" #. (itstool) path: section/para #: book.translate.xml:3257 msgid "would test if LOAD contains a zero value." msgstr "" #. (itstool) path: section/para #: book.translate.xml:3260 msgid "" "In addition to the bare #if, there are other forms that " "apply one of the first two functions to each term. They are as follows:" msgstr "" #. (itstool) path: row/entry #: book.translate.xml:3268 msgid "ifdef" msgstr "" #. (itstool) path: row/entry #: book.translate.xml:3274 msgid "ifndef" msgstr "" #. (itstool) path: row/entry #: book.translate.xml:3276 msgid "!defined" msgstr "" #. (itstool) path: row/entry #: book.translate.xml:3280 msgid "ifmake" msgstr "" #. (itstool) path: row/entry #: book.translate.xml:3286 msgid "ifnmake" msgstr "" #. (itstool) path: row/entry #: book.translate.xml:3288 msgid "!make" msgstr "" #. (itstool) path: section/para #: book.translate.xml:3294 msgid "" "There are also the else if forms: " "elif, elifdef, elifndef, elifmake, and elifnmake." msgstr "" #. (itstool) path: section/para #: book.translate.xml:3299 msgid "" "For instance, if you wish to create two versions of a program, one of which " "is optimized (the production version) and the other of which is for " "debugging (has symbols for dbx), you have two choices: you can create two " "makefiles, one of which uses the flag for the " "compilation, while the other uses the flag, or you can " "use another target (call it debug) to create the debug version. The " "construct below will take care of this for you. I have also made it so " "defining the variable DEBUG (say with pmake -D " "DEBUG) will also cause the debug version to be made." msgstr "" #. (itstool) path: section/programlisting #: book.translate.xml:3311 #, no-wrap msgid "" "#if defined(DEBUG) || make(debug)\n" "CFLAGS += -g\n" "#else\n" "CFLAGS += -O\n" "#endif" msgstr "" #. (itstool) path: section/para #: book.translate.xml:3317 msgid "" "There are, of course, problems with this approach. The most glaring " "annoyance is that if you want to go from making a debug version to making a " "production version, you have to remove all the object files, or you will get " "some optimized and some debug versions in the same program. Another " "annoyance is you have to be careful not to make two targets that " "conflict because of some conditionals in the makefile. For " "instance:" msgstr "" #. (itstool) path: section/programlisting #: book.translate.xml:3326 #, no-wrap msgid "" "#if make(print)\n" "FORMATTER = ditroff -Plaser_printer\n" "#endif\n" "#if make(draft)\n" "FORMATTER = nroff -Pdot_matrix_printer\n" "#endif" msgstr "" #. (itstool) path: section/para #: book.translate.xml:3333 msgid "" "would wreak havoc if you tried pmake draft print since " "you would use the same formatter for each target. As I said, this all gets " "somewhat complicated." msgstr "" #. (itstool) path: section/title #. (itstool) id: book.translate.xml#ashelltitle #: book.translate.xml:3339 msgid "A Shell is a Shell is a Shell" msgstr "" #. (itstool) path: section/para #: book.translate.xml:3341 msgid "" "In normal operation, the Bourne Shell (better known as sh) is used to execute the commands to re-create targets. " "PMake also allows you to specify a different " "shell for it to use when executing these commands. There are several things " "PMake must know about the shell you wish to use. " "These things are specified as the sources for the <_:buildtarget-1/> target " "by keyword, as follows:" msgstr "" #. (itstool) path: varlistentry/term #: book.translate.xml:3353 msgid "path=path" msgstr "" #. (itstool) path: listitem/para #: book.translate.xml:3356 msgid "" "PMake needs to know where the shell actually " "resides, so it can execute it. If you specify this and nothing else, " "PMake will use the last component of the path and " "look in its table of the shells it knows and use the specification it finds, " "if any. Use this if you just want to use a different version of the " "Bourne or C Shell " "(yes, PMake knows how to use the C " "Shell too)." msgstr "" #. (itstool) path: varlistentry/term #: book.translate.xml:3371 msgid "name=name" msgstr "" #. (itstool) path: listitem/para #: book.translate.xml:3374 msgid "" "This is the name by which the shell is to be known. It is a single word and, " "if no other keywords are specified (other than path), it is the name by " "which PMake attempts to find a specification for " "it (as mentioned above). You can use this if you would just rather use the C " "Shell than the Bourne Shell (.SHELL: " "name=csh will do it)." msgstr "" #. (itstool) path: varlistentry/term #: book.translate.xml:3386 msgid "quiet=echo-off command" msgstr "" #. (itstool) path: listitem/para #: book.translate.xml:3389 msgid "" "As mentioned before, PMake actually controls " "whether commands are printed by introducing commands into the shell's input " "stream. This keyword, and the next two, control what those commands are. The " "quiet keyword is the command used to turn echoing off. " "Once it is turned off, echoing is expected to remain off until the " "echo-on command is given." msgstr "" #. (itstool) path: varlistentry/term #: book.translate.xml:3401 msgid "echo=echo-on command" msgstr "" #. (itstool) path: listitem/para #: book.translate.xml:3404 msgid "" "The command PMake should give to turn echoing " "back on again." msgstr "" #. (itstool) path: varlistentry/term #: book.translate.xml:3410 msgid "filter=printed echo-off command" msgstr "" #. (itstool) path: listitem/para #: book.translate.xml:3413 msgid "" "Many shells will echo the echo-off command when it is " "given. This keyword tells PMake in what format " "the shell actually prints the echo-off command. Wherever " "PMake sees this string in the shell's output, it " "will delete it and any following whitespace, up to and including the next " "newline. See the example at the end of this section for more details." msgstr "" #. (itstool) path: varlistentry/term #: book.translate.xml:3426 msgid "echoFlag=flag to turn echoing on" msgstr "" #. (itstool) path: listitem/para #: book.translate.xml:3429 msgid "" "Unless a target has been marked .SILENT, " "PMake wants to start the shell running with " "echoing on. To do this, it passes this flag to the shell as one of its " "arguments. If either this or the next flag begins with a -, the flags will be passed to the shell as separate arguments. " "Otherwise, the two will be concatenated (if they are used at the same time, " "of course)." msgstr "" #. (itstool) path: varlistentry/term #: book.translate.xml:3442 msgid "errFlag=flag to turn error checking on" msgstr "" #. (itstool) path: listitem/para #: book.translate.xml:3445 msgid "" "Likewise, unless a target is marked .IGNORE, " "PMake wishes error-checking to be on from the " "very start. To this end, it will pass this flag to the shell as an argument. " "The same rules for an initial - apply as for the " "echoFlag." msgstr "" #. (itstool) path: varlistentry/term #: book.translate.xml:3456 msgid "check=command to turn error checking on" msgstr "" #. (itstool) path: listitem/para #: book.translate.xml:3459 msgid "" "Just as for echo-control, error-control is achieved by inserting commands " "into the shell's input stream. This is the command to make the shell check " "for errors. It also serves another purpose if the shell does not have error-" "control as commands, but I will get into that in a minute. Again, once error " "checking has been turned on, it is expected to remain on until it is turned " "off again." msgstr "" #. (itstool) path: varlistentry/term #: book.translate.xml:3471 msgid "ignore=commandto turn error checking off" msgstr "" #. (itstool) path: listitem/para #: book.translate.xml:3474 msgid "" "This is the command PMake uses to turn error " "checking off. It has another use if the shell does not do errorcontrol, but " "I will tell you about that...now." msgstr "" #. (itstool) path: varlistentry/term #: book.translate.xml:3482 msgid "hasErrCtl=yes or no" msgstr "" #. (itstool) path: listitem/para #: book.translate.xml:3485 msgid "" "This takes a value that is either yes or no. Now you might think that the existence of the check and ignore " "keywords would be enough to tell PMake if the " "shell can do error-control, but you would be wrong. If hasErrCtl is yes, PMake uses " "the check and ignore commands in a straight-forward manner. If this is no, " "however, their use is rather different. In this case, the check command is " "used as a template, in which the string %s is replaced by " "the command that is about to be executed, to produce a command for the shell " "that will echo the command to be executed. The ignore command is also used " "as a template, again with %s replaced by the command to " "be executed, to produce a command that will execute the command to be " "executed and ignore any error it returns. When these strings are used as " "templates, you must provide newline(s) (\\n) in the " "appropriate place(s)." msgstr "" #. (itstool) path: section/para #: book.translate.xml:3510 msgid "" "The strings that follow these keywords may be enclosed in single or double " "quotes (the quotes will be stripped off) and may contain the usual C " "backslash-characters (\\n is newline, \\r is return, \\b is backspace, \\' escapes a single-quote inside single-quotes, \\\" escapes a double-quote inside double-quotes). Now for an example." msgstr "" #. (itstool) path: section/para #: book.translate.xml:3519 msgid "" "This is actually the contents of the <shx.mk> system makefile, and " "causes PMake to use the Bourne " "Shell in such a way that each command is printed as it is " "executed. That is, if more than one command is given on a line, each will be " "printed separately. Similarly, each time the body of a loop is executed, the " "commands within that loop will be printed, etc. The specification runs like " "this:" msgstr "" #. (itstool) path: section/programlisting #: book.translate.xml:3528 #, no-wrap msgid "" "#\n" "# This is a shell specification to have the Bourne shell echo\n" "# the commands just before executing them, rather than when it reads\n" "# them. Useful if you want to see how variables are being expanded, etc.\n" "#\n" ".SHELL : path=/bin/sh \\\n" " quiet=\"set -\" \\\n" " echo=\"set -x\" \\\n" " filter=\"+ set - \" \\\n" " echoFlag=x \\\n" " errFlag=e \\\n" " hasErrCtl=yes \\\n" " check=\"set -e\" \\\n" " ignore=\"set +e\"" msgstr "" #. (itstool) path: section/para #: book.translate.xml:3543 msgid "It tells PMake the following:" msgstr "" #. (itstool) path: listitem/para #: book.translate.xml:3547 msgid "" "The shell is located in the file /bin/sh. It need not " "tell PMake that the name of the shell is sh as " "PMake can figure that out for itself (it is the " "last component of the path)." msgstr "" #. (itstool) path: listitem/para #: book.translate.xml:3556 msgid "The command to stop echoing is set -." msgstr "" #. (itstool) path: listitem/para #: book.translate.xml:3560 msgid "The command to start echoing is set ." msgstr "" #. (itstool) path: listitem/para #: book.translate.xml:3564 msgid "" "When the echo off command is executed, the shell will print + set - (The + comes from using " "the flag (rather than the flag " "PMake usually uses)). PMake will remove all occurrences of this string from the output, so " "you do not notice extra commands you did not put there." msgstr "" #. (itstool) path: listitem/para #: book.translate.xml:3576 msgid "" "The flag the Bourne Shell will take to start " "echoing in this way is the flag. The Bourne " "Shell will only take its flag arguments concatenated as its " "first argument, so neither this nor the errFlag specification begins with a " "-." msgstr "" #. (itstool) path: listitem/para #: book.translate.xml:3586 msgid "" "The flag to use to turn error-checking on from the start is