Earlier quoted context omitted.
Autotools does do all of those things. I'm not a particular fan of it either, but when I'm packaging software for a Linux distro then I'd rather see autotools or cmake being used instead of some crappy custom build system that will require patching to make it work. There is room for someone to come up with a good build system. It had better do everything autotools and cmake do, and be well documented and widely used,…
Auto tools is great. To compile all you do is ./configure make make install It couldn't be simpler. Even though I am part of the GitHub generation, I don't see why so many of my peers hate it. I actually like it.
A Simple Makefile for Medium-Sized C/C++ Projects
61–70 of 120 posts
Re: A Simple Makefile for Medium-Sized C/C++ Projects
#62Earlier quoted context omitted.
If you cut & paste the makefile in the blogpost, you’ll discover that the blog itself has converted the tabs in the makefile to spaces. Not very helpful to any confused newbies out there!
Yep, that's exactly what happened. Thanks for the explications. I actually did know that once, but forgot. Make definitely has its hidden traps.
Re: A Simple Makefile for Medium-Sized C/C++ Projects
#63Please don't brew your own build system. It likely won't handle at least one of the following situations: * installing into a DESTDIR * setting custom CFLAGS/LDFLAGS * changing prefix, libdir, sysconfdir * cross-compilation * parallel builds * conditional features * missing requirements and will make packaging your software in Linux distros much harder than it needs to be.
> setting custom CFLAGS/LDFLAGS
> changing prefix, libdir, sysconfdir
> cross-compilation
Pretty much all of this can be done trivially in a makefile, using a very innovative construct called "variables".
> parallel builds
make -j. Works especially well if you have working dependencies. This makefile does.
> conditional features
make has ifdef... Granted this makefile uses find to discover source files, which won't totally work. But it's a small fix. Or you can do conditional features through CFLAGS.
Re: A Simple Makefile for Medium-Sized C/C++ Projects
#64Earlier quoted context omitted.
There’s no point telling people not to do something if you don’t give them an alternative that does do all those things. (And no, “just use autotools” is not a viable answer.)
I'm surprised no one says, "Just use waf." It does all those things. It's fast. It's cross-platform. The language is Python. It's a bit steep to learn and maybe doesn't have the most mature built-in recipes for certain complex builds like mobile or desktop frameworks, but it seems like those things would be addressed quickly if more people were using it. The maintainer is a class act, consistently putting out new fea…
Re: A Simple Makefile for Medium-Sized C/C++ Projects
#65Earlier quoted context omitted.
Autotools does do all of those things. I'm not a particular fan of it either, but when I'm packaging software for a Linux distro then I'd rather see autotools or cmake being used instead of some crappy custom build system that will require patching to make it work. There is room for someone to come up with a good build system. It had better do everything autotools and cmake do, and be well documented and widely used,…
Auto tools is great. To compile all you do is ./configure make make install It couldn't be simpler. Even though I am part of the GitHub generation, I don't see why so many of my peers hate it. I actually like it.
Re: A Simple Makefile for Medium-Sized C/C++ Projects
#66Re: A Simple Makefile for Medium-Sized C/C++ Projects
#67Earlier quoted context omitted.
Supporting custom compilers and cross‐compilation is as simple as using ${CC} in the Makefile instead of gcc…
This is how we got into this mess in the first place. "Surely it can't be very difficult, let me just add this.."
Speaking as a packager, I have to patch many CMake build systems for portability issues. And don’t even get me started on SCons. Autotools is better in that regard, but has many flaws of its own.
Here’s an example of a portable Makefile I’ve contributed to a project which handles the common packaging issues (staging directories, cross‐compilation, parallel builds): https://github.com/sinamas/gambatte/pull/6/commits/8d6fffc2b...
Compared to the original build system (two SConstructs): https://github.com/sinamas/gambatte/blob/master/gambatte_sdl... https://github.com/sinamas/gambatte/blob/master/libgambatte/...
Re: A Simple Makefile for Medium-Sized C/C++ Projects
#68Earlier quoted context omitted.
I'm surprised no one says, "Just use waf." It does all those things. It's fast. It's cross-platform. The language is Python. It's a bit steep to learn and maybe doesn't have the most mature built-in recipes for certain complex builds like mobile or desktop frameworks, but it seems like those things would be addressed quickly if more people were using it. The maintainer is a class act, consistently putting out new fea…
WAF is not so much a build system, but a bunch of python scripts to create your own build system, it's in the same zoo as cmake, scons or premake, but (in my opion) worse than any of those. I might have had a bad first impression though because of the project I had to use WAF in had terribly complex WAF scripts.
swtoolkit made scons really nice to work with (but couldn't fix the speed issues). It's a shame it was abandoned. In the same way, a thin layer of functions as demonstrated in the waf "toolkit" examples could lean on the power of waf and provide a build system every bit as snazzy as big, polished systems like bazel and buck, but it would work cross-platform out of the box and be extensible with only Python. But I think waf is close enough to being high level that no one bothers to create and polish a build system layer (maybe internally in companies, but the open source uses I've seen use pretty standard waf scripts).
Re: A Simple Makefile for Medium-Sized C/C++ Projects
#69Please don't brew your own build system. It likely won't handle at least one of the following situations: * installing into a DESTDIR * setting custom CFLAGS/LDFLAGS * changing prefix, libdir, sysconfdir * cross-compilation * parallel builds * conditional features * missing requirements and will make packaging your software in Linux distros much harder than it needs to be.
> installing into a DESTDIR > setting custom CFLAGS/LDFLAGS > changing prefix, libdir, sysconfdir > cross-compilation Pretty much all of this can be done trivially in a makefile, using a very innovative construct called "variables". > parallel builds make -j. Works especially well if you have working dependencies. This makefile does. > conditional features make has ifdef... Granted this makefile uses find to discover…
Re: A Simple Makefile for Medium-Sized C/C++ Projects
#70C++ is not a bad language and I would like to write a project hat uses it. But I'm just a user of the language. I don't have time and expertise to tackle those build issues and quite frankly installing any library is a major PITA.