Skip to content

Commit

Permalink
Makefile rebuild on changes to env templates
Browse files Browse the repository at this point in the history
Signed-off-by: Luiz Carvalho <[email protected]>
  • Loading branch information
lcarva committed Sep 14, 2023
1 parent a181528 commit 46676ed
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ _default: all
DATA_JSON=src/data.json

POLICY_TEMPLATE=src/policy.yaml.tmpl
POLICY_RHTAP_TEMPLATE='src/policy-rhtap.yaml.tmpl'
POLICY_GITHUB_TEMPLATE='src/policy-github.yaml.tmpl'
POLICY_RHTAP_TEMPLATE=src/policy-rhtap.yaml.tmpl
POLICY_GITHUB_TEMPLATE=src/policy-github.yaml.tmpl

ifndef GOMPLATE
GOMPLATE=gomplate
endif

%/policy.yaml: $(POLICY_TEMPLATE) $(DATA_JSON) Makefile
%/policy.yaml: $(POLICY_TEMPLATE) $(DATA_JSON) $(POLICY_RHTAP_TEMPLATE) $(POLICY_GITHUB_TEMPLATE) Makefile
@mkdir -p $(*)
@env NAME=$(*) $(GOMPLATE) -d data=$(DATA_JSON) --file $< \
-t rhtap=$(POLICY_RHTAP_TEMPLATE) -t github=$(POLICY_GITHUB_TEMPLATE) \
Expand All @@ -25,7 +25,7 @@ README_RHTAP_TEMPLATE=src/README-rhtap.md.tmpl
README_GITHUB_TEMPLATE=src/README-github.md.tmpl
README_FILE=README.md

$(README_FILE): $(README_TEMPLATE) $(DATA_JSON) Makefile
$(README_FILE): $(README_TEMPLATE) $(DATA_JSON) $(README_RHTAP_TEMPLATE) $(README_GITHUB_TEMPLATE) Makefile
@$(GOMPLATE) -d data=$(DATA_JSON) --file $< \
-t rhtap=$(README_RHTAP_TEMPLATE) -t github=$(README_GITHUB_TEMPLATE) \
> $@
Expand Down

0 comments on commit 46676ed

Please sign in to comment.