From 2c984966b965bddf47be4992a5d24519dc5defdd Mon Sep 17 00:00:00 2001 From: Steven Myint Date: Tue, 28 Jan 2014 19:51:51 -0800 Subject: [PATCH] Add syntax checker for makefiles --- syntax_checkers/make/make.vim | 37 +++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 syntax_checkers/make/make.vim diff --git a/syntax_checkers/make/make.vim b/syntax_checkers/make/make.vim new file mode 100644 index 00000000..24660162 --- /dev/null +++ b/syntax_checkers/make/make.vim @@ -0,0 +1,37 @@ +"============================================================================ +"File: make.vim +"Description: Syntax checking plugin for makefiles. +"Maintainer: Steven Myint +" +"============================================================================ + +if exists("g:loaded_syntastic_make_make_checker") + finish +endif +let g:loaded_syntastic_make_make_checker = 1 + +let s:save_cpo = &cpo +set cpo&vim + +function! SyntaxCheckers_make_make_GetLocList() dict + let makeprg = self.makeprgBuild({ + \ 'args': '--dry-run --file'}) + + let errorformat = '%f:%l: %m' + + let loclist = SyntasticMake({ + \ 'makeprg': makeprg, + \ 'errorformat': errorformat, + \ 'returns': [0, 2]}) + + return loclist +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'make', + \ 'name': 'make'}) + +let &cpo = s:save_cpo +unlet s:save_cpo + +" vim: set et sts=4 sw=4: