Specifying path to "makefile" using "make" command

You can use the -C flag to specify the path to your makefile. This way you can execute it from a different directory. The -f flag has a different use. With that flag you can execute a makefile with a name other than makefile.


All relative paths in the makefile will be relative to your current directory and not the directory of the makefile.

Assuming that you understand that and what you want to do is still going to work then you want the -f flag to specify the makefile to use. (Which is in the man page, the manual and the --help output.)

If, instead, what you mean is you want to cd to somewhere else and run make then perhaps you are looking for (cd /some/path && make)?

Tags:

Makefile