From owner-freebsd-questions Wed Apr 24 23:27:33 2002 Delivered-To: freebsd-questions@freebsd.org Received: from mailf.telia.com (mailf.telia.com [194.22.194.25]) by hub.freebsd.org (Postfix) with ESMTP id A488A37B433 for ; Wed, 24 Apr 2002 23:27:15 -0700 (PDT) Received: from d1o913.telia.com (d1o913.telia.com [195.252.44.241]) by mailf.telia.com (8.11.6/8.11.6) with ESMTP id g3P6RAK29339 for ; Thu, 25 Apr 2002 08:27:11 +0200 (CEST) Received: from falcon.midgard.homeip.net (h53n2fls20o913.telia.com [212.181.163.53]) by d1o913.telia.com (8.8.8/8.8.8) with SMTP id IAA09072 for ; Thu, 25 Apr 2002 08:27:09 +0200 (CEST) Received: (qmail 88215 invoked by uid 1001); 25 Apr 2002 06:27:07 -0000 Date: Thu, 25 Apr 2002 08:27:07 +0200 From: Erik Trulsson To: Peter Leftwich Cc: FreeBSD LIST Subject: Re: make install clean ; more /etc/gcc.conf ; echo "Smiles..." Message-ID: <20020425062707.GA88136@student.uu.se> Mail-Followup-To: Peter Leftwich , FreeBSD LIST References: <20020425013105.P7840-100000@earl-grey.cloud9.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20020425013105.P7840-100000@earl-grey.cloud9.net> User-Agent: Mutt/1.3.28i Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Thu, Apr 25, 2002 at 01:34:44AM -0400, Peter Leftwich wrote: > I just did `which make` thinking it was some kind of symlink (ln -s) to gcc > or some sort of alias for gcc to use the "./Makefile" in ones current > directory, but nupe... > > So my question is this broad one ~ Can Makefiles be thought of as > instantaneous little /etc/gcc.conf or ~/.gcc_config files? That is, aren't > they often just special conglomerations of flags and paths and so forth? No. Quoting from the manpage for make(1): Make is a program designed to simplify the maintenance of other programs. Its input is a list of specifications describing dependency relationships between the generation of files and programs. That 'list of specifications' is a Makefile. In addition to describing how various files depend on each other, i.e. which files/programs need to be created first in order to create others, a makefile also contains rules for how to create the files. Take a look at the following very short example of a Makefile foo: foo.o foo.o: foo.c cc -c foo.c It says that to create the file 'foo', one must first make foo.o 'foo.o' in turn depends on 'foo.c', meaning that if 'foo.c' is updated 'foo.o' must also be updated. The final line says that in order to make 'foo.o' the command 'cc -c foo.c' should be executed. The commands to be executed are often invocations of the C compiler but that is by no means necessary. One can do much more complicated things with makefiles. The Makefiles found in the ports collections essentially just sets some variables and then includes other, more complicated, makefiles from /usr/ports/Mk/ that does the real job. Assuming you have installed the documentation parts of FreeBSD the following command might give you some more information: zmore /usr/share/doc/psd/12.make/paper.ascii.gz -- Erik Trulsson ertr1013@student.uu.se To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message