gvim :make command does not work


I am under a Unix environment, working in C++. I'm opening gvim from a directory in which a makefile called "Makefile" exists. When I try to use ":make" from within vim, I get:

shell returned 2 (1 of 1): make: *** No targets specified and no makefile found. Stop.

8/31/2009 3:51:59 PM

Accepted Answer

Can you check the following options?

:set shell?
:set shelltype?

Finally, check the contents of your shell login file. For example, if your shell is bash, check ~/.bashrc. Does this file contain something like the following?

cd ~


cd /home/${USERNAME}

where ${USERNAME} is (obviously) your username.

8/31/2009 3:57:02 PM

Do you have autochdir enabled? That may change to another directory.

Check with :pwd to see if the current directory is what you expect.

Try running :!ls to see if the Makefile exists.

Licensed under: CC-BY-SA with attribution
Not affiliated with: Stack Overflow