Minix2.0/man/man1/make.1

.TH MAKE 1
.SH NAME
make \- a program for maintaining large programs
.SH SYNOPSIS
\fBmake\fR [\fB\-f \fIfile\fR]\fR [\fB\-iknpqrst\fR] [\fIoption\fR] ... [\fItarget\fR]\fR
.br
.de FL
.TP
\\fB\\$1\\fR
\\$2
..
.de EX
.TP 20
\\fB\\$1\\fR
# \\$2
..
.SH OPTIONS
.FL "\-f" "Use \fIfile\fP as the makefile"
.FL "\-i" "Ignore status returned by commands"
.FL "\-k" "On error, skip to next command"
.FL "\-n" "Report, but do not execute"
.FL "\-p" "Print macros and targets"
.FL "\-q" "Question up-to-dateness of target"
.FL "\-r" "Rule inhibit; do not use default rules"
.FL "\-s" "Silent mode"
.FL "\-t" "Touch files instead of making them"
.SH EXAMPLES
.EX "make kernel" "Make \fIkernel\fP up to date"
.EX "make \-n \-f mfile" "Tell what needs to be done"
.SH DESCRIPTION
.PP
.I Make
is a program that is normally used for developing large programs consisting of
multiple files.
It keeps track of which object files depend on which source and header files.
When called, it does the minimum amount of recompilation to bring the target
file up to date.
.PP
The file dependencies are expected in 
.I makefile
or
.I Makefile ,
unless another file is specified with \fB\-f\fR.
.I Make
has some default rules built in, for example, it knows how to make 
.I .s
files
from 
.I .c
files.
Here is a sample 
.I makefile .
.PP
.nf
.ta 0.25i 1.0i 3.0i
	d=/user/ast		# \fId\fP is a macro
	program:	head.s tail.s	# \fIprogram\fR depends on these
		cc \-o program head.s tail.s	# tells how to make \fIprogram\fP 
		echo Program done.	# announce completion
	head.s:	$d/def.h head.c	# \fIhead.s\fP depends on these
.br
	tail.s:	$d/var.h tail.c	# \fItail.s\fP depends on these
.PP
.fi
A complete description of \fImake\fR would require too much space here.
Many books on
\s-2UNIX\s+2
discuss
.I make .
Study the numerous \fIMakefiles\fR in the 
\s-2MINIX\s+2
source tree for examples.
.SH "SEE ALSO"
.BR cc (1).