I'm working on porting my projects from 20.3 to 21.11 and found the following surprising change in rules.mk (from ARMCMx/...../GCC)
< IINCDIR := $(patsubst %,-I%,$(INCDIR) $(DINCDIR) $(UINCDIR))
> IINCDIR := $(sort $(patsubst %,-I%,$(INCDIR) $(DINCDIR) $(UINCDIR)))
Not sure why a decision was made to sort the user includes, but order matters in complex builds.
Geoffrey
Surprised by change in rules.mk
Moderators: RoccoMarco, lbednarz, tfAteba
-
geoffrey.brown
- Posts: 122
- Joined: Thu May 07, 2015 9:47 pm
- Has thanked: 3 times
- Been thanked: 18 times
- Giovanni
- Site Admin
- Posts: 14891
- Joined: Wed May 27, 2009 8:48 am
- Has thanked: 1202 times
- Been thanked: 996 times
Re: Surprised by change in rules.mk
Hi,
It is done to remove duplicate paths, some .mk files add the same paths to shared modules.
This can be a problem only if you have colliding file names in your paths, which should be avoided if possible.
Giovanni
It is done to remove duplicate paths, some .mk files add the same paths to shared modules.
This can be a problem only if you have colliding file names in your paths, which should be avoided if possible.
Giovanni
-
geoffrey.brown
- Posts: 122
- Joined: Thu May 07, 2015 9:47 pm
- Has thanked: 3 times
- Been thanked: 18 times
Re: Surprised by change in rules.mk
I guess my use situation is unusual. I have a whole collection of related devices (data loggers for songbirds) and I do sometimes need to override include files in my common source code and I have had, on occasion, to tweak include files from the chibios directories. In the short run, I tweaked the the rules file, but I guess in the long run I'll have to track down and eliminate the problem cases.
-
geoffrey.brown
- Posts: 122
- Joined: Thu May 07, 2015 9:47 pm
- Has thanked: 3 times
- Been thanked: 18 times
Re: Surprised by change in rules.mk
I've thought about this a bit more, is there a compelling reason to sort UINC with all the other includes. As it stands, there is no way to override an existing include file.
- Giovanni
- Site Admin
- Posts: 14891
- Joined: Wed May 27, 2009 8:48 am
- Has thanked: 1202 times
- Been thanked: 996 times
Re: Surprised by change in rules.mk
Hi,
You could simply bring rules.mk in your project and tweak it, it is just an inclusion in your makefile, not something that can break later anyway.
Giovanni
You could simply bring rules.mk in your project and tweak it, it is just an inclusion in your makefile, not something that can break later anyway.
Giovanni