Re: Makefiles compatible with both BSD and GNU make?
On Wed, Mar 16, 2005 at 02:50:17PM -0600, Dan Nelson wrote: > > 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. Sure enough. BSD make requires quotes around the filename in .include ".depend" but if one removes the leading dot on "include" it can't find .depend if the filename is still quoted. This works in BSD make altho its not doing anything that isn't automatically done: .include ".depend" Above is apparently the same as this in GNU make and accepted by BSD: include .depend This does not work in BSD as it seems to be trying to find ".depend" with quotes, which doesn't exist: include ".depend" -- David Kelly N4HHE, [EMAIL PROTECTED] Whom computers would destroy, they must first drive mad. ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "[EMAIL PROTECTED]"
Re: Makefiles compatible with both BSD and GNU make?
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 [EMAIL PROTECTED] ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "[EMAIL PROTECTED]"
Makefiles compatible with both BSD and GNU make?
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. Yes, I could simply use gmake on FreeBSD and make under cygwin, but where is the fun in that? Not only no fun but nothing to be learned. Is there a way I can write the include of .depend that GNU make will use and at the same time BSD make will either ignore or do the same as GNU? Meanwhile I'm just accepting the fact on cygwin the only sure way to update is "make clean" before "make". -- David Kelly N4HHE, [EMAIL PROTECTED] Whom computers would destroy, they must first drive mad. ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "[EMAIL PROTECTED]"