开发者

GNU make scope of variable

I have some makefile:

$(PROGRAM_NAME): index.o
    @echo "linking"
    @echo $(index_o)
    //linking

export index_o:=.
index.o:
    $(MAKE) -C some_dir in开发者_开发知识库dex.o

at some_dir makefile

export index_o:=$(index_o)/index.o
index.o:
    @echo "compiling"
    @echo $(index_o)
    //compiling

output:

compiling ./index.o linking .

need output:

compiling ./index.o linking ./index.o

How to share changes of variable to the parent make thread? May be I need real global variable... I have read http://www.gnu.org/software/automake/manual/make/Recursion.html but not found


You can't push variable back to parent processes.

You may be interested in reading Recursive Make Considered Harmful. Short-short version: recursion isn't necessary for controlling large builds and causes trouble.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜