Skip to content

Commit 7698815

Browse files
committed
Move the pattern_clean rule out of the PAT=true block.
Make sure the `pattern_clean` rule is always defined, even when PAT is set to false. This is because that rule is explicitly called by the general `clean` rule. Of note, under PAT=false, `pattern_clean` can be called but it will not clean _all_ the pattern-derived files, because the variables defining the list of files to clean are themselves defined within the PAT block, and moving them out of the block would be too much of a hassle for little benefits. While we are at it, this commit also removes an obsolete comment about the prepending of `./` to prevent deleting files outside of the repository, and clears some superfluous whitespaces. closes #1176
1 parent 83263bf commit 7698815

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

template/src/ontology/Makefile.jinja2

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -804,22 +804,20 @@ endif
804804
# DOSDP Templates/Patterns
805805
# ----------------------------------------
806806

807-
ifeq ($(PAT),true)
808-
809807
ALL_PATTERN_FILES=$(wildcard $(PATTERNDIR)/dosdp-patterns/*.yaml)
810808
ALL_PATTERN_NAMES=$(strip $(patsubst %.yaml,%, $(notdir $(wildcard $(PATTERNDIR)/dosdp-patterns/*.yaml))))
811809

812810
PATTERN_CLEAN_FILES=../patterns/all_pattern_terms.txt \
813-
$(DOSDP_OWL_FILES_DEFAULT) $(DOSDP_TERM_FILES_DEFAULT) \{% if project.pattern_pipelines_group is defined %}
814-
{% for pipeline in project.pattern_pipelines_group.products -%}
815-
$(DOSDP_OWL_FILES_{{ pipeline.id.upper() }}) $(DOSDP_TERM_FILES_{{ pipeline.id.upper() }}) {% endfor %}{% endif %}
811+
$(DOSDP_OWL_FILES_DEFAULT) $(DOSDP_TERM_FILES_DEFAULT){% if project.pattern_pipelines_group is defined -%}
812+
{% for pipeline in project.pattern_pipelines_group.products %} \
813+
$(DOSDP_OWL_FILES_{{ pipeline.id.upper() }}) $(DOSDP_TERM_FILES_{{ pipeline.id.upper() }}){% endfor %}{% endif %}
816814

817-
# Note to future generations: prepending ./ is a safety measure to ensure that
818-
# the environment does not malicously set `PATTERN_CLEAN_FILES` to `\`.
819815
.PHONY: pattern_clean
820816
pattern_clean:
821817
rm -f $(PATTERN_CLEAN_FILES)
822818

819+
ifeq ($(PAT),true)
820+
823821
.PHONY: patterns
824822
patterns dosdp:
825823
echo "Validating all DOSDP templates"

0 commit comments

Comments
 (0)