Page 1 of 2
[INFO] Implemented "Smart Build" mode
Posted: Fri May 08, 2015 3:06 pm
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
Re: [INFO] Implemented "Smart Build" mode
Posted: Tue May 12, 2015 10:21 am
by Giovanni
All makefiles updated.
Giovanni
Re: [INFO] Implemented "Smart Build" mode
Posted: Sun May 17, 2015 8:38 pm
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.
Re: [INFO] Implemented "Smart Build" mode
Posted: Sun May 17, 2015 9:24 pm
by Giovanni
I don't understand, old .mk files work exactly as before.
Giovanni
Re: [INFO] Implemented "Smart Build" mode
Posted: Mon May 18, 2015 8:09 am
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'."
Re: [INFO] Implemented "Smart Build" mode
Posted: Mon May 18, 2015 8:42 am
by Giovanni
Ah understood, fixed, thanks.
Giovanni
Re: [INFO] Implemented "Smart Build" mode
Posted: Sat Oct 17, 2015 8:29 pm
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
Re: [INFO] Implemented "Smart Build" mode
Posted: Mon Oct 19, 2015 4:44 pm
by Giovanni
Hi,
I have to find a way that does not require changes in all Makefiles if possible, I will consider this.
Giovanni
Re: [INFO] Implemented "Smart Build" mode
Posted: Sat Jun 17, 2017 2:51 pm
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?
Re: [INFO] Implemented "Smart Build" mode
Posted: Sat Jun 17, 2017 6:44 pm
by Giovanni
Hi,
The solution would be creating custom .mk files or adding yet another variable with a path and change all makefiles.
Giovanni