Skip to content

empty implicit/pattern rule syntax different behavior between newline and semicolon  #17

@bulk88

Description

@bulk88

This is part of my effort to implement a rule cancel feature (see https://www.gnu.org/software/make/manual/html_node/Canceling-Rules.html ) in dmake to speed up perl world building by trimming irrelevant extensions from being stat()ed/executed CPU overhead for them like for fortran and pascal languages. My knowledge of the make language is very poor so there might be bad mistakes in the rest of this post.

%.obj : %.pas


produces

#====================================
# Dump of inference graph


%.obj : %.c 
    $(CC) $(CFLAGS) -c $<

%.obj : %.pas 
    $(PC) $(PFLAGS) -c $<

%.obj : %.asm 
    $(AS) $(ASFLAGS) $(<:s,/,\)

with warning

dmake:  newline:  line 3:  Warning: -- Empty recipe for special or meta target %.obj

while

%.obj : %.pas;

produces

#====================================
# Dump of inference graph


%.obj : %.c 
    $(CC) $(CFLAGS) -c $<

%.obj : %.pas 


%.obj : %.asm 
    $(AS) $(ASFLAGS) $(<:s,/,\)

with no warning.

Shouldn't these 2 statements be identical in make lang syntax? notice if the "dmake: newline: line 3: Warning: -- Empty recipe for special or meta target %.obj" warning fires, the already existing rule is left unmodified.

To implement the rule cancelling feature, I need to know what part of the dmake lang to change, since these are 2 different code paths ATM. Do these 2 code paths need to be unified into 1 code path? or do i implement the rule canceller only for the semicolon syntax, not newline+tab+newline syntax? and is the "issue warning and discard new definition, and keep old one" the correct behavior, or should the behavior for both be "dont issue a warning, accept the new definition"?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions