I want to make something like this:
let &makerpg = '[ -f Makefile] && make || cd build && [ -f Makefile ] && make || cd ../build && [ -f Makefile ] && make || echo "Error"'
My goal is to make make
to work in any place if it is within this kind of tree:
/Proyect-root
/src
/build
/include
Edit: Actually I already have a pretty similar map:
nnoremap <silent><F4> :wa<bar>cd ../build<bar>make<cr><cr>:cd -<cr>:echo 'Done'<cr>
It's quite simple but obviously it doesn't work if I am in the root of my project.
makeprg
tocd {thebuilddir} && make $*
– Luc Hermitte Mar 22 '20 at 19:09