From owner-freebsd-questions Sat Jun 24 13:10:16 2000 Delivered-To: freebsd-questions@freebsd.org Received: from emu.prod.itd.earthlink.net (emu.prod.itd.earthlink.net [207.217.121.31]) by hub.freebsd.org (Postfix) with ESMTP id CCE3E37BB9B for ; Sat, 24 Jun 2000 13:10:11 -0700 (PDT) (envelope-from cjc@earthlink.net) Received: from dialin-client.earthlink.net (pool0858.cvx20-bradley.dialup.earthlink.net [209.179.253.93]) by emu.prod.itd.earthlink.net (8.9.3-EL_1_3/8.9.3) with ESMTP id NAA03771; Sat, 24 Jun 2000 13:10:05 -0700 (PDT) Received: (from cjc@localhost) by dialin-client.earthlink.net (8.9.3/8.9.3) id NAA00387; Sat, 24 Jun 2000 13:08:40 -0700 (PDT) Date: Sat, 24 Jun 2000 13:08:09 -0700 From: "Crist J. Clark" To: Mark Ovens Cc: David Banning , questions@FreeBSD.ORG Subject: Re: question about makefiles Message-ID: <20000624130808.B256@dialin-client.earthlink.net> Reply-To: cjclark@alum.mit.edu References: <3954FC28.65C7DD21@yahoo.com> <20000624192639.G233@parish> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 1.0.1i In-Reply-To: <20000624192639.G233@parish>; from mark@dogma.freebsd-uk.eu.org on Sat, Jun 24, 2000 at 07:26:39PM +0100 Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Sat, Jun 24, 2000 at 07:26:39PM +0100, Mark Ovens wrote: > On Sat, Jun 24, 2000 at 02:21:28PM -0400, David Banning wrote: > > > > I have a general question about Makefiles. > > > > I see Makefile variables defined near the beginning of the file, > > however > > some variables used are seemingly not defined. > > > > a simple Makefile line says; > > > > @${PATCH} -s ${PREFIX}/Office51/bin/setup ${FILESDIR}/setup.patch > > > > PATCH, PREFIX and FILESDIR all are used, but not defined in Makefile. > > > > So where do they get defined? > > > > /etc/make.conf and, for ports, /usr/ports/Mk/bsd.port.mk Don't forget, /usr/share/mk/sys.mk /etc/defaults/make.conf /etc/make.conf.local /usr/share/mk/bsd.own.mk /etc/objformat How it works (I believe) is that /usr/share/mk/sys.mk is sourced initially for all make(1)s. If you look at that file, it is the one including, /etc/defaults/make.conf /etc/make.conf /etc/make.conf.local /usr/share/mk/bsd.own.mk And that last one in turn also sucks up, /etc/objformat Now for ports, you will notice that the Makefiles have .include's of their own which end up getting the files in /usr/ports/Mk as Mark pointed out. It all makes perfect sense... eventually. -- Crist J. Clark cjclark@alum.mit.edu To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message