Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
352 views
in Technique[技术] by (71.8m points)

autotools - Automake generating binaries to bin/ instead of in src/

I searched for the answer to this question but couldn't find any good. Maybe they're old and something has changed, so I ask again.

I have a directory structure as:

my_project

  • src

  • bin

I want that, when I do make in the root dir, the binaries are put in ./bin, instead of cluttering ./src. But how?

EDIT: I am using C++. My Makefile.am has nothing special. Just the bin_PROGRAM and _SOURCES variables.

When I run make, the binaries generated are put into ./src. I simply want them in ./bin.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

You've got the wrong idea here.

Your build tree is wherever you run configure. That's how autoconf is designed to work. Users of your package (who do not want to clutter their source tree) will expect it to work this way.

This approach is a more general solution with a lot more flexibility than the organization you're imagining. For instance, it's not terribly unusual to want to maintain sources and build files on separate filesystems.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...