Hi,

When I have a Makefile rule

target: $(DEPS1) $(DEPS2)
        command1

it is guaranteed that $(DEPS1) and $(DEPS2) will be done, including their
dependencies, before command1 is started.
However, with -j, $(DEPS1) and $(DEPS2) are being made in parallel. If this
is not desired, I can transform this rule to

target: $(DEPS1)
        test -z "$(DEPS2)" || $(MAKE) $(DEPS2)
        command1

or (equivalently?)

target: $(DEPS1)
        $(MAKE) target2
target2: $(DEPS2)
        command1
.PHONY: target2

The question is: Are these two rewrites really equivalent? If not, how
do they differ, and what is the best practice?

Bruno




Reply via email to