Page 1 of 1

Dual Build

Posted: Tue Jul 05, 2016 12:13 pm
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

Re: Dual Build

Posted: Tue Jul 05, 2016 12:26 pm
by Giovanni
Probably two makefiles.

Giovanni

Re: Dual Build

Posted: Tue Jul 05, 2016 12:56 pm
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 ?

Re: Dual Build

Posted: Tue Jul 05, 2016 1:01 pm
by Giovanni
The two makefiles can include different scatter file and set preprocessor switches.

Giovanni

Re: Dual Build

Posted: Tue Jul 05, 2016 1:05 pm
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 :-)

Re: Dual Build

Posted: Tue Jul 05, 2016 1:24 pm
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

Re: Dual Build

Posted: Sun Jul 10, 2016 11:22 am
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.

Re: Dual Build

Posted: Mon Jul 11, 2016 11:39 am
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.