On Mon, Jun 11, 2012 at 12:53 PM, Stefano Lattarini <stefano.lattar...@gmail.com> 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 _______________________________________________ Bug-make mailing list Bug-make@gnu.org https://lists.gnu.org/mailman/listinfo/bug-make