Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 1 Oct 2001 21:30:47 -0700 (PDT)
From:      Annelise Anderson <andrsn@andrsn.stanford.edu>
To:        brain_damaged <brain_damaged@florida-wireless.com>
Cc:        freebsd-questions <freebsd-questions@FreeBSD.ORG>
Subject:   Re: Make
Message-ID:  <Pine.BSF.4.10.10110012112030.64694-100000@andrsn.stanford.edu>
In-Reply-To: <200110011240.AA1597047398@florida-wireless.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, 1 Oct 2001, brain_damaged wrote:

> I was on onlamp.com and in the articles the writer uses the below to install his ports. I know what the cd / means.
> 
> cd /usr/ports/net/tcpshow
> 
> however what does the next line mean/do ?
> 
> make install clean
> 
make looks for a file called Makefile (or, secondarily, a file called
makefile, and others) in the directory in which you typed the command.

What is then done depends on what's in the Makefile.

xanne@killer ~ % make
make: no target to make.

So, make needs a target in the Makefile.  A Makefile can have many
targets, a target can have many subcommands or include other targets,
and a Makefile can incorporate other makefiles via an .include statement
at the end, which you see in the Makefiles in ports directories.

If the target doesn't exist, make tells you it doesn't know how to
make that target (old joke):

xanne@killer ~ % make love
make: don't know how to make love. Stop

If there's a Makefile and you don't give make a target, it will
use "all" as its default target.  But what the "all" target does
depends on the Makefile.  In the Makefiles in ports, the default
target all for a given port does make fetch, make extract, make
patch, make configure, and make build.  The make build target
does the same thing.  Notice the default target does not install.

make install does all of the above including install; but make
will not redo what it has already done.  See a work directory
for a port you've built to discover why not.  Often you want to
make sure a port builds before you install it, especially if
you're upgrading a port.

make clean removes the work directory the port creates when it
extracts, patches, configures, and builds. These directories take
a lot of space, but are worth looking at for options, documentation
the port doesn't install, and so forth.  Some of the options are
given in a port's Makefile so you can comment or uncomment them
to customize your build, but not all of them.  

Don't take this as the last word on make. 


	Annelise

-- 
Annelise Anderson
Author of: 		 FreeBSD: An Open-Source Operating System for Your PC
Available from:	 mall.daemonnews.org and amazon.com
Book Website:    http://www.bittreepress.com/FreeBSD/introbook/	




To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.4.10.10110012112030.64694-100000>