[gtkada] DESTDIR blocked, patch provided

Emmanuel Briot briot at adacore.com
Mon Jul 1 14:25:56 CEST 2013


> By the way, the proper way would be
> DESTDIR?=
> 
> not
> 
> DESTDIR=

No, the latter is correct as per GNU make documentation.


<<<
6.4 How Variables Get Their Values
==================================

Variables can get values in several different ways:

   * You can specify an overriding value when you run `make'.  *Note
     Overriding Variables: Overriding.

   * You can specify a value in the makefile, either with an assignment
     (*note Setting Variables: Setting.) or with a verbatim definition
     (*note Defining Multi-Line Variables: Multi-Line.).

   * Variables in the environment become `make' variables.  *Note
     Variables from the Environment: Environment.

   * Several "automatic" variables are given new values for each rule.
     Each of these has a single conventional use.  *Note Automatic
     Variables::.

   * Several variables have constant initial values.  *Note Variables
     Used by Implicit Rules: Implicit Variables.

9.5 Overriding Variables
========================

An argument that contains `=' specifies the value of a variable: `V=X'
sets the value of the variable V to X.  If you specify a value in this
way, all ordinary assignments of the same variable in the makefile are
ignored; we say they have been "overridden" by the command line
argument.
>>>



Note the last paragraph which is exactly what we are doing, and thus if you
specify a value on the command line the default value set in the Makefile
is ignored (or should be, if for some reason it isn't in your case). Specifying the
value on the command line is of course the intended use, again as per Make
documentation.
However, that documentation also contains the following paragraph which goes
towards what you are saying:

<<<
   You should not set the value of `DESTDIR' in your `Makefile' at all;
then the files are installed into their expected locations by default.
Also, specifying `DESTDIR' should not change the operation of the
software in any way, so its value should not be included in any file
contents.
>>>


So I believe GtkAda is currently correct, although indeed applying your patch
might be more in line with the recommended approach.
I will therefore apply the patch.

regards
Emmanuel



More information about the gtkada mailing list