[build2] Handling other target types

Moldmann Max (DC-MA/ENG52-NA) Max.Moldmann at boschrexroth-us.com
Mon Apr 10 14:39:30 UTC 2017


Hi Boris,

After build an elf file needs to be converted into the Intel Hex file format using e.g. objcopy -O ihex input.elf output.hex.
And there are some other things you might want to do, i.e. calculating resource consumption like Flash or RAM usage.
You can always do additional pre-build or post-build work in a script.
But sometimes it's nice to do some of this stuff inside a makefile so that it is only done when these additional target dependencies are met.
So it would be nice to be able to tell build2 that there is a hex file target and it needs the elf file ({exe}) and then just fire some arbitrary shell commands.

Max

-----Original Message-----
From: Boris Kolpackov [mailto:boris at codesynthesis.com] 
Sent: Saturday, April 8, 2017 12:12 PM
To: Moldmann Max (DC-MA/ENG52-NA) <Max.Moldmann at boschrexroth-us.com>
Cc: users at build2.org
Subject: Re: [build2] Handling other target types

Hi Max,

Moldmann Max (DC-MA/ENG52-NA) <Max.Moldmann at boschrexroth-us.com> writes:

> How can build2 handle other target types like elf and hex files for 
> embedded cross compilation? Currently I let the exe target type handle 
> the elf files. But how can I add a rule to create my hex files?

Currently the only way is to hack the build driver directly. Proper support for this is planned for 0.6.0 (i.e., after the upcoming 0.5.0).
This is, BTW, the last major missing block after which we can start focusing on 1.0.0.

In the meantime, can you describe what you need to accomplish? I.e., how these files are generated, where they go after that, etc. So that we can make sure this use-case will be handled.

Thanks,
Boris



More information about the users mailing list