From owner-freebsd-questions@FreeBSD.ORG Wed Mar 16 20:50:19 2005 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 0449E16A4CE for ; Wed, 16 Mar 2005 20:50:19 +0000 (GMT) Received: from dan.emsphone.com (dan.emsphone.com [199.67.51.101]) by mx1.FreeBSD.org (Postfix) with ESMTP id 70B6C43D41 for ; Wed, 16 Mar 2005 20:50:18 +0000 (GMT) (envelope-from dan@dan.emsphone.com) Received: (from dan@localhost) by dan.emsphone.com (8.13.1/8.13.1) id j2GKoHi8040793; Wed, 16 Mar 2005 14:50:17 -0600 (CST) (envelope-from dan) Date: Wed, 16 Mar 2005 14:50:17 -0600 From: Dan Nelson To: David Kelly Message-ID: <20050316205017.GC27170@dan.emsphone.com> References: <20050316203249.GA43323@Grumpy.DynDNS.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20050316203249.GA43323@Grumpy.DynDNS.org> X-OS: FreeBSD 5.4-PRERELEASE X-message-flag: Outlook Error User-Agent: Mutt/1.5.8i cc: FreeBSD-Questions@freebsd.org Subject: Re: Makefiles compatible with both BSD and GNU make? X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Mar 2005 20:50:19 -0000 In the last episode (Mar 16), David Kelly said: > I got the silly idea that I want one Makefile to work with both BSD > and GNU makes. Silly me. Fairly simple Makefiles work but when > expanding my Makefile to include .depend generation I get tripped. > > BSD make automagically uses .depend if one is found. GNU make > requires the file be named in an include, but the syntax of GNU > include is different than BSD. As is the syntax of conditional > statements. FreeBSD's make understands the gnu-style include syntax with no leading dot, even though it's undocumented (grep for SYSVINCLUDE in the source). Automake is the usual way around compatibility issues; it has its own conditional syntax that it expands out when it generates the Makefile, and will create the appropriate dependency lines. -- Dan Nelson dnelson@allantgroup.com