?? ant.rea
字號:
NAME am Anthony's Make SYNOPSIS am <makefile> [target]DESCRIPTIONAM is a programmer's tool to maintain, update, and regenerate groupsof files and/or programs. It is similar to MAKE as described by thePOSIX.2 draft standard 11.2, and this document parallels the draftin order to point out the subtle differences between AM and MAKE.The AM utility can be used as part of software development to updatefiles that are derived from other files. A typical case is one whereobject files are derived from the corresponding source files. The AMutility examines time relationships and updates those derived files(targets) that have modified times earlier than the modified times ofthe files (prerequisites) from which they are derived. A description file ("makefile") contains a description of the relationships between files, and the commands that must be executed to update the targets toreflect changes in their prerequisites. Each specification, or rule, shall consist of a target, optional prerequisites, and optional commands to be executed when a prerequisite is newer than the target.OPTIONSNone.OPERANDSmakefile This required argument, is a pathname of a description file, which is also referred to as the "makfile". A pathname of "-", shall *NOT* denote the standard input.target This optional argument, is the first target to be processed. If no target is specified, when AM is processing the makefile, the first target that AM encounters shall be used.EXTERNAL INFLUENCESSTANDARD INPUTNot used.INPUT FILESThe input file, otherwise known as the makefile, is a text filecontaining rules, macro definitions, and comments.ASYNCHRONOUS EVENTSAll traps are left to their default actions. If AM receives a SIGHUP,SIGTERM, SIGINT, or SIGQUIT then AM will terminate as per request*WITHOUT* removing the current target.EXTERNAL EFFECTSSTANDARD OUTPUTThe AM utility shall write all commands to be executed to standardoutput unless the command is prefixed with an at-sign (@). If AM isinvoked without any work needing to be done, it shall *NOT* write amessage to standard output indicating that no action was taken. STANDARD ERRORStandard error is used for diagnostic messages only.OUTPUT FILESNone. However, the utilities invoked by AM may create additional files.EXTENDED DESCRIPTIONThe AM utility attempts to perform the actions required to ensurethat the specified target(s) are up-to-date. A target is consideredout-of-date if it is older than any of its prerequisites or it doesnot exist. The AM utility shall treat all prerequisites as targetsthemselves and recursively ensure that they are up-to-date, processingthem in the order which they appear in the rule. The AM utility shalluse the modification times of files to determine if the correspondingtargets are out-of-date.After AM has ensured that all of the prerequisites of a target areup-to-date, and if the target is out-of-date, the commands associatedwith the target entry shall be executed. If there are no commandslisted for the target, the target shall be treated as up-to-date.MAKEFILE SYNTAXA makefile can contain rules, macro definitions, and comments. If amacro is defined more than once, the value of the macro shall be thelast one specified. Comments start with a number-sign (#) andcontinue until an unescaped <newline> is reached.A backslash before a <newline> serves as a line continuation mark, and is used to create long-lines. A line will continue to be extended until an unescaped <newline> is reached.When an escaped <newline> (one preceded by a backslash) is found anywherein the makefile, it shall be replaced, along with any leading white space on the following line, with a single <space>. MAKEFILE EXECUTIONCommand lines shall be processed one at a time by writing the commandline to standard output, unless prefixed with an at-sign (@), andexecuting the command(s) in the line. Commands shall be executed bypassing the command line to the command interpreter via the system()function.The environment for the command being executed shall contain all of thevariables in the environment of AM. All macros are considered to be part of the environment too.By default, when AM receives a non-zero status from the execution of acommand, it terminates with an error message to standard error. Ifthe command is prefixed by a hyphen (-) then any error found whileexecuting the command shall be ignored.Command lines can have one or more of the following prefixes: a hyphen(-) to ignore errors, an at-sign (@) to be silent, or a plus-sign (+)if the command is always executed (this prefix is for compatibility withMAKE and is ignored).TARGET RULESTarget rules are formatted as follows: target [target ...] : [prerequisite ...] [<tab>command <tab>command ...] (line that does not begin with <tab>)Target entries are specified by a <blank>-separated, non-null list oftargets, then a colon, then a <blank>-separated, possibly empty listof prerequisite. All following lines, if any, that begin with a <tab>,are command lines to be executed to update the target(s). The firstline that does not begin with a <tab> shall begin a new entry.Target names can be any character supported by the host system,excluding <blank>s, <tab>s, <newline>s, and colons (:), which are used for delimiters.For any given target there can be only one target rule. The firstoccurrence of a target in a makefile shall be used. All subsequentrules for the same target are ignored. There is *no* support for adding prerequisites to a target's prerequisite list once a targetrule is defined.There are no special targets or inference rule support. MACROSMacro definitions are in the form: string1 = [string2]The macro named string1 is defined as having the value of string2,where string2 is defined as all characters, if any, after the equalsign up to an unescaped <newline>. Any <blank>s immediately before orafter the equal sign shall be ignored.Subsequent appearances of $(string1) shall be replaced by string2.The parentheses are *NOT* optional if string1 is a single character.The macro $$ shall be replaced by the single character $. Macro names can be any character that the host system would allow in the definition of environment variables, excluding parentheses, ( and ), which are used for delimiters.Macros can appear anywhere in the makefile, except within other macro references (ie. no nesting). Macros in target and command lines shall be evaluated when the line is read. Macros in macro definition lines shall be evaluated *IMMEDIATELY*. A macro that has not been defined shall evaluate to a null string without causing any error condition. If a macro is defined more than once, the value of the macro shall be the last one specified prior to it being referenced.Macro assignments shall be accepted from the sources listed below, in the order shown. If a macro name already exists at the time it is beingprocessed, the newer definition shall replace the existing definition. 1) The contents of the environment, including the variables with null values in the order defined in the environment. 2) Macros defined in the makefile, processed in the order specified.There are no internal macros supported. The SHELL macro shall *NOT* betreated specially.EXIT STATUS 0 Successful completion. 1 General error. 2 Usage error. 3 Failed to open makefile. 4 Failed to allocate memory.INSTALLATIONAM can be built on any system providing at least K&R C. It has been tested on o SunOS with GCC o ATARI Mega ST with Sozobon C o PC clone with Turbo C o Interactive UNIX System V/386 release 3.2For all machines, the compile command line should be cc -O -o am am.cThe value RULES represents the number of slots available to recordtarget rules, dependencies, and commands. The default value chosenshould handle most project makefiles. RULES can be overridden on thecommand line with -DRULES=nn, where 0 < nn < INT_MAX.On a DOS machine using Turbo C, it may be necessary to add the includedirective #include <time.h>with the rest of the includes if sys/stat.h does not properly define oruse time_t. Also, on some older K&R C compilers, stdlib.h may not be defined and so it might be necessary to remove the include directive for it. REFERENCES[Mil87] Webb Miller, "A Software Tools Sampler", Prentice Hall, 87 ISBN 0-13-822305-X, chaper 2[POSIX] POSIX.2 draft 11.2 MAKEFILESant.c Obfuscated sourceant.README Manual for AMant.test.mk Test makefileBUGSUnknown as of 20 March 92.
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -