-I in makefiles


I’m using the OF github head, and trying to deal with the makefiles. If I need to include a library that have multiples subfolders like:


Should I complete the USER_CFLAGS variable with something like:

-I lib/include -I lib/other ...  

Or there are other forms to do it, with something like wildcards, regex?


haven’t tried with wildcards, but also never seen them being used in makefiles so i doubt it will work. anyway if you have a library with an include and some other directories probably you just need to put include in the search path and the others are source code.

and in most cases when a library has several dirs like:


you need to add only include to the search path and the rest of them are solved by including like

#include "util/whatever.h"  

a trick to add several things at the same time in makefiles is doing something like:

 $(addprefix $(shell ls -d libs/mylib/), -I libs/mylib/)