Dual Build

ChibiOS public support forum for all topics not covered by a specific support forum.

Moderators: RoccoMarco, lbednarz, tfAteba

Post Reply
Tabulous
Posts: 518
Joined: Fri May 03, 2013 12:02 pm
Has thanked: 7 times
Been thanked: 18 times

Dual Build

Post by Tabulous »

What would the best way to automate building two binary's from the same project, where by the difference is the makefile i.e. using different scatter files for each build
User avatar
Giovanni
Site Admin
Posts: 14895
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 997 times

Re: Dual Build

Post by Giovanni »

Probably two makefiles.

Giovanni
Tabulous
Posts: 518
Joined: Fri May 03, 2013 12:02 pm
Has thanked: 7 times
Been thanked: 18 times

Re: Dual Build

Post by Tabulous »

Giovanni wrote:Probably two makefiles.

Giovanni


yes that would be an option, but how would one instigate the usage of two makefiles ????

could you not pass a build define to one make file and then this is conditionally checked and either one or another scatter file is used ?
User avatar
Giovanni
Site Admin
Posts: 14895
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 997 times

Re: Dual Build

Post by Giovanni »

The two makefiles can include different scatter file and set preprocessor switches.

Giovanni
Tabulous
Posts: 518
Joined: Fri May 03, 2013 12:02 pm
Has thanked: 7 times
Been thanked: 18 times

Re: Dual Build

Post by Tabulous »

Giovanni wrote:The two makefiles can include different scatter file and set preprocessor switches.

Giovanni


Ok but how does one implement this in chibistudio, all i want to achieve is

press build button, and out pops two binarys :-)

PS im no expert on setting up Eclipse, hence the guidance :-)
User avatar
Giovanni
Site Admin
Posts: 14895
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 997 times

Re: Dual Build

Post by Giovanni »

Make a makefile that makes the other two makefiles :)

For example:
- Makefile
- Makefile_this
- Makefile_that

Eclipse would on "see" the first one.

The problem that I can see is that both would create "build" and ".dep" directories, so you may need to put the makefiles in different directories.

Giovanni
steved
Posts: 834
Joined: Fri Nov 09, 2012 2:22 pm
Has thanked: 12 times
Been thanked: 138 times

Re: Dual Build

Post by steved »

I've had a quick play with this, including two separate makefiles into the main makefile as suggested.

Giving each build a different project name generates differently named sets of binaries etc in the build directory.

The problem (as Giovanni suggested) is the single dependency directory. And putting the two build makefiles in separate subdirectories didn't solve that - the depndencies were still put into the '.dep' directory. Related to this is the fact that the build is only started once the complete makefile structure has been read. What's really needed is to run the two build makefiles sequentially, rather than as a single operation.
steved
Posts: 834
Joined: Fri Nov 09, 2012 2:22 pm
Has thanked: 12 times
Been thanked: 138 times

Re: Dual Build

Post by steved »

The other potential problem is that each source file is only compiled once. Not a problem with similar processors (I was working with 32F051 and 32F091), but could be if the two processors have different instruction sets, or need different compiler options.
Post Reply