Question

I'm looking for a tool which can generate makefile for a C/C++ project for different compilers (gcc, microsoft vc++, borland etc) and different platforms (Win, Linux, Mac).

Was it helpful?

Solution

Other suggestions you may want to consider:

  • Scons is a cross-platform, cross-compiler build library, uses Python scruipting for the build systems. Used in a variety of large projects, and performs very well.

  • If you're using Qt, QMake is a nice build system too.

  • CMake is also pretty sweet.

  • Finally, If all else fails...

OTHER TIPS

Have you tried Automatic Makefile Generator?

It supports for the following compilers:

Borland 3.1 
Borland 5.0 
Borland 5.0, 16 bit 
Borland 5.5 
Borland 5.6 
Borland 5.8 
CC 
Gnu g++ 
Gnu g++, dynamic library 
Intel 5, 6, 7 for Linux 
Intel 5, 6, 7 for Linux, dynamic library 
Intel 5, 6, 7 for windows 
Intel 8,9,10 for Linux 
Intel 8,9,10 for Linux, dynamic library 
Intel 8,9 for windows 
Intel 10 for windows 
Visual C++ 5 
Visual C++ 6, 7, 7.1 
Visual C++ 8 
Open Watcom 
Watcom 10A 
Watcom 10A, 16 bit 

I've used Bakefile before with some success. It's fairly simple and seems to work well.

CMake is the only tool which can actually generate real Visual Studio projects (i.e. not "Makefile"-projects which call out to an external tool), and which automatically recreates the projects when the build input file (CMakeLists.txt) changes.

SCons performance issues are well-known and a thorougly debated topic on the SCons mailing lists.

I would vote for OMake. It fixes all complains I had with GNU make:

  • it's a full-blown language.
  • uses MD5 instead of timestamps.
  • provides a minimal shell which implements the most useful unix commands on all platforms: find, sed, awk, etc...
  • works with either unix or dos style pathnames.
  • extensively documented.
  • supports parallel builds.
  • fast.

Automatic generation of (M|m)akefiles makes me worry about what you're trying to do here.

Do you understand what goes on under the covers when you type make? Or gmake? I'm only asking because if you don't when things break, such as new code changes not being incorporated into the build, you'll have difficulties trying to work what has happened.

To start to understand make, can I suggest having a read of "Managing Projects with GNU Make" by Robert Mecklenberg. The early chapters cover how make is working. Getting your heard around the fact that make is backward chaining is one of the biggest things you can do.

If you don't, and your system appears to work, then you'll be, to use The Pragmatic Programmers' term, "programming by coincidence". (-:

BTW Great articles available at their site! And I'm not involved with them. YMMV. Yada-yada...

I'll also second CMake. I've been using it for quite a while on a multi-platform project and I'm very satisfied with it.

One issue to consider is do you want a "makefile" creator or a replacement build system? The problem with replacement build systems is that you typically don't get good IDE integration for platforms whose users expect this (Visual C++). If you do want a makefile creator instead of a replacement build system, take a look at MPC. It's free and open source.

A recent addition to the list of make replacements is waf. From personal experience SCONS does the job pretty well.

I do not know if you have interest on this question any more. I am working on a similar Makefile auto-generator projection called CodeMate, developed by using Ruby. Maybe it is not that mature for large application right now, but I will keep working on it to make it better. Users should not need to edit any configuration file to build the software, or at least it is supposed to be. The learning curve should be minimized.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top