[gtkada] Patch: Make DESTDIR orthogonal to prjdir.

Emmanuel Briot briot at adacore.com
Wed Aug 1 15:53:39 CEST 2012


> This patch corrects the usage of DESTDIR in projects/Makefile. I know it's 
> tempting to add DESTDIR in one place instead of several, but DESTDIR should 
> always be orthogonal to other Make variables. When packagers need to change 
> the location of project files (to /usr/share/gpr for example) and also install 
> to a staging directory (/tmp/stage, say), they expect to be able to pass 
> "prjdir=/usr/share/gpr DESTDIR=/tmp/stage" to Make. It shouldn't be necessary 
> to write "prjdir=/tmp/stage/usr/share/gpr DESTDIR=/tmp/stage".

On the other hand, the convention is that upper case variables in Makefile are supposed to be overridable by the user from the command line, whereas users should not try to override lower-case variables.

Your patch also results in double-quoting on the command line, thus it isn't protecting directories with spaces:

     mkdir -p ""/usr/local/gnat/lib/gnat""

I have applied a similar patch, although I would not encourage you to install the project files in another location that prefix/lib/gnat.
prefix/share/gpr is not supported by all tools, and is also fairly recent in any case.

Emmanuel


More information about the gtkada mailing list