mirror of
https://github.com/dense-analysis/ale.git
synced 2025-12-07 05:04:28 +08:00
Merge pull request #3575 from hugomg/gnumakefile
Have c_parse_makefile look for GNUmakefile as well
This commit is contained in:
@@ -506,6 +506,10 @@ function! ale#c#GetMakeCommand(buffer) abort
|
||||
if s:CanParseMakefile(a:buffer)
|
||||
let l:path = ale#path#FindNearestFile(a:buffer, 'Makefile')
|
||||
|
||||
if empty(l:path)
|
||||
let l:path = ale#path#FindNearestFile(a:buffer, 'GNUmakefile')
|
||||
endif
|
||||
|
||||
if !empty(l:path)
|
||||
let l:always_make = ale#Var(a:buffer, 'c_always_make')
|
||||
|
||||
|
||||
@@ -38,6 +38,14 @@ Execute(The make command should be correct):
|
||||
\ . 'make -n',
|
||||
\ ale#c#GetMakeCommand(bufnr(''))
|
||||
|
||||
Execute(Should recognize GNUmakefile as a makefile):
|
||||
call ale#test#SetFilename('test_c_projects/gnumakefile_project/file.c')
|
||||
|
||||
AssertEqual
|
||||
\ ale#path#CdString(ale#path#Simplify(g:dir. '/test_c_projects/gnumakefile_project'))
|
||||
\ . 'make -n --always-make',
|
||||
\ ale#c#GetMakeCommand(bufnr(''))
|
||||
|
||||
Execute(The CFlags parser should be able to parse include directives):
|
||||
call ale#test#SetFilename('test_c_projects/makefile_project/subdir/file.c')
|
||||
|
||||
|
||||
0
test/test_c_projects/gnumakefile_project/file.c
Normal file
0
test/test_c_projects/gnumakefile_project/file.c
Normal file
Reference in New Issue
Block a user