View previous topic :: View next topic |
Author |
Message |
mercurator Tux's lil' helper
Joined: 09 Aug 2004 Posts: 92 Location: Slovenia
|
Posted: Tue Aug 17, 2004 11:24 am Post subject: Using "make" with VIM |
|
|
Hi, I'm trying out the VIM ( gvim ) and I'm having some problems with the make command. I get the following error:
Code: |
:!make 2>&1 tee /tmp/v766424/3
make: *** No targets specified and no makefile found. Stop. |
Here's what it did; I've created a folder and written a .c source file and a Makefile to go allong. As it seems VIM does not know where to look for the makefile. So how do I specify that location?
Bye, _________________ "Ignorantia non est Argumentum" - Benedict de Spinoza |
|
Back to top |
|
|
jwj Apprentice
Joined: 07 May 2004 Posts: 240
|
Posted: Tue Aug 17, 2004 11:55 am Post subject: |
|
|
You could try the option
Code: |
" automatically change to the directory of the edited file
set autochdir
|
in your ~/.vimrc. |
|
Back to top |
|
|
jwj Apprentice
Joined: 07 May 2004 Posts: 240
|
Posted: Tue Aug 17, 2004 12:01 pm Post subject: |
|
|
If the Makefile lies in a upper directory of the file you are editing I have this function in my ~/.vimrc to make:
Code: |
map <F4> :call FindMakefile()<cr>
function! FindMakefile ()
exec "cd " . expand ("%:p:h")
while ! filereadable (getcwd () . "/Makefile") && getcwd () != "/"
cd ..
endwhile
cd .
make
endfunction
|
|
|
Back to top |
|
|
|