[INFO] Implemented "Smart Build" mode

This forum is dedicated to feedback, discussions about ongoing or future developments, ideas and suggestions regarding the ChibiOS projects are welcome. This forum is NOT for support.
User avatar
Giovanni
Site Admin
Posts: 14892
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

[INFO] Implemented "Smart Build" mode

Post by Giovanni »

Hi,

Just a note, I made makefiles "smarter", now they look into chconf.h and halconf.h and only enabled modules are compiled. This should speed up a lot the build process. This was becoming a problem because the HAL is growing larger and it is problematic compile all of it each time.

The feature is experimental and not enabled by default, if you want to give it a try please put "USE_SMART_BUILD = yes" into your makefile. The only assumption is that halconf.h, chconf.h and Makefile must be in the same directory (it is always this way for all provided projects).

At some point I will update all makefiles to enable it as default.

Giovanni
User avatar
Giovanni
Site Admin
Posts: 14892
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: [INFO] Implemented "Smart Build" mode

Post by Giovanni »

All makefiles updated.

Giovanni
User avatar
barthess
Posts: 861
Joined: Wed Dec 08, 2010 7:55 pm
Been thanked: 7 times

Re: [INFO] Implemented "Smart Build" mode

Post by barthess »

Hi Giovanni.
I do not think it is a good idea.
1) *.mk became obscured.
2) now you actually have to maintain 2 versions (old and new) of *.mk files (even if it is single file).
3) speedup on real life projects is close to negligible because of lots of other source files.
Using ccache for speedup is much more effective (especially on *.cpp sources).

UPDATE:
"USE_SMART_BUILD=no" broken because DAC driver moved to its personal directory.
User avatar
Giovanni
Site Admin
Posts: 14892
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: [INFO] Implemented "Smart Build" mode

Post by Giovanni »

I don't understand, old .mk files work exactly as before.

Giovanni
User avatar
barthess
Posts: 861
Joined: Wed Dec 08, 2010 7:55 pm
Been thanked: 7 times

Re: [INFO] Implemented "Smart Build" mode

Post by barthess »

For example:
1) open testhal/STM32/STM32F0xx/ADC
2) set USE_SMART_BUILD = no
3) try to build it

My system throws following error "make: *** No rule to make target 'dac_lld.c', needed by 'build/obj/dac_lld.o'."
User avatar
Giovanni
Site Admin
Posts: 14892
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: [INFO] Implemented "Smart Build" mode

Post by Giovanni »

Ah understood, fixed, thanks.

Giovanni
enly1
Posts: 38
Joined: Wed Oct 09, 2013 10:21 pm

Re: [INFO] Implemented "Smart Build" mode

Post by enly1 »

Just as an aside, I see this showing up the new makefiles from my port to Chibios 3.x - it initially threw me when it broke my project.

I used to store the halconf.h, chconf.h etc in a config specific folder along with other project config files - took me a while to work out why my projects would no longer compile.

So given the option is present as a default now, would it be possible to update the chibios .mk files to allow a path to be specified (#define CHIBIOS_CONFIG_PATH) or something simliar so that we are not forced to move our files into a predefined structure, but still benefit from the optimised build ?

Thanks for your consideration

Simon
User avatar
Giovanni
Site Admin
Posts: 14892
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: [INFO] Implemented "Smart Build" mode

Post by Giovanni »

Hi,

I have to find a way that does not require changes in all Makefiles if possible, I will consider this.

Giovanni
scttnlsn
Posts: 3
Joined: Sat Jun 17, 2017 2:37 pm

Re: [INFO] Implemented "Smart Build" mode

Post by scttnlsn »

I'd like to use the "smart build" mode but is assumes that halconf.h, etc. are in the current working directory. Any way around this?
User avatar
Giovanni
Site Admin
Posts: 14892
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: [INFO] Implemented "Smart Build" mode

Post by Giovanni »

Hi,

The solution would be creating custom .mk files or adding yet another variable with a path and change all makefiles.

Giovanni
Post Reply