Skip to content

Commit ffe99e4

Browse files
committed
Makefile: Fix templates/{_default,_images} handling
This change prevents the creation of `_output/share/lima/templates/{_default/_default,_images/_images}` directories during the second make session. - Add those directories to `MKDIR_TARRGETS` for applying directory creation rules. - Add `TEMPLATE_DEFAULTS` and `TEMPLATE_IMAGES` variables for files in those directories. - Add those files to the dependencies of the `templates` target. - Add rules for those files to depend on their directories. Signed-off-by: Norio Nomura <norio.nomura@gmail.com>
1 parent 85e0c77 commit ffe99e4

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

Makefile

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -380,16 +380,20 @@ MKDIR_TARGETS += _output/share/lima
380380
################################################################################
381381
# _output/share/lima/templates
382382
TEMPLATES = $(addprefix _output/share/lima/templates/,$(filter-out experimental,$(notdir $(wildcard templates/*))))
383+
TEMPLATE_DEFAULTS = ${addprefix _output/share/lima/templates/_default/,$(notdir $(wildcard templates/_default/*))}
384+
TEMPLATE_IMAGES = $(addprefix _output/share/lima/templates/_images/,$(notdir $(wildcard templates/_images/*)))
383385
TEMPLATE_EXPERIMENTALS = $(addprefix _output/share/lima/templates/experimental/,$(notdir $(wildcard templates/experimental/*)))
384386

385387
.PHONY: default_template templates template_experimentals
386388
default_template: _output/share/lima/templates/default.yaml
387-
templates: $(TEMPLATES)
389+
templates: $(TEMPLATES) $(TEMPLATE_DEFAULTS) $(TEMPLATE_IMAGES)
388390
template_experimentals: $(TEMPLATE_EXPERIMENTALS)
389391

390392
$(TEMPLATES): | _output/share/lima/templates
393+
$(TEMPLATE_DEFAULTS): | _output/share/lima/templates/_default
394+
$(TEMPLATE_IMAGES): | _output/share/lima/templates/_images
391395
$(TEMPLATE_EXPERIMENTALS): | _output/share/lima/templates/experimental
392-
MKDIR_TARGETS += _output/share/lima/templates _output/share/lima/templates/experimental
396+
MKDIR_TARGETS += _output/share/lima/templates _output/share/lima/templates/_default _output/share/lima/templates/_images _output/share/lima/templates/experimental
393397

394398
_output/share/lima/templates/%: templates/%
395399
cp -aL $< $@

0 commit comments

Comments
 (0)