Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I wanted to get your thoughts. I see build systems like scons, make, jam, ants, autotools.

Why do they exist? are they something like cross platform 'project files'? Do they address another need? to me .NET has almost a standard project file (xbuild on mono can build some of my projects created by msvc)

I seen makefile's in each directory and sub-directory. In your opinion is this 'wrong'? My gut says if they are a 'project' file that allows you to pass in a few parameters for a complete build it should all be in one place (even if its multiple files).

More importantly why do all of these tools exist?

share|improve this question

closed as too broad by Ixrec, Snowman, MichaelT, durron597, GlenH7 Sep 2 '15 at 17:34

There are either too many possible answers, or good answers would be too long for this format. Please add details to narrow the answer set or to isolate an issue that can be answered in a few paragraphs.If this question can be reworded to fit the rules in the help center, please edit the question.

The biggest problem that those tools try to solve is the issue of portability.

Every platform, be it Linux, Windows, Mac, or whatever, has different tools available for building a given project. When you're dealing with C and C++, build processes can get fairly complex, especially for large projects. A few other languages have similar complexities.

Very often, it's hard to track all of the changes in the project and keep a build script up-to-date, so another job these tools perform is dependency resolution: One module might depend on another group of modules having been built, or it might depend on files that may have changed since the last rebuild. These build tools address that by keeping track of all of that for you.

They also manage build differences and configurations: A build switch given to your build tool can be used to select which modules are built, how, and with what libraries. Usually, the build tool itself enables making these kinds of decisions on a high level without forcing you to write all of the low-level requirements.

But not all build tools are made equal. Some of them are more appropriate for one group of languages and wholly inappropriate for another. .NET project files are just fine for .NET projects and Visual Studio, but they're totally inappropriate for building C and C++ on other platforms.

To address your other question about makefiles: there's some debate on the topic. Peter Miller is convinced it's a bad practice, but many other developers seem to disagree. Personally, I have no stake in it - I just let my build tool of choice (CMake) take care of it.

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.