checkmake icon indicating copy to clipboard operation
checkmake copied to clipboard

Support make check (the GNU conventions)

Open rurban opened this issue 2 years ago • 2 comments

Expected behaviour

Instead of warning a missing .PHONY test, check if a check target exists instead.

Actual behaviour

With GNU Makefiles it warns about a missing make test target. minphony Missing required phony target 1222
"test"

Output of checkmake --version

checkmake 0.2.1 built at 2022-08-15T10:00:27Z by Reinhard Urban [email protected] with go version go1.18.1 linux/amd64

Output of checkmake --debug <your makefile>

...
      RULE                 DESCRIPTION             LINE NUMBER  
                                                                
  maxbodylength   Target body for "Makefile"               578  
                  exceeds allowed length of 5                   
                  (8).                                          
  maxbodylength   Target body for "distcheck"              988  
                  exceeds allowed length of 5                   
                  (57).                                         
  maxbodylength   Target body for                         1046  
                  "distcleancheck" exceeds                      
                  allowed length of 5 (8).                      
  maxbodylength   Target body for "unknown"               1230  
                  exceeds allowed length of 5                   
                  (14).                                         
  minphony        Missing required phony target           1222  
                  "clean"                                       
  minphony        Missing required phony target           1222  
                  "test"                                        
  phonydeclared   Target "tags" should be                  711  
                  declared PHONY.                               
  phonydeclared   Target "ctags" should be                 742  
                  declared PHONY.                               
  phonydeclared   Target "cscopelist" should be            761  
                  declared PHONY.                               
  phonydeclared   Target "installdirs" should be          1060  
                  declared PHONY.                               
  phonydeclared   Target "uninstall" should be            1070  
                  declared PHONY.                               
  phonydeclared   Target "installcheck" should            1075  
                  be declared PHONY.                            
  phonydeclared   Target "clean" should be                1121  
                  declared PHONY.                               
  phonydeclared   Target "dvi" should be                  1131  
                  declared PHONY.                               
  phonydeclared   Target "html" should be                 1135  
                  declared PHONY.                               
  phonydeclared   Target "info" should be                 1139  
                  declared PHONY.                               
  phonydeclared   Target "mostlyclean" should be          1178  
                  declared PHONY.                               
  phonydeclared   Target "pdf" should be                  1182  
                  declared PHONY.                               
  phonydeclared   Target "ps" should be declared          1186  
                  PHONY.                                        

Output of make --version

GNU Make 4.3

Sample Makefile to reproduce issue

Any autotools generated GNU Makefile

(some of these things might not apply but the more you can provide the easier it will be to fix this bug. Thanks!)

rurban avatar Aug 15 '22 10:08 rurban

This not only happens on autotools Makefiles, but as far as I can see on any file that does not have .test under .PHONY

For example this Makefile also generates the warning:

.PHONY: all

all:
    printf "Hello\n"

The error goes away if you add the targets to PHONY, even if they do not exist:

.PHONY: all test clean

all:
    printf "Hello\n"

crazybolillo avatar Feb 06 '23 05:02 crazybolillo

dup of #15 I think (bugs #86 and #87 are also related, as is PR #88)

cooljeanius avatar Nov 15 '23 22:11 cooljeanius