Keeping the build environment portable
======================================

$Id: README.build.txt,v 1.1 2000/12/03 04:09:49 pascal Exp $

GNU make is the best make there is. Or perhaps it is not, but it is
the make that is being used for Mobilizer, therefore all Makefile's
should be fully compatible with it.


Which make
==========

Do not do something like:

	make -C directory

Because this may not invoke GNU make. If possible, use:

	${MAKE} -C directory

If you really need to enter a hard-coded command name, use
`gmake'. Experience shows that if GNU make is installed, `gmake' will
exist and refer to it, even if normal `make' also refers to GNU make.

Functions
=========

The $(wildcard *.c) function does not seem to work with all versions
of GNU make (that is, GNU make 3.77 on Solaris). Use $(shell ls *.c)
instead.

Shell
=====

The only thing you can assume about the shell is that sh exists in
/bin/sh. Also, don't assume that gmake is running under a particular 
shell.

Scripts
=======

If you have written scripts that you need to run from the Makefile,
remember these:

- Don't count on them being executable.

That is, don't invoke them from a Makefile like:

	./myscript

- Don't assume them to be run under your favorite shell.

That is, don't invoke them from a Makefile like:

	. myscript

Instead, invoke your home-grown scripts from a Makefile like this:

	/bin/sh myscript

