[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: order-only prerequisites don't behave as I'd have expected after rea
From: |
Philip Guenther |
Subject: |
Re: order-only prerequisites don't behave as I'd have expected after reading the documentation |
Date: |
Mon, 11 Jun 2012 17:06:53 -0700 |
On Mon, Jun 11, 2012 at 12:53 PM, Stefano Lattarini
<address@hidden> wrote:
...
> I was hoping to be able to the order-only prerequisites to enforce ordering
> between .PHONY targets. At this point, I guess I should state the problem
> I am trying to solve rather than just the attempts I've made at solving it.
>
> Is there an easy, scalable way to specify in a GNUmakefile that, whenever
> two given targets T1 and T2 (either phony or not) are to be updated, T1's
> recipe must be executed before T2's, all without declaring any dependency
> of T2 on T1? So that for example, assuming T1 and T2 are both phony:
>
> $ make T1 # Only run T1's recipe
> $ make T1 # Only run T2's recipe
(I think you meant "make T2" there...)
> $ make T2 T1 # Run T1's recipe, then T2's recipe
> $ make -j8 T2 T1 # Again, run T1's recipe, then T2's recipe
I think I would use a test on $(MAKECMDGOALS) to make T1 a
prerequisite of T2 if and only if T1 is a goal, say...
ifneq ($(filter T1,${MAKECMDGOALS}),)
T2: T1
endif
Philip Guenther
Re: order-only prerequisites don't behave as I'd have expected after reading the documentation, Paul Smith, 2012/06/12