How to call Makefile located in other directory?

前端 未结 1 842
猫巷女王i
猫巷女王i 2021-02-12 23:37

I am trying to do this:

I want to call a make (Makefile exists in some other directory, abc path can be used) from a shell script located in a

1条回答
  •  [愿得一人]
    2021-02-12 23:49

    GNU make accepts many options, notably -C to change directory before running, and -f for giving the Makefile to follow.

    Combine them appropriately.

    Consider using remake to ease debugging (notably with -x) of Makefile related issues. With GNU make version 4 or better, also use make --trace...

    You could have your own executable shell script (e.g. in your $HOME/bin/ which would be in your $PATH) which uses both cd and make).

    You could consider other build automation tools (ninja perhaps)

    Read also P.Miller's paper Recursive Make considered harmful

    0 讨论(0)
提交回复
热议问题