📄 make.1
字号:
.TH MAKE 1 .SH NAMEmake \- maintain program groups.SH SYNOPSIS.B make[.B \-fmakefile ] [ option ] ...file ....SH DESCRIPTION.I Makeexecutes commands in.I makefileto updateone or more target.IR names ..I Nameis typically a program.If no.B \-foption is present, `makefile' and `Makefile' aretried in order.If.I makefileis `\-', the standard input is taken.More than one.B \-foption may appear.PP.I Makeupdates a target if it depends on prerequisite filesthat have been modified since the target was last modified,or if the target does not exist..PP.I Makefilecontains a sequence of entries that specify dependencies.The first line of an entry is ablank-separated list of targets, then a colon,then a list of prerequisite files.Text following a semicolon, and all following linesthat begin with a tab, are shell commandsto be executed to update the target..PPSharp and newline surround comments..PPThe following makefile says that `pgm' depends on twofiles `a.o' and `b.o', and that they in turn depend on`.c' files and a common file `incl'..RS .HP.PD 0.nfpgm: a.o b.occ a.o b.o \-lm \-o pgm.HPa.o: incl a.ccc \-c a.c.HPb.o: incl b.ccc \-c b.c.fi.RE.PD.PP.I Makefileentries of the form.PP.IPstring1 = string2.PPare macro definitions.Subsequent appearances of .I $(string1)are replaced by.IR string2 .If.I string1is a single character, the parentheses are optional..PP.I Make infers prerequisites for files for which.I makefilegives no construction commands.For example, a`.c' file may be inferred as prerequisite for a `.o' fileand be compiled to produce the `.o' file.Thus the preceding example can be done more briefly:.RS.HP.PD 0.nfpgm: a.o b.occ a.o b.o \-lm \-o pgm.HPa.o b.o: incl.fi.RE.PD.PPPrerequisites are inferred according to selected suffixeslisted as the `prerequisites' for the special name `.SUFFIXES';multiple lists accumulate;an empty list clears what came before.Order is significant; the first possible name for which botha file and a rule as described in the next paragraph existis inferred.The default list is.IP\&.SUFFIXES: .out .o .c .e .r .f .y .l .s.PPThe rule to create a file with suffix.I s2that depends on a similarly named file with suffix.I s1is specified as an entryfor the `target'.IR s1s2 .In such an entry, the special macro $* stands forthe target name with suffix deleted, $@ for the full target name,$< for the complete list of prerequisites,and$? for the list of prerequisites that are out of date.For example, a rule for makingoptimized `.o' files from `.c' files is.IP\&.c.o: ; cc \-c \-O \-o $@ $*.c.PPCertain macros are used by the default inference rulesto communicate optional arguments toany resulting compilations.In particular, `CFLAGS' is used for.I ccand .IR f77 (1)options, `LFLAGS' and `YFLAGS' for .I lexand.IR yacc (1)options..PPCommand lines are executed one at a time, each by itsown shell.A line is printed when it is executed unlessthe special target `.SILENT'is in .I makefile,or the first character of the command is `@'..PPCommands returning nonzero status (see.IR intro (1))cause.I maketo terminate unlessthe special target `.IGNORE' is in.I makefileor the command begins with<tab><hyphen>..PPInterrupt and quit cause the target to be deletedunless the target depends on the special name `.PRECIOUS'..PPOther options:.TP.B \-iEquivalent to the special entry `.IGNORE:'..TP.B \-kWhen a command returns nonzero status,abandon work on the current entry, butcontinue on branches that do not depend on the current entry..TP.B \-nTrace and print, but do not execute the commandsneeded to update the targets..TP.B \-tTouch, i.e. update the modified date of targets, withoutexecuting any commands..TP.B \-rEquivalent to an initial special entry `.SUFFIXES:'with no list..TP .B \-sEquivalent to the special entry`.SILENT:'..SH FILESmakefile, Makefile.br.SH "SEE ALSO"sh(1), touch(1).brS. I. Feldman.IMake \- A Program for Maintaining Computer Programs.SH BUGSSome commands return nonzero status inappropriately.Use.B \-ito overcome the difficulty..brCommands that are directly executed by the shell,notably.IR cd (1),are ineffectual across newlines in.I make.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -