forcing order of prerequisites in Makefiles

前端 未结 2 1263
走了就别回头了
走了就别回头了 2021-01-04 06:23

I have a third party makefile, and I\'d like one of the targets (T1) to not be built until another, custom target (T2) is built first. Normally, this would be accomplished

相关标签:
2条回答
  • 2021-01-04 06:48

    Could you just call Make in your build script with the two targets in the proper order, e.g.

    make T2 T1
    

    That way you don't need to make any modifications to T1.

    0 讨论(0)
  • 2021-01-04 06:49

    Have T2 as an order-only prerequisite:

    T1: x y z | T2
        $(MAKE) -j $^;
        # Make will run the T2 rule before this one, but T2 will not appear in $^
    
    0 讨论(0)
提交回复
热议问题