[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Portable Makefiles



Nick Phillips <nwp@nz.lemon-computing.com> writes:

> Does anyone have any experience of making the DESTDIR idiom used in
> Makefiles to get stuff to install in the right place portable across
> at least GNU make, PMake (BSD) and Solaris make (preferably whatever POS
> HP-UX uses, too)?
> 
> PMake won't "export" so we get DESTDIR explicitly set in the sub-makes'
> environments.
> 
> PMake also (although the manual claims to the contrary) seems to allow
> the "DESTDIR=" to override the command-line setting, so we get
> "DESTDIR ?=".
> 
> That causes Solaris make to barf.
> 
> We can't just leave out the explicit set to the empty string, as PMake
> will allegedly not replace an implicitly empty variable, but will just
> leave the "${DESTDIR}" in place instead.

You could define DESTDIR in a Makefile.GNU, Makefile.BSD,
Makefile.Solaris etc and have them included appropriately.

HTH
-- 
An inside-out teddy bear looks freaky...
http://draco.mit.edu/teddyborg/pg2.html



Reply to: