# Why i cannot build nginx outside the source directory?

**URL:** <https://www.ruby-forum.com/t/why-i-cannot-build-nginx-outside-the-source-directory/210936>\
**Category:** NGINX\
**Created:** [August 21, 2011, 12:04pm UTC](https://www.ruby-forum.com/t/why-i-cannot-build-nginx-outside-the-source-directory/210936 "2011-08-21T12:04:28Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![dubstep](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/cdc98d/32.png) [@dubstep](https://www.ruby-forum.com/u/dubstep)\
**Post date:** [August 21, 2011, 12:04pm UTC](https://www.ruby-forum.com/t/why-i-cannot-build-nginx-outside-the-source-directory/210936/1 "2011-08-21T12:04:28Z")

</div>

for example build and nginx\_src are under the same directory, i can  
build nginx in build directory, with …/nginx\_src/configure then the  
files generated in the build process will not pollute the source  
directory of nginx, i tried this, but failed, anyone who knows what’s  
the problem?  
thank you:)

---

<div class="post-metadata">

**Author:** ![smith\_jack](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/51bf81/32.png) [@smith\_jack](https://www.ruby-forum.com/u/smith_jack)\
**Post date:** [August 21, 2011, 12:18pm UTC](https://www.ruby-forum.com/t/why-i-cannot-build-nginx-outside-the-source-directory/210936/2 "2011-08-21T12:18:05Z")

</div>

On Sun, Aug 21, 2011 at 06:04:02PM +0800, smith jack wrote:

> for example build and nginx\_src are under the same directory, i can  
> build nginx in build directory, with ../nginx\_src/configure then the  
> files generated in the build process will not pollute the source  
> directory of nginx, i tried this, but failed, anyone who knows what’s  
> the problem?  
> thank you:)

I do not quite understand your question, but try

./configure --build-dir=/path/to/build/dir …  
make

–  
Igor S.
