Skip to content

minphony checks if target is in .PHONY, not if it is defined #172

@obnoxxx

Description

@obnoxxx

This is related to issue #87 .

The minphony rule only checks whether the required names are in the .PHONY: list

But it does not check if these names are actually defined as targets.

Affected versions: current main and v0.2.2

Proof (with main) that .PHONYis sufficient:

$ cat test-minphony1.mk         
.PHONY: test clean all
$ ./checkmake ./test-minphony.mk 
$ echo $?
0

Proof (with main) that defined targets are not sufficient:

$cat ./test-minphony2.mk


all:
		@echo all

test:

@echo test

clean:

	@echo clean

$ ./checkmake ./test-minphony2.mk 
     RULE          DESCRIPTION           FILE NAME        LINE NUMBER 
 minphony       Missing required    ./test-minphony00.mk  0           
                phony target "all"                                    
 minphony       Missing required    ./test-minphony00.mk  0           
                phony target                                          
                "clean"                                               
 minphony       Missing required    ./test-minphony00.mk  0           
                phony target                                          
                "test"                                                
 phonydeclared  Target "test"       ./test-minphony00.mk  6           
                should be declared                                    
                PHONY.                                                
 phonydeclared  Target "clean"      ./test-minphony00.mk  10          
                should be declared                                    
                PHONY.                                                
Error: violations found (5)
$ echo $?
1
$ 

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions