tags:

views:

274

answers:

8

I'm lately feeling the need to learn a build tool. I'm looking through StackOverflow for recommendations and Gnu Make gets barely mentioned. Instead I see Ant, Maven, CMake, Scon and many others. However, when I look at the little "rogue sources" (as in not-in-the-repo) that I sometimes have to compile, they all require the make && make install steps.

Is learning Make a worse investment of my time than learning another tool?

If so why is Make still so popular?

+3  A: 

Make is popular because it's used (mainly) for C/C++ sources in Linux/*nix projects, and is far older than any of the other tools you've mentioned, thus it has stood the test of time and is mature. Kinda like tar.

To be honest with you, I only know make. Those other tools above may be better, but so many projects just use a basic Makefile that you're best off knowing at least a little bit of it. Not only for your own projects at work but most of the open-source ones you find on the net.

sheepsimulator
It is basic, self-contained (you don't need python, jre, php#.net with ruby bindings enterprise edition, whatever to run) , more or less language-neutral.
Michael Krelin - hacker
+1  A: 

It really depends how much you will use it.

If yoy work a lot with C/C++ make projects, then yes, I would recommend learning more about it as a large make file has a steeper learning curve than other build tools you mention.

If you don't work with make, or work in other languages such as C#, Java or PHP then you'd be better off learning build tools relevant to those languages.

Nosrama
A: 

Even if you end up preferring another build tool (personally I'm fond of VS... I know...) knowing make will probably prove more useful.

Make has many applications and whilst it is not always ideal for a single task, when dealing with new technologies it is stalwart and flexible.

Rushyo
+8  A: 

I think the reason you don't see (GNU) make mentioned is that it's often the default; if you have a GNU toolchain, you will have make already. Thus, most people that start talking about build tools, talk about something else.

In my experience, make is fine, but it can be kind of tricky to get it to do exactly what you want to. It's maybe slightly arcane, but it's proven and works.

unwind
A: 

Like all tools, if you use it at all, you should put some time into becoming reasonably adept at it. Also, some tools (like CMake, for example) generate makefiles and you may one day need to mess with those generated files.

GNU make has an excellent manual - it's certainly worth spendin an hour or two reading it.

anon
+11  A: 

Make is the standard build tool for everything C/C++. Many others have stepped to the plate, but even when they were useful and successful, they never achieved the ubiquity of make.

Make is installed on virtually every Unix-like machine out there. No matter if you're working with AIX, Solaris, Irix, BSD, or Linux, if there's a compiler installed, there's also make.

Some of the "replacements" (like Automake, CMake) even create Makefiles, which are in turn executed by make.

I would definitely recommend becoming familiar with make. If handled by someone who took the time to learn about make, it is a powerful tool, which can be used in a number of ways not even necessarily related to software development.

Even if you end up using a different build tool in the end, you will be able to "recycle" the lessons learned with make, as the underlying concepts are quite similar. And the sheer number of make-built projects means that there will always be the chance that you have to figure out an existing Makefile.

One thing, though. Get it right from the beginning.

DevSolar
A: 

I guess where you work is probably different, but I know that everywhere I've worked I would have been a far less valuable employee if I hadn't at least learned how to read Makefiles. Even in all Windows-VisualStudio environments, it comes up every now and then.

For instance, we just got a job that involves porting a bunch of old CX/UX code to Windows. The old code was built with makefiles. There's no way to understand their old system without knowing how to read those old makefiles.

T.E.D.
+1  A: 

Make is the de-facto standard on Linux systems for example. It is a very complex tool, and also a very powerful tool.

It is well suited to learn if you are developing C or C++, particularly if targeting Linux/*nix.

One of the features of make, is that you can set up dependencies for when to rebuild a file. E.g. each c or c++ file is build into an .obj file, and in the end, all .obj files are linked to an executable. But maybe the executable is a statically linked library, that is linked into another executable with other .obj files.

Make can make sure that you compilation time is as short as possible, because you can define that a c file should only be compiled if it, or any dependent header files, are newer that the .obj file. So any compilation or linking step is only executed if the current source files for the step is newer that the target file.

If you are developing in for example C#, you don't need this kind of dependency checking because all .cs files are compiled at once into a single executable.

So the conclusion is that you should use a build tool that is well suited for your choice of programming language.

Pete

related questions