configuring for cross compiling

Daniel Franke franke.daniel at gmail.com
Tue Jun 6 17:36:24 BST 2006


> building for the AVR platform requires the additional compiler option; the
> part number such as "-mmcu=atmega64". I would like to leave this option to
> the individual while making the "--host=avr" as default. How can i do this?

The options '--host', '--build' and '--target' are defined by configure. You 
will have to employ (black?) AC/AM magic to achieve what you want (if 
possible at all).


> Further, i would like to perform some additional processing on the
> resulting .elf file after every build. Commands that split the elf file to
> flash image, eeprom image etc. while indicating to the user the amount of
> memory consumed. This should happen independent of whether the binary was
> built from the command line or KDevelop IDE.
>
> How would be the best way that i achieve the above?

Assuming that you are using an automake based project type: edit your 
corresponding Makefile.am(s) and add or overwrite an appropiate target, e.g.

-- http://sources.redhat.com/automake/automake.html --
11.3 Extending installation
It is possible to extend this mechanism by defining an install-exec-local or 
install-data-local rule. If these rules exist, they will be run at make 
install time. These rules can do almost anything; care is required.  Automake 
also supports two install hooks, install-exec-hook and install-data-hook. 
These hooks are run after all other install rules of the appropriate type, 
exec or data, have completed. So, for instance, it is possible to perform 
post-installation modifications using an install hook. Extending gives some 
examples.
--

There are uninstall- and dist-hooks as well, but no "build-hooks", say, I 
couldn't find any scanning the manual. 


Hope this helps
   Daniel






More information about the KDevelop mailing list