Overriding mtb-shared includes

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Panometric
Level 5
Level 5
100 sign-ins 100 replies posted 10 solutions authored

We have been using the MTB flow to add driver libraries from vendors and OSS. This uses MTB make getlibs and git to bring the code in, with a version,  which is elegant. 

However, there is usually a case where you want to have a *.h file to customize the MTB, for example to redefine printf or malloc, or set some constants.   But the MTB start.mk file seems to work against us.  It prioritizes the mtb-shared version of the *.h file, rather than the project specific copy.  We can only make it work by deleting the mtb-shared version of the *.h, which is inelegant since these might be public repos.  

How can we force the MTB flow to prioritize our includes, over those in the mtb-shared directories  that are next to the *.c files being compiled? I expected that putting our dirs in makefile INCLUDES would do that, but they end up being last, not first. 

0 Likes
1 Solution
RodolfoGL
Employee
Employee
250 solutions authored 250 sign-ins 5 comments on KBA

You can use the directive CYIGNORE= in the makefile to add a path that you want the compiler to ignore.

View solution in original post

0 Likes
3 Replies
RodolfoGL
Employee
Employee
250 solutions authored 250 sign-ins 5 comments on KBA

You can use the directive CYIGNORE= in the makefile to add a path that you want the compiler to ignore.

0 Likes

@RodolfoGL How is this a solution? That will ignore the whole directory, not just one file that you need to override.  We need a way to change the search order to just prefer our code over the mtb code if it exists. 

0 Likes
RodolfoGL
Employee
Employee
250 solutions authored 250 sign-ins 5 comments on KBA

You can ignore only the files you want to overwrite. Don't need to set the whole directory.

0 Likes