Skip to content

Change clean to a double colon rule? #1284

@ptgolden

Description

@ptgolden

The templated Makefile, of course, contains a .PHONY clean target:

.PHONY: clean
clean:{% if project.use_dosdps %}
$(MAKE) pattern_clean{%- endif %}
for dir in $(MIRRORDIR) $(TMPDIR) $(UPDATEREPODIR) ; do \
reldir=$$(realpath --relative-to=$$(pwd) $$dir) ; \
case $$reldir in .*|"") ;; *) rm -rf $$reldir/* ;; esac \
done
rm -f $(CLEANFILES)

I've run into a case where that clean target is overridden in {{ project.id }}.Makefile, where a custom clean target was desired. This results in the original clean target being overwritten:

zp.Makefile:216: warning: overriding recipe for target 'clean'
Makefile:1023: warning: ignoring old recipe for target 'clean'

If the rules were defined with double colon syntax (clean::), it would be possible to run both without worrying about overrides.

(The same could possibly apply to help, if someone wanted to document additional key commands).

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions