Getting Eclipse CDT to use relative include paths in generated Makefiles

The relative paths you add in "Project > Properties > C/C++ General > Paths and Symbols > Includes" tab are relative to your project folder.

The ones that appear in the generated makefiles are relative to the main Makefile location.


There is a better way to do this: "Project > Properties > C/C++ Build > Settings > Tool Settings > Cross G++ [or GCC] Compiler > Includes". Click plus button, then write:

"${ProjDirPath}/../../../somefolder1/somefolder2"

This approach allows you to specify any external folder by relative path to your project folder, even if it is located in parent subfolders.


If you use relative path in the 'include paths' (instead of ${workspace_loc}), then the makefile (and .mk files it uses) will include relative paths as well.