andysworkshop/stm32plus — pull request #38 by mikepurvis (2014-05-20 13:50:47+00:00)
Title: Better INSTALLDIR handling

Right now, the INSTALLDIR constant is [hard-coded to a /usr/lib path](https://github.com/andysworkshop/stm32plus/blob/master/SConstruct#L92):

INSTALLDIR="/usr/lib/stm32plus/"+VERSION

This is not ideal for a couple reasons:

* It should be parameterized— this is essential for packaging.
* It should default to a path in `/usr/local`, not `/usr`.
* Includes are ending up in a subdirectory of a `lib` dir, which is not the intended use of that path.
* The inclusion of the version number in the path is bit odd. If and when stm32plus is packaged, versioning should be handled by the packaging system.

There's no non-breaking way to change this, so I'm hoping to discuss here rather than just send a breaking PR. My suggested approach, which I believe would be FHS compliant and in-line with how gnuarm itself works would be that the INSTALLDIR line becomes:

INSTALLDIR = ARGUMENTS.get('INSTALLDIR') or "/usr/local/arm-none-eabi"

With the intent that a packaging system would override it to be `/usr/arm-none-eabi`.

Then, the static library would be installed to (eg) `INSTALLDIR + "/lib/stm32plus/libstm32plus-030300-small-f4-8000000.a"`, which would be:

/usr/local/arm-none-eabi/lib/stm32plus/libstm32plus-030300-small-f4-8000000.a # installed from source
/usr/arm-none-eabi/lib/stm32plus/libstm32plus-030300-small-f4-8000000.a # installed from packaging

And the headers, for example, to `INSTALLDIR + "/include/stm32plus/config/stm32plus.h"`, which would be

/usr/local/arm-none-eabi/include/stm32plus/config/stm32plus.h # installed from source
/usr/arm-none-eabi/include/stm32plus/config/stm32plus.h # installed from packaging

Thoughts on this?