From owner-freebsd-hackers@FreeBSD.ORG Thu Aug 7 11:50:58 2003 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 1A69C37B401; Thu, 7 Aug 2003 11:50:58 -0700 (PDT) Received: from duke.cs.duke.edu (duke.cs.duke.edu [152.3.140.1]) by mx1.FreeBSD.org (Postfix) with ESMTP id D1B1C43F93; Thu, 7 Aug 2003 11:50:56 -0700 (PDT) (envelope-from gallatin@cs.duke.edu) Received: from grasshopper.cs.duke.edu (grasshopper.cs.duke.edu [152.3.145.30]) by duke.cs.duke.edu (8.12.9/8.12.9) with ESMTP id h77Iounq012061 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO); Thu, 7 Aug 2003 14:50:56 -0400 (EDT) Received: (from gallatin@localhost) by grasshopper.cs.duke.edu (8.11.6/8.9.1) id h77IopS93669; Thu, 7 Aug 2003 14:50:51 -0400 (EDT) (envelope-from gallatin@cs.duke.edu) From: Andrew Gallatin MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <16178.40843.224377.273862@grasshopper.cs.duke.edu> Date: Thu, 7 Aug 2003 14:50:51 -0400 (EDT) To: Ruslan Ermilov In-Reply-To: <20030807184846.GB45191@sunbay.com> References: <16178.40342.11000.35373@grasshopper.cs.duke.edu> <20030807184846.GB45191@sunbay.com> X-Mailer: VM 6.75 under 21.1 (patch 12) "Channel Islands" XEmacs Lucid cc: freebsd-hackers@freebsd.org Subject: Re: BSD make question X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Aug 2003 18:50:58 -0000 Ruslan Ermilov writes: > On Thu, Aug 07, 2003 at 02:42:30PM -0400, Andrew Gallatin wrote: > > > > Using BSD make, how can I apply different rules based on different > > directories while using only a single makefile? > > > There's a .CURDIR variable that can be used to conditionalize > parts of a makefile. > > > Ie, the appended Makefile results in the following compilations: > > > > gcc -DLIB -c lib/foo.c -o lib/foo.o > > gcc -DLIB -c lib/bar.c -o lib/bar.o > > gcc -DMCP -c mcp/baz.c -o mcp/baz.o > > > > Is it possible to do something similar with BSD make? > > > It just works "as is" with bmake. What's your problem, Drew? ;-) > > $ make -n > cc -O -pipe -march=pentiumpro -c lib/foo.c ;) But its missing the -DLIB or -DMCP. Thanks for the .CURDIR hint. Drew