Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 16 Mar 2005 14:50:17 -0600
From:      Dan Nelson <dnelson@allantgroup.com>
To:        David Kelly <dkelly@hiwaay.net>
Cc:        FreeBSD-Questions@freebsd.org
Subject:   Re: Makefiles compatible with both BSD and GNU make?
Message-ID:  <20050316205017.GC27170@dan.emsphone.com>
In-Reply-To: <20050316203249.GA43323@Grumpy.DynDNS.org>
References:  <20050316203249.GA43323@Grumpy.DynDNS.org>

next in thread | previous in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20050316205017.GC27170>