[9] | 1 | .TH MAKE 1
|
---|
| 2 | .SH NAME
|
---|
| 3 | make \- a program for maintaining large programs
|
---|
| 4 | .SH SYNOPSIS
|
---|
| 5 | \fBmake\fR [\fB\-f \fIfile\fR]\fR [\fB\-adeiknpqrst\fR] [\fIoption\fR] ... [\fItarget\fR]\fR
|
---|
| 6 | .br
|
---|
| 7 | .de FL
|
---|
| 8 | .TP
|
---|
| 9 | \\fB\\$1\\fR
|
---|
| 10 | \\$2
|
---|
| 11 | ..
|
---|
| 12 | .de EX
|
---|
| 13 | .TP 20
|
---|
| 14 | \\fB\\$1\\fR
|
---|
| 15 | # \\$2
|
---|
| 16 | ..
|
---|
| 17 | .SH OPTIONS
|
---|
| 18 | .FL "\-f" "Use \fIfile\fP as the makefile"
|
---|
| 19 | .FL "\-d" "Print debugging information"
|
---|
| 20 | .FL "\-e" "Environment overrides makefile macros"
|
---|
| 21 | .FL "\-i" "Ignore status returned by commands"
|
---|
| 22 | .FL "\-k" "On error, skip to next command"
|
---|
| 23 | .FL "\-n" "Report, but do not execute"
|
---|
| 24 | .FL "\-p" "Print macros and targets"
|
---|
| 25 | .FL "\-q" "Question up-to-dateness of target"
|
---|
| 26 | .FL "\-r" "Rule inhibit; do not use default rules"
|
---|
| 27 | .FL "\-s" "Silent mode"
|
---|
| 28 | .FL "\-t" "Touch files instead of making them"
|
---|
| 29 | .SH EXAMPLES
|
---|
| 30 | .EX "make kernel" "Make \fIkernel\fP up to date"
|
---|
| 31 | .EX "make \-n \-f mfile" "Tell what needs to be done"
|
---|
| 32 | .SH DESCRIPTION
|
---|
| 33 | .PP
|
---|
| 34 | .I Make
|
---|
| 35 | is a program that is normally used for developing large programs consisting of
|
---|
| 36 | multiple files.
|
---|
| 37 | It keeps track of which object files depend on which source and header files.
|
---|
| 38 | When called, it does the minimum amount of recompilation to bring the target
|
---|
| 39 | file up to date.
|
---|
| 40 | .PP
|
---|
| 41 | The file dependencies are expected in
|
---|
| 42 | .I makefile
|
---|
| 43 | or
|
---|
| 44 | .I Makefile ,
|
---|
| 45 | unless another file is specified with \fB\-f\fR.
|
---|
| 46 | .I Make
|
---|
| 47 | has some default rules built in, for example, it knows how to make
|
---|
| 48 | .I .o
|
---|
| 49 | files
|
---|
| 50 | from
|
---|
| 51 | .I .c
|
---|
| 52 | files.
|
---|
| 53 | Here is a sample
|
---|
| 54 | .I makefile .
|
---|
| 55 | .PP
|
---|
| 56 | .nf
|
---|
| 57 | .ta +0.2i +\w'program:'u+1m +\w'cc \-o program head.o tail.o'u+2m
|
---|
| 58 | d=/user/ast # \fId\fP is a macro
|
---|
| 59 | program: head.o tail.o # \fIprogram\fR depends on these
|
---|
| 60 | cc \-o program head.o tail.o # tells how to make \fIprogram\fP
|
---|
| 61 | echo Program done. # announce completion
|
---|
| 62 | head.o: $d/def.h head.c # \fIhead.o\fP depends on these
|
---|
| 63 | .br
|
---|
| 64 | tail.o: $d/var.h tail.c # \fItail.o\fP depends on these
|
---|
| 65 | .PP
|
---|
| 66 | .fi
|
---|
| 67 | A complete description of \fImake\fR would require too much space here.
|
---|
| 68 | Many books on
|
---|
| 69 | \s-2UNIX\s+2
|
---|
| 70 | discuss
|
---|
| 71 | .I make .
|
---|
| 72 | Study the numerous \fIMakefiles\fR in the
|
---|
| 73 | \s-1MINIX 3\s-1
|
---|
| 74 | source tree for examples.
|
---|
| 75 | .SH "SEE ALSO"
|
---|
| 76 | .BR cc (1).
|
---|