Cenoforums
March 6th, 2010, 08:51 PM
Hi,
I'm trying to do something for a while now but I can't see to tackle it very well.
I'm programming a PIC and I want to automatize this work flow:
-I write a program, compile it with :make and read the output from the compiler inside vim.
-If the program was compiled correctly, I then run a separate program called picload to load my compiled program into the pic. picload requires no input and only drops text to stdout, so I imagine it won't be a problem running it inside vim
So far I was able to change what make does like this
:set mp=make\ &\ rm\ xxx
Where xxx is a dummy file in my work directory so I could test the whole thing. I can see the output from rm in my vim window, which is good, but aparently rm is issued before make is finished compiling which is not good.
The trickier part is my if condition. If the compilation was successful, then run program, else don't run. I can test if the compilation was successful by grep'ing the output of make for a specific text line but I don't know if it's the best way to do this,
Any ideas?
I'm trying to do something for a while now but I can't see to tackle it very well.
I'm programming a PIC and I want to automatize this work flow:
-I write a program, compile it with :make and read the output from the compiler inside vim.
-If the program was compiled correctly, I then run a separate program called picload to load my compiled program into the pic. picload requires no input and only drops text to stdout, so I imagine it won't be a problem running it inside vim
So far I was able to change what make does like this
:set mp=make\ &\ rm\ xxx
Where xxx is a dummy file in my work directory so I could test the whole thing. I can see the output from rm in my vim window, which is good, but aparently rm is issued before make is finished compiling which is not good.
The trickier part is my if condition. If the compilation was successful, then run program, else don't run. I can test if the compilation was successful by grep'ing the output of make for a specific text line but I don't know if it's the best way to do this,
Any ideas?