📄 make.1
字号:
.\" SCCSID: @(#)make.1 8.1 9/11/90.TH make 1.SH Namemake, s5make \- maintain, update, and regenerate groups of programs.SH Syntax.B make[.B \-f.I makefile][.I options][.I names] .PP.B s5make[.B \-f.I makefile][.I options][.I names] .SH Description.NXR "make keyword".NXR "make command".NXR "program" "updating".NXR "file" "updating".PPThis is the SYSTEM V version of the.PN makecommand with some Berkeley compatibility added..SH Options.NXR "make command (System V)" "options".IP \-b 15Compatibility mode for old makefiles..IP \-dDebug mode.Displays detailed information on filesand times examined..IP \-eCauses environment variables to override assignments within makefiles..IP "\-f \fImakefile\fR"Uses the specified description file name. A file name of.B \-denotes the standard input.The contents of the file specified as.I makefileoverride the built-in rules..IP \-iIgnores error codes returned by invoked commands.Thismode is entered if the special target name .IGNOREappears in the description file..IP \-kStops work on the currententry, but continues on other branchesthat do not depend on that entry..IP \-mDisplays a memory map showing text, data, and the stack.Does not operate on systems without the .PN getu system call..IP \-nNo execute mode.Displays commands, but does not executethem.Even lines beginning with an at sign (@) are printed..IP \-pDisplays the complete set of macro definitions and target descriptions..IP \-qQuestion mode.Returns a zero or nonzerostatus code depending on whether the target file is oris not up to date..IP \-rDoes not use the built-in rules..IP \-sSilent mode.Suppresses the display of command lines before executing.This mode is also entered if the special target name .SILENTappears in the description file..IP \-SAbandon work on the current entry if it fails; the opposite of the.B \-koption. If both options are specified, the last one specifiedon the command line is used..IP \-tTouches target files (causing them to be up to date)rather than issuing usual commands..SH Special Names.TP 15\& .DEFAULTIf a file must be made but there are no explicit commandsor relevant built-in rules, the commands associatedwith the name .DEFAULTare used if it exists..TP\&.PRECIOUSDependents of this target are not removed whenquit or interrupt is hit..TP\&.SILENTSame effect as the .B \-s option..TP\&.IGNORESame effect as the .B \-i option..TP\&.SUFFIXESDependencies of the .SUFFIXES special target are added to the table ofknown suffixes..SH DiscussionThe.PN makeprogram executes commands in.I makefileto updateone or more target.I names .The.I nameargument is typically a program.If no.B \-foption is present, \fBmakefile\fP, \fBMakefile\fP, \fBs.makefile\fP,and \fBs.Makefile\fP aretried in order.If.I makefileis \fB\-\fR, the standard input is taken.You can specify more than one.B \-f.I makefileargument..PPThe.PN makeprogram updates a target only if its dependents arenewer than the target.All prerequisite files of a target are added recursively tothe list of targets.Missing files are deemed to be out of date..PPThe.I makefileargument contains a sequence of entries that specify dependencies.The first line of an entry is ablank-separated, non-null list of targets, then acolon (:),then a (possibly null) list of prerequisite files or dependencies.Text following asemicolon (;)and all following linesthat begin with a tab are shell commandsto be executed to update the target.The first line that does not begin with a tab or number sign (#) beginsa new dependency or macro definition.Shell commands canbe continued across lines with the backslash followed by a new-line (\RET) sequence.Everything printed by .PN make (except the initial tab) is passeddirectly to the shell.For example:.EXecho a\\b.EEThese entries produce the following:.EXab.EEThis output is exactly the same as what would have been producedby the shell..PPNumber sign (#)and new-line surround comments..PPThe following.I makefilesays that.B pgmdepends on twofiles.PN a.oand.PN b.o ,and that they in turn depend ontheir corresponding source files.PN (a.cand.PN b.c)and a common file.PN incl.h:.EXpgm: a.o b.o cc a.o b.o \-o pgma.o: incl.h a.c cc \-c a.cb.o: incl.h b.c cc \-c b.c.EE.PPCommand lines are executed one at a time, each by itsown shell.The first one or two characters in a command can bethe following: \-, @, \-@, or @\-.If @ is present, printing of the command is suppressed.If \- is present, .PN makeignores an error.A line is printed when it is executed unless the.B \-soption is present, or the entry\&.SILENT:is in.IR makefile ,or unless the initial character sequence contains a @.The.B \-noption specifies printing without execution. However, if thecommand line has the string$(MAKE)in it,the line isalways executed (see discussion of the MAKEFLAGSmacro under.B Environment).The.B \-t(touch) option updates the modified date of afile without executing any commands..PPCommands returning nonzero status normally terminate.PN make .If the.B \-ioption is present, or the entry \.IGNORE: appears in.IR makefile ,or the initial character sequence of the command contains \-, the error is ignored.If the.B \-koption is present, work stops on the currententry, but continues on other branches that do not depend on that entry..PPThe.B \-boption allows old makefiles (those written for the old version of .PN make )to run without errors.The difference between the old versionof .PN makeand this version is that this version requires all dependencylines to have a (possibly null or implicit) command associated with them.The previous version of.PN makeassumed, if no command was specified explicitly,that the command was null..PPInterrupt and quit cause the target to be deletedunless the target is a dependentof the special name .PRECIOUS..SS EnvironmentThe environment is always read by .PN make .All variables are assumed to be macro definitions and processed as such.The.B \-eoption causesthe environment to override the macro assignments in a makefile..PPThe.PN makecommand operates in three compatibility modes. The type of mode isdetermined by value of the PROG_ENV environment variable and bythe way that.PN makeis executed. The PROG_ENV variable has three valid values:.IP \(buBSD.IP \(buPOSIX.IP \(buSYSTEM_FIVE .PPIn BSD mode,.PN makeexecutes with Berkeley compatibility. This means that .PN /bin/shis always used as the command interpreter regardless of the value ofSHELL, and the commands are echoed to standard out without a prefixed<tab>. .PPIn POSIX mode,.PN makeexecutes with POSIX compatibility, such that the SHELL environmentvariable is always ignored, SHELL is always overridden by MAKESHELL, theshell is always used to execute commands, and commands are echoed tostandard out with a prefixed <tab>. .PPSYSTEM_FIVE mode causes.PN maketo run with SYSTEM V compatibility such that SHELL is used to executecommands and commands are echoed to standard out with a prefixed <tab>..PPFor all modes, SHELL has a default value of .PN /bin/sh. When.PN makeis executed with the command name.PN s5make ,it always executes in SYSTEM_FIVE mode and ignores the environmentvariable PROG_ENV..PPThe MAKEFLAGS environment variableis processed by .PN make as containingany legal input option(except
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -