Can we include another makefile in the GNU makefile using a relative path?

I have a Makefile in:

project/all_app/myapp/src/Makefile 

I also have Depend.mk's master

 project/Depend.mk 

Is it possible to include the main Makefile using a relative path?

 include ../../../../Depend.mk 
+6
gnu makefile
source share
2 answers

Be warned that make include starts with pwd and not along the path to the Makefile. (so make -f is likely to cause problems)

+8
source share

The inclusion rules in make are a bit complicated - see this section of the GNU manual. But yes - you can do what you asked.

+5
source share

All Articles