<p>I'm looking for a tool which can generate a <a href="https://en.wikipedia.org/wiki/Make_(software)#Makefile" rel="nofollow noreferrer">Makefile</a> for a C/C++ project for different compilers (<a href="https://en.wikipedia.org/wiki/GNU_Compiler_Collection" rel="nofollow noreferrer">GCC</a>, <a href="https://en.wikipedia.org/wiki/Microsoft_Visual_C%2B%2B" rel="nofollow noreferrer">Microsoft Visual C++</a>, <a href="https://en.wikipedia.org/wiki/C%2B%2BBuilder" rel="nofollow noreferrer">C++Builder</a>, etc.) and different platforms (Windows, Linux, and Mac).</p>

[{'answer_id': 9590, 'author': 'prakash', 'author_id': 123, 'author_profile': 'https://Stackoverflow.com/users/123', 'pm_score': 3, 'selected': False, 'text': '<p>Try <a href="http://www.robertnz.net/genmake.htm#Details" rel="nofollow noreferrer">Automatic Makefile Generator</a>.</p>\n<p>It has support for the following compilers:</p>\n<ul>\n<li>Borland 3.1</li>\n<li>Borland 5.0</li>\n<li>Borland 5.0, 16 bit</li>\n<li>Borland 5.5</li>\n<li>Borland 5.6</li>\n<li>Borland 5.8</li>\n<li>CC</li>\n<li>GNU g++</li>\n<li>GNU g++, dynamic library</li>\n<li>Intel 5, 6, 7 for Linux</li>\n<li>Intel 5, 6, 7 for Linux, dynamic library</li>\n<li>Intel 5, 6, 7 for Windows</li>\n<li>Intel 8,9,10 for Linux</li>\n<li>Intel 8,9,10 for Linux, dynamic library</li>\n<li>Intel 8,9 for Windows</li>\n<li>Intel 10 for Windows</li>\n<li>Visual C++ 5</li>\n<li>Visual C++ 6, 7, 7.1</li>\n<li>Visual C++ 8</li>\n<li>Open Watcom</li>\n<li>Watcom 10A</li>\n<li>Watcom 10A, 16 bit</li>\n</ul>\n'}, {'answer_id': 12064, 'author': 'Thomi', 'author_id': 1304, 'author_profile': 'https://Stackoverflow.com/users/1304', 'pm_score': 6, 'selected': True, 'text': '<p>Other suggestions you may want to consider:</p>\n<ul>\n<li><p><a href="http://www.scons.org/" rel="nofollow noreferrer">Scons</a> is a cross-platform, cross-compiler build library, uses Python scripting for the build systems. Used in a variety of large projects, and performs very well.</p>\n</li>\n<li><p>If you\'re using <a href="https://en.wikipedia.org/wiki/Qt_%28software%29" rel="nofollow noreferrer">Qt</a>, <a href="https://doc.qt.io/qt-5/qmake-manual.html" rel="nofollow noreferrer">QMake</a> is a nice build system too.</p>\n</li>\n<li><p><a href="https://cmake.org/" rel="nofollow noreferrer">CMake</a> is also pretty sweet.</p>\n</li>\n<li><p>Finally, <a href="http://www.google.co.uk/search?q=cross+platform+build+system" rel="nofollow noreferrer">if all else fails...</a></p>\n</li>\n</ul>\n'}, {'answer_id': 18766, 'author': 'grosauro', 'author_id': 1582, 'author_profile': 'https://Stackoverflow.com/users/1582', 'pm_score': 1, 'selected': False, 'text': "<p>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.</p>\n"}, {'answer_id': 23831, 'author': 'Adam Mitz', 'author_id': 2574, 'author_profile': 'https://Stackoverflow.com/users/2574', 'pm_score': 0, 'selected': False, 'text': '<p>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++).\nIf you do want a makefile creator instead of a replacement build system, take a look at <a href="http://ociweb.com/products/mpc" rel="nofollow noreferrer">MPC</a>.  It\'s free and open source.</p>\n'}, {'answer_id': 29672, 'author': 'Imbue', 'author_id': 3175, 'author_profile': 'https://Stackoverflow.com/users/3175', 'pm_score': 2, 'selected': False, 'text': '<p>I\'ve used <a href="http://www.bakefile.org/index.html" rel="nofollow noreferrer">Bakefile</a> before with some success. It\'s fairly simple and seems to work well.</p>\n'}, {'answer_id': 29794, 'author': 'Rob Wells', 'author_id': 2974, 'author_profile': 'https://Stackoverflow.com/users/2974', 'pm_score': 1, 'selected': False, 'text': '<p>Automatic generation of (M|m)akefiles makes me worry about what you\'re trying to do here.</p>\n\n<p>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.</p>\n\n<p>To start to understand make, can I suggest having a read of "<a href="https://rads.stackoverflow.com/amzn/click/com/0596006101" rel="nofollow noreferrer" rel="nofollow noreferrer">Managing Projects with GNU Make</a>" 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.</p>\n\n<p>If you don\'t, and your system appears to work, then you\'ll be, to use The Pragmatic Programmers\' term, "<a href="http://www.pragprog.com/the-pragmatic-programmer/extracts/coincidence" rel="nofollow noreferrer">programming by coincidence</a>". (-:</p>\n\n<p>BTW Great articles available at their site! And I\'m not involved with them. YMMV. Yada-yada...</p>\n'}, {'answer_id': 87527, 'author': 'JesperE', 'author_id': 13051, 'author_profile': 'https://Stackoverflow.com/users/13051', 'pm_score': 2, 'selected': False, 'text': '<p><a href="https://en.wikipedia.org/wiki/CMake" rel="nofollow noreferrer">CMake</a> is the only tool which can actually generate real <a href="https://en.wikipedia.org/wiki/Microsoft_Visual_Studio" rel="nofollow noreferrer">Visual\xa0Studio</a> projects (i.e., not &quot;Makefile&quot;-projects which call out to an external tool), and which automatically recreates the projects when the build input file (<a href="https://cmake.org/cmake/help/latest/manual/cmake-language.7.html#organization" rel="nofollow noreferrer">CMakeLists.txt</a>) changes.</p>\n<p><a href="https://en.wikipedia.org/wiki/SCons" rel="nofollow noreferrer">SCons</a> performance issues are well-known and a thoroughly debated topic on the SCons mailing lists.</p>\n'}, {'answer_id': 230614, 'author': 'bltxd', 'author_id': 11892, 'author_profile': 'https://Stackoverflow.com/users/11892', 'pm_score': 2, 'selected': False, 'text': '<p>I would vote for <a href="http://omake.metaprl.org" rel="nofollow noreferrer">OMake</a>. It fixes all complains I had with GNU make:</p>\n<ul>\n<li>it\'s a full-blown language.</li>\n<li>uses <a href="https://en.wikipedia.org/wiki/MD5" rel="nofollow noreferrer">MD5</a> instead of timestamps.</li>\n<li>provides a minimal shell which implements the most useful Unix commands on all platforms: <a href="https://en.wikipedia.org/wiki/Find_(Unix)" rel="nofollow noreferrer">find</a>, <a href="https://en.wikipedia.org/wiki/Sed" rel="nofollow noreferrer">sed</a>, <a href="https://en.wikipedia.org/wiki/AWK" rel="nofollow noreferrer">AWK</a>, etc.</li>\n<li>works with either Unix or <a href="https://en.wikipedia.org/wiki/DOS" rel="nofollow noreferrer">DOS</a> style pathnames.</li>\n<li>extensively documented.</li>\n<li>supports parallel builds.</li>\n<li>fast.</li>\n</ul>\n'}, {'answer_id': 7102571, 'author': 'Gabi Davar', 'author_id': 39962, 'author_profile': 'https://Stackoverflow.com/users/39962', 'pm_score': 0, 'selected': False, 'text': '<p>A recent addition to the list of make replacements is <a href="http://code.google.com/p/waf/" rel="nofollow noreferrer">waf</a>. From personal experience, SCons does the job pretty well.</p>\n'}, {'answer_id': 9005474, 'author': 'Li Dong', 'author_id': 1004941, 'author_profile': 'https://Stackoverflow.com/users/1004941', 'pm_score': 0, 'selected': False, 'text': '<p>I am working on a similar Makefile auto-generator projection called <a href="http://dongli.github.com/CodeMate" rel="nofollow noreferrer">CodeMate</a>, developed by using Ruby. Maybe it is not that mature for large applications right now, but I will keep working on it to make it better.</p>\n<p>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.</p>\n'}]
['https://Stackoverflow.com/questions/9589', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1007/']