[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: 14457
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 1076 times
Been thanked: 922 times
Contact:

[INFO] Implemented "Smart Build" mode

Postby Giovanni » Fri May 08, 2015 3:06 pm

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: 14457
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 1076 times
Been thanked: 922 times
Contact:

Re: [INFO] Implemented "Smart Build" mode

Postby Giovanni » Tue May 12, 2015 10:21 am

All makefiles updated.

Giovanni

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

Re: [INFO] Implemented "Smart Build" mode

Postby barthess » Sun May 17, 2015 8:38 pm

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: 14457
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 1076 times
Been thanked: 922 times
Contact:

Re: [INFO] Implemented "Smart Build" mode

Postby Giovanni » Sun May 17, 2015 9:24 pm

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
Location: Minsk, Belarus
Been thanked: 7 times

Re: [INFO] Implemented "Smart Build" mode

Postby barthess » Mon May 18, 2015 8:09 am

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: 14457
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 1076 times
Been thanked: 922 times
Contact:

Re: [INFO] Implemented "Smart Build" mode

Postby Giovanni » Mon May 18, 2015 8:42 am

Ah understood, fixed, thanks.

Giovanni

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

Re: [INFO] Implemented "Smart Build" mode

Postby enly1 » Sat Oct 17, 2015 8:29 pm

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: 14457
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 1076 times
Been thanked: 922 times
Contact:

Re: [INFO] Implemented "Smart Build" mode

Postby Giovanni » Mon Oct 19, 2015 4:44 pm

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

Postby scttnlsn » Sat Jun 17, 2017 2:51 pm

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: 14457
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 1076 times
Been thanked: 922 times
Contact:

Re: [INFO] Implemented "Smart Build" mode

Postby Giovanni » Sat Jun 17, 2017 6:44 pm

Hi,

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

Giovanni


Return to “Development and Feedback”

Who is online

Users browsing this forum: No registered users and 27 guests