4 ms·
I wonder why you would want to learn "GNU make" in contrast to POSIX make when one of the advantages of make is that you have it on all unix systems.
by legulere 12y ago
I wonder why you would want to learn "GNU make" in contrast to POSIX make when one of the advantages of make is that you have it on all unix systems.
- pubby 12y agoWhat computers don't have access to GNU make? I don't see why you would give up all those extra features in order to be a tiny bit more portable.
- legulere 12y agoThe BSDs don't use GNU make (OS X interestingly does). You can also install other build systems, the advantage with posix make is that you don't have to on unix systems.
- jethro_tell 12y agoDoesn't BSD make also have it's own features that are not portable?
- swhipple 12y agoGNU make isn't part of the base system for the BSDs, but I've found that it is often installed on BSD systems anyways (as gmake), due to much software having a build dependency by using Makefiles with GNUisms. If your project is targeting a generic POSIX environment with build tools available and you want the portability, I can see why you might go with the lowest common denominator. For a lot of projects though, there are additional non-base dependencies (e.g. a python interpreter), and having a build dependency on GNU make is usually acceptable if you're using the extra features (e.g. % matching is a big convenience).
- e12e 12y agoConversely on a GNU system (like Debian GNU/Linux) you need to explicitly install BSD make... and on the *BSDs you have GNU in ports, and on windows you have it via MSYS/whatnot and on Solaris... etc. I suppose you don't have either on Android/CromeOS -- but the generally lack build tools anyway, as does iOS.
- mhd 12y agoReminds me of the days when we really needed to support old versions of AIX and HP-UX 9.x… So I guess in addition to not using GNU make, you'll have to be careful about your compiler supporting ANSI C, too.
- legulere 12y agoC99 support is part of current versions of posix.
- jethro_tell 12y agoWhich one is POSIX make? This is also lowest common denominator computing. If you work on a system or environment that will provide certain set of features why would you limit what you can do or learn based on what is possible for everyone? Should we also be limiting our belongings to the space of other peoples living conditions? Should I ride a mountain bike in the city because my road bike doesn't like rough terrain?
- legulere 12y agoIf you only want to target that system then it's fine to use every capability it offers. If you want to target more systems you have to either work with the lowest common denominator or write several times the same operating system specific code for each OS. GNU make is still make, which in my opinion has quite some warts. So for my view portability is the biggest reason why to use make. If you want to be portable and the features outlined in the posix standard aren't enough for you, you might as well use something else.
- jethro_tell 12y agoI'm confused which make is the POSIX one. I have bmake on my linux boxes to handle the BSDisms, because it has features that are useful and not POSIX. If you don't like gmake, I get it. But let's not pretend there's a commonly used make that only observes POSIX, I think the ones I've seen {b,g,n}make, makeapp and are mostly POSIX but non quite.
- legulere 12y agoThere is no POSIX make, POSIX is just a standard. What I mean is that you should only use features outlined in said standard. This allows you to use your makefiles on all makes that are POSIX conform. http://pubs.opengroup.org/onlinepubs/9699919799/utilities/make.html http://pubs.opengroup.org/onlinepubs/9699919799/utilities/ma...
- ploxiln 12y agoMany common fairly basic features are missing from POSIX make, like pattern rules and conditionals (if/ifeq/ifdef). Some were added just in the last year or two, like including possibly non-existing files. see http://www.dwheeler.com/essays/make.html http://www.dwheeler.com/essays/make.html GNU Make tends to be available on all systems, include OS X and the BSDs.
- emmelaich 12y agoGNU make is everywhere I need. If it isn't then porting GNU make is almost always the shorter path to getting something working.
- the_why_of_y 12y agoPOSIX make is so feature starved as to be nearly useless - it does not even have conditionals, and of course it lacks advanced features like $(eval) and target local variables. Since you can't write a non-trivial makefile without conditionals, restricting yourself to POSIX make will lead you down the path of despair of using something like GNU automake. OTOH, GNU make works even on Windows (with jobserver too!), so why bother with inferior alternative implementations.