[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Prerequisites and .DEFAULT -- what am I doing wrong?
From: |
Ivan Shapovalov |
Subject: |
Prerequisites and .DEFAULT -- what am I doing wrong? |
Date: |
Tue, 07 Nov 2023 22:02:51 +0400 |
User-agent: |
Evolution 3.50.1 |
Consider a following Makefile (grossly simplified):
-- 8< --
.PHONY: dist deploy redist symstore-tarball
.DEFAULT dist deploy redist symstore-tarball:
@echo STARTED: $@
@sleep 10
@echo FINISHED: $@
.PHONY: default
default: all
.DEFAULT_GOAL := default
-- 8< --
The stubbed-out recipe in reality invokes another Makefile inside of a
container. This Makefile would be invoked as `make` or `make redist`,
in which case the inner Makefile is invoked asĀ
`podman run ... make all` or `podman run ... make redist`. Easy enough.
Now, let's say I patch this Makefile to build the container image prior
to executing that recipe:
-- 8< --
.PHONY: build-base-image
build-base-image:
@echo STARTED: build-base-image
@sleep 10
@echo FINISHED: build-base-image
.PHONY: dist deploy redist symstore-tarball
.DEFAULT dist deploy redist symstore-tarball: build-base-image
@echo STARTED: $@
@sleep 10
@echo FINISHED: $@
.PHONY: default
default: all
.DEFAULT_GOAL := default
-- 8< --
However, when I run `make` on this Makefile, the recipe for
`build-base-image` is not run, despite that it is specified as a
prerequisite for the `.DEFAULT` target:
-- 8< --
$ make
STARTED: all
FINISHED: all
-- 8< --
If I specify any explicitly named target (e. g. `make redist`), the
recipe for `build-base-image` is correctly executed prior to the main
recipe.
Why is that so?
(Please Cc: me in replies. I am not subscribed to the list. Thanks.)
--
Ivan Shapovalov / intelfx /
signature.asc
Description: This is a digitally signed message part
- Prerequisites and .DEFAULT -- what am I doing wrong?,
Ivan Shapovalov <=