Make include in makefiles be relative to the file's location

后端 未结 3 2043
旧巷少年郎
旧巷少年郎 2020-12-31 02:05

Directly related to this question. How can I make the include directive in makefiles behave relatively to the location of the current script?

Assume tha

3条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-12-31 02:30

    Is there a builtin variable with the current makefile's name?

    Yes, there is, use ${CURDIR}. This is the directory where top-level Makefile is located, so you don't need to strip anything from it.

    http://www.gnu.org/software/make/manual/make.html#Recursion

提交回复
热议问题