Best Make System

Hi

I do a lot of programming in C++ on the windows platform, and I do a lot of Java on the UNIX platform. Now I want to start writing and porting some enterprise applications to the UNIX platform in C++, and I am stuck between what build system to choose. Many times, it will real simple - make, automake, ant, maven...

what do you think is the best?

I post here because I started reading a tutorial on automake... and the author says "I hate automake and autotools". Then I got used to using ant at work, then my manager loves maven. So now I use maven again... i joke and say Stockholm Syndrome took over.

So I just wonder, what do you think? What should I use? A simple makefile?
closed account (S6k9GNh0)
I personally have been using tup. http://gittup.org/tup/
A very simple syntax that's easy to learn and just does what you want. Meant for one-command builds and/or projects with large directories. Can be used for practically whatever though. For example, it's incredibly simple getting it to work with flex/bison or any other tools you wish to use.

EDIT: You can see an example use of tup in my repo: http://github.com/computerquip/qpNetwork
Last edited on
TBH use cmake. I've been doing professional multi-platform development for 10 years and it's the best you'll find. It's also very easy to setup and run and your build scripts can be configured to work on multiple platforms too.

Bonus is that it integrates with many modern build scheduling tools (e.g Jenkins)
closed account (D4S8vCM9)
For C++ I prefer the GNU autotools, because they "grow" with the projects needs.
Whenever I start a new project I just setup the directory structure and write the standard main.cpp and run autoscan over it.

With the time I can gradually change the build system to the current needs. My current projects has an quite impressive build system based on automake now, but it grew generic.

For existing projects, I can imagine it can be the hell to create an appropriate build system based on autotools.

For Java projects, either ant or maven are the choice number one. Maven I would prefer for projects with lost of dependencies which change quite often or need to get versioned. Otherwise the good old ant is doing quite well.

Autotools is far the most wrong choice for Java projects, even if you start with it.
@Velnias75 You don't want a tool that "grows" with the project. You want a tool that you can essentially set up once and then forget about it.

CMake configuration files can auto-scan directories for files and assign them to different builds.
e.g I have 3 lines that will separate my .cpp files into UnitTest or standard and build different binaries for them.
I can immediately throw a front-end autobuilder using Jenkins etc. I know that in the future the amount of configuration I'm going to have to do to my build system as my projects grow is next to nothing.
closed account (D4S8vCM9)
@Zaita That really depends on the project. Of course it is a nice to have faeture just to set it up and to forget, but if you need very fine granulated configurations for either different Unices or an full automated MingW build I can only imagine a run and go system will be overbloated from the beginning.
I heard a lot of positive about CMake and surely I will look at it once too, but for the moment I swore on the flexibility of the autotools and really the time I spend on it is actually minimal. Actually I need a change on it only sometimes, but the impact is great.

Recently a friends main PC, a Linux box had a hardware failure and she got only a Windows laptop as fallback. Just that time I needed her opinion on my project and I had to do a Windows build. The code base allowed it, because my project is to 99 % percent independent of the OS. It took me around 5 Minutes to adapt autotools to a full Windows build. More time I had to spend to find compatible Windows libraries of the few external dependencies I have. (GnuWin32 http://gnuwin32.sourceforge.net/ was a great help, since it had all dependencies prebuilt)
CMake is compiler and OS independent :) That is why we use it on 500k line professional projects and smaller personal projects.
Nice sell Zaita, you got me interested.

I have 3 lines that will separate my .cpp files into UnitTest or standard and build different binaries for them.
What are they?

BTW, I hate autotools, what a pain, it's just one of those challenges we have to put up with. And It only solves a problem created by GNU.
closed account (S6k9GNh0)
The only thing I don't like about Cmake is that it relies on other build systems. To some extent, I would just prefer a configure script with some other build system (not necessarily make) than use Cmake since that's one less tool required to build my project. Although, Cmake is now becoming really popular so it's not much of a hassle to acquire Cmake... plus it provides a sane way of Library Pathing on Windows which is difficult.
Last edited on
I guess the 3 lines are a trade secret.
@kbw

1
2
3
4
5
6
# This snippet of code will find all of our source and test files
# and auto-populate variables with them for the build
FILE(GLOB_RECURSE sourceFiles RELATIVE ${CMAKE_HOME_DIRECTORY} source/*.cpp)
FILE(GLOB_RECURSE testFiles RELATIVE ${CMAKE_HOME_DIRECTORY} source/*.Test.cpp)
# Remove the test files from the source files list
list(REMOVE_ITEM sourceFiles ${testFiles}) */
Thanks.
Topic archived. No new replies allowed.