From cbdf32454fa3ea883a39bd176066f9874dad4886 Mon Sep 17 00:00:00 2001 From: Patrick Golden Date: Tue, 13 Jan 2026 13:52:40 -0500 Subject: [PATCH] Change `clean` to a double-colon rule This commit changes `clean` to a double-colon to allow local project Makefiles to also define a `clean` rule without overriding the top-level one. A stub for a double-colon `clean` rule is placed into the project Makefile as well. See Addresses --- src/incatools/odk/templates/_dynamic_files.jinja2 | 4 ++++ src/incatools/odk/templates/src/ontology/Makefile.jinja2 | 5 ++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/incatools/odk/templates/_dynamic_files.jinja2 b/src/incatools/odk/templates/_dynamic_files.jinja2 index 07e3e9a..ee8ce69 100644 --- a/src/incatools/odk/templates/_dynamic_files.jinja2 +++ b/src/incatools/odk/templates/_dynamic_files.jinja2 @@ -191,6 +191,10 @@ Datatype: rdf:PlainLiteral imports/%_import.owl: mirror/%.owl echo "ERROR: You have configured your default module type to be custom; this behavior needs to be overwritten in {{ project.id }}.Makefile!" && touch $@ {% endif -%} + +.PHONY: clean +clean:: + # Add any custom cleaning logic here. {% if project.import_group.use_base_merging -%} {# diff --git a/src/incatools/odk/templates/src/ontology/Makefile.jinja2 b/src/incatools/odk/templates/src/ontology/Makefile.jinja2 index 8b16aee..13b3fe2 100644 --- a/src/incatools/odk/templates/src/ontology/Makefile.jinja2 +++ b/src/incatools/odk/templates/src/ontology/Makefile.jinja2 @@ -1585,8 +1585,11 @@ update_docs: # current directory is a way to ensure we only clean up directories that # are located below the current directory, regardless of the contents of # the *DIR variables. +# +# This is a double-colon rule to allow another clean target to be defined +# in {{ project.id }}.Makefile without overriding this one. .PHONY: clean -clean:{% if project.use_dosdps %} +clean::{% if project.use_dosdps %} $(MAKE) pattern_clean{%- endif %} for dir in $(MIRRORDIR) $(TMPDIR) $(UPDATEREPODIR) ; do \ reldir=$$(realpath --relative-to=$$(pwd) $$dir) ; \