Makefiles improvements

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
barthess
Posts: 861
Joined: Wed Dec 08, 2010 7:55 pm
Location: Minsk, Belarus
Been thanked: 7 times

Makefiles improvements

Postby barthess » Wed Jul 13, 2011 7:20 pm

Hi, Giovanni.
I have some idea about make system improvements.
It will be convenient to has "MAKE_ALL_RULE_HOOK" in rules.mk for simplification of adding user rules to Makefile.

For example I want to see how much rom and ram will use my program in MCU. Yes, I can investigate my ch.map and check size of ch.bin. But it will be better to get this info in console just after building. I write simple script and add

Code: Select all

MAKE_ALL_RULE_HOOK: ram

ram: $(PROJECT).map
   ./ram_usage.sh

strings to my project Makefile.

I can realize this feature and contribute patch if need.

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: Makefiles improvements

Postby Giovanni » Wed Jul 13, 2011 7:34 pm

OK, submit the patch, it does not look it can impact anything.

Giovanni

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

Re: Makefiles improvements

Postby barthess » Wed Jul 13, 2011 8:12 pm

patch here
Attachments
make_system.zip
(863 Bytes) Downloaded 303 times

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: Makefiles improvements

Postby Giovanni » Wed Jul 13, 2011 8:28 pm

I just updated the rules.mk files, there are way too many Makefile files to update.

Giovanni

mabl
Posts: 417
Joined: Tue Dec 21, 2010 10:19 am
Location: Karlsruhe, Germany
Been thanked: 1 time
Contact:

Re: Makefiles improvements

Postby mabl » Sat Aug 06, 2011 5:01 pm

barthess, Just curious, how does your ram check script look like?

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

Re: Makefiles improvements

Postby barthess » Sat Aug 06, 2011 5:31 pm

It is quick and dirty shell script.
Attachments
res_usage.zip
(562 Bytes) Downloaded 328 times

mabl
Posts: 417
Joined: Tue Dec 21, 2010 10:19 am
Location: Karlsruhe, Germany
Been thanked: 1 time
Contact:

Re: Makefiles improvements

Postby mabl » Sun Aug 07, 2011 7:34 am

Nontheless some great ideas, thank you barthess

marvin2k
Posts: 4
Joined: Tue Apr 14, 2015 2:16 pm

Re: Makefiles improvements

Postby marvin2k » Tue Apr 14, 2015 2:28 pm

Hi,

I need to create some extra targets (headers+libraries) prior to actually compiling the ChibiOS-based code. One hack I found to work is based on adding a `PRE_MAKE_ALL_RULE_HOOK`, similar to the (then renamed) `POST_MAKE_ALL_RULE_HOOK`.

Thoughts? Other ideas to achieve this? Any chances in getting something like the attached patch merged?

Edit: I created a ticket on source-forge. Sorry for the noise...

---

Attaching patch-files directly is not allowed, but adding them zipped is?
Attachments
archive.zip
(960 Bytes) Downloaded 229 times

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: Makefiles improvements

Postby Giovanni » Tue Apr 14, 2015 4:47 pm

I saw the tickets, thanks, I can forget things posted on the forum but not tickets.

Giovanni

LHelge
Posts: 15
Joined: Sun Sep 21, 2014 10:58 pm
Been thanked: 1 time

Re: Makefiles improvements

Postby LHelge » Thu Nov 24, 2016 8:51 am

Any example of how this is used? My makefile-fu is a little low at this time.

I want to run a python-script to generate some *.c and *.h files before compilation and the PRE_MAKE_ALL_RULE_HOOK seems lite the way to accomplish that without hacking anything other than the project makefile.


Return to “Development and Feedback”

Who is online

Users browsing this forum: No registered users and 26 guests