Search code examples
eclipsemakefileeclipse-cdt

Getting Eclipse CDT to use relative include paths in generated Makefiles


I am using the Eclipse CDT. I have configured the "external Builder" and I am generating the Makefiles automatically. Unfortunately, the generated Makefiles contain the absolute include path. I would like to use the generated Makefiles on other systems (where Eclipse is not installed) - is there a way to make Eclipse use relative paths into the Makefile?

I have configured my projects include directory under Settings -> Tool Settings -> GCC C Compiler -> Include Paths using ${workspace_log}.


Solution

  • 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.