summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHoracio Sanson <hsanson@gmail.com>2021-02-06 21:31:16 +0900
committerGitHub <noreply@github.com>2021-02-06 21:31:16 +0900
commitb88d3c4e4bcaedcf42872186a96f7c21975fc68e (patch)
treedcd7de7c6239c26053c38ab89033923fc5b830b8
parentcf53eb3667edddf5708114aa0e617403d5dcd75b (diff)
parentae916d49fd907592a73676fc1f570f75d67353d2 (diff)
downloadale-b88d3c4e4bcaedcf42872186a96f7c21975fc68e.zip
Merge pull request #3575 from hugomg/gnumakefile
Have c_parse_makefile look for GNUmakefile as well
-rw-r--r--autoload/ale/c.vim4
-rw-r--r--test/test_c_flag_parsing.vader8
-rw-r--r--test/test_c_projects/gnumakefile_project/GNUmakefile0
-rw-r--r--test/test_c_projects/gnumakefile_project/file.c0
4 files changed, 12 insertions, 0 deletions
diff --git a/autoload/ale/c.vim b/autoload/ale/c.vim
index c7b1e20a..946eeca4 100644
--- a/autoload/ale/c.vim
+++ b/autoload/ale/c.vim
@@ -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')
diff --git a/test/test_c_flag_parsing.vader b/test/test_c_flag_parsing.vader
index 8b02f2b9..319e10dd 100644
--- a/test/test_c_flag_parsing.vader
+++ b/test/test_c_flag_parsing.vader
@@ -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')
diff --git a/test/test_c_projects/gnumakefile_project/GNUmakefile b/test/test_c_projects/gnumakefile_project/GNUmakefile
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/test/test_c_projects/gnumakefile_project/GNUmakefile
diff --git a/test/test_c_projects/gnumakefile_project/file.c b/test/test_c_projects/gnumakefile_project/file.c
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/test/test_c_projects/gnumakefile_project/file.c