Catch up on stories from the past week (and beyond) at the Slashdot story archive

 



Forgot your password?
typodupeerror
GNU is Not Unix Open Source Programming Software Upgrades News

GNU Make 4.0 Released 179

jones_supa writes "A new major version of the classic GNU Make software has been released. First of all, Make 4.0 has integration support for GNU Guile Scheme. Guile is the extension system of the GNU project that is a Scheme programming language implementation and now in the Make world will be the embedded extension language. 4.0 also features a new 'output-sync' option, 'trace-enables' for tracing of targets, a 'none' flag for the 'debug' argument, and the 'job server' and .ONESHELL features are now supported under Windows. There are also new assignment operators, a new function for writing to files, and other enhancements. It's been reported that Make 4.0 also has more than 80 bug-fixes. More details can be found from their release announcement on the mailing list."
This discussion has been archived. No new comments can be posted.

GNU Make 4.0 Released

Comments Filter:
  • by rodrigoandrade ( 713371 ) on Wednesday October 09, 2013 @02:14PM (#45084207)
    I myself prefer GNU Ryu and GNU Ken, but a lot of people seem to do well with GNU Chun Li.
  • Me gusta! (Score:5, Informative)

    by serviscope_minor ( 664417 ) on Wednesday October 09, 2013 @02:22PM (#45084295) Journal

    This looks good.

    The --trace option is really nice. For some reason people think it is prettier to have makefiles not print put the compile lines. It is, of course, until it breaks.

    Make is one of those widely misunderstood tools. Despite being far simpler than, e.g. C it seems to be understood much worse. It's also sad that it diverged long ago, but it's good to see GNU trying to make it compatible with the divergent BSD and POSIX variants too.

    One Make to rule them all! While it seems fashionable not to use the GNU tools these days (for instance distros using less featureful and now slower AWKs than gawk by default), GNU Make is truly the superior one. It is very featureful and an excellent part of a build system.

  • by Anonymous Coward on Wednesday October 09, 2013 @02:23PM (#45084303)

    Have the developers made a statement concerning backward compatibility with makefiles developed for GNU make 3.80 (or 3.76, etc)?

  • by steveha ( 103154 ) on Wednesday October 09, 2013 @02:24PM (#45084313) Homepage

    There is a lot I don't like about Make, including GNU Make. The extensions it has received over the years make it incredibly baroque. I can't work on nontrivial makefiles without keeping a copy of the reference manual open to look things up, and the magic differences between tabs and spaces mean I need syntax highlighting to make sure I know what my makefiles really will do.

    So now GUILE integration. How many Slashdot users are big fans of the Scheme language? I appreciate the elegance but I don't want to work in it, and I don't look forward to trying to debug makefiles that make heavy use of it.

    I'm not sure what to use to replace Make though. I'm a Python guy so I would probably want Scons or something like that, but Ruby fans probably want Rake, Java fans probably want Ant, and in general I don't think there is any consensus on what might be the best replacement for Make.

    • by serviscope_minor ( 664417 ) on Wednesday October 09, 2013 @02:33PM (#45084429) Journal

      and the magic differences between tabs and spaces mean I need syntax highlighting to make sure I know what my makefiles really will do

      Just like python!

      Actually, GNU Make has got pretty good in this regard and usually does the correct thing if you use the wrong kind of indent.

      • by ebno-10db ( 1459097 ) on Wednesday October 09, 2013 @02:56PM (#45084657)

        Just like python!

        The right thing to do is just ban the use of the @%#^! tab character. You can't do that w/ make, but you can with just about everything else. I once wrote a pre-checkin validation script for a VC system, and it would reject any file (of the appropriate source types) that contained a tab.

      • by steveha ( 103154 ) on Wednesday October 09, 2013 @03:03PM (#45084755) Homepage

        Just like python!

        Actually, no.

        Python lets you use spaces or tabs, and will do pretty much the right thing. You can sometimes get into trouble if you mix spaces and tabs.

        If you have multiple lines and they are indented identically, they are a block. It's easy to indent identically if you use nothing but spaces; still easy if you use nothing but tabs. (If you indent with a mix of tabs and spaces, and use the identical indent on each line, it will still work but this is very non-recommended. If you indent two lines such that they visually line up, but they have spaces and tabs in a non-identical configuration, it won't work right... but Python will raise an exception and warn you.)

        Recommended practice in the Python community is just to use spaces for indenting. Everyone's editor agrees on how that would work. Most editors have an option to use spaces automatically even if you hit a tab when indenting a line.

        The white space situation in Python is not perfect, but you really cannot say that Python has a syntactic distinction between tabs and spaces like Make does.

        Actually, GNU Make has got pretty good in this regard and usually does the correct thing if you use the wrong kind of indent.

        This has not been my experience, but perhaps you are right. I have been using vim with syntax highlighting, and every time I use spaces instead of a tab, the highlighting reveals my mistake and I fix it, so I haven't screwed this up in a while.

        If the tabs vs spaces thing was the only issue with Make, I could live with it (just as I can live with Python's handling of white space). The baroque syntax bothers me much more.

    • by Samantha Wright ( 1324923 ) on Wednesday October 09, 2013 @02:34PM (#45084445) Homepage Journal
      Well put. I haven't had the displeasure of working with huge makefiles personally, and I am quite fond of the Lisp language family, but it doesn't make sense to me to put it into a build system, and the tab magic thing is slightly Turing tarpit worthy [dur.ac.uk]. Maybe it's time for a classic fork of 3.x?
      • by serviscope_minor ( 664417 ) on Wednesday October 09, 2013 @04:43PM (#45086035) Journal

        and I am quite fond of the Lisp language family, but it doesn't make sense to me to put it into a build system,

        Ignoring the de/merits of LISP, why not? If you want the build system to be programmable, it's better to embed a "proper" language than to keep kludging Make so that it does become a turing tarpit.

        • by Samantha Wright ( 1324923 ) on Wednesday October 09, 2013 @04:58PM (#45086231) Homepage Journal
          Actually I'm more militant—I think embedding a language is still pretty kludgy. I'd opt for writing a new language that replaces the whole Make syntax, rather than $(encrusting everything). (But I'm not really a fan of the syntax of shell scripting, so admittedly I'm a bit biased.)
          • by serviscope_minor ( 664417 ) on Thursday October 10, 2013 @03:43AM (#45089225) Journal

            Actually I'm more militantâ"I think embedding a language is still pretty kludgy. I'd opt for writing a new language that replaces the whole Make syntax, rather than $(encrusting everything). (But I'm not really a fan of the syntax of shell scripting, so admittedly I'm a bit biased.)

            I see your point, but I'm not convinced I agree or disagree.

            There's an annoying tradeoff between such things. Shell syntax is certainly horrible for programming. Partly it's because it's clearly an aggregation of features. Partly it's because of the way data strings are the primary entity, not sane syntactic tokens. That leads naturally to whitespace in data being a pain. Thing is though for a lot of stuff, especially short scripts and one liners where you get to control the environment, it's short, simple and easy. Just not scalable.

            It's a better UI than a language.

            I *think* the tradeoff is worth it.

            Make "suffers" the same thing in that it's designed to throw stuff at the shell. It's a bit more sane in that things mostly aggregate only inside $() rather than with every new possible combination of bracketing characters and worse in the shell.

            Again not sure. For many things Make is quite easy. Many of my makefiles are only 4 lines long (augment CXXFLAGS, augment LDFLAGS, target:lost of objects, linker line).

            Also, most of what you need to do in building is the same. Fundementally, Make is a language for expressing lines and nodes in a DAG. Assuming you treat building in the same way, a new language would eiher have to have a new DSL for expressing that data and then a whole new language to go along to make it programmable, or be written in something with decent enough support for an EDSL. The choice is:

            1. New DSL with turing completeness available.
            2. DSL with embedded "proper" language.
            3. EDSL inside existing language.

            It's not clear to me which is the best by any means.

        • by account_deleted ( 4530225 ) on Wednesday October 09, 2013 @08:35PM (#45087713)
          Comment removed based on user account deletion
    • by wiredlogic ( 135348 ) on Wednesday October 09, 2013 @02:36PM (#45084473)

      Considering all the extensions to standard make it would be nice if they'd relax the tab requirement so writing makefiles is more convenient.

    • by Anonymous Coward on Wednesday October 09, 2013 @02:39PM (#45084491)

      Java fans probably want Ant

      Not bloody likely. Gradle kicks Ant's ass by about a bazillion times. Even Maven is better than Ant, even if the XML used to define artifact construction is terribly named and terribly complex.

    • by ebno-10db ( 1459097 ) on Wednesday October 09, 2013 @02:53PM (#45084619)

      No matter what you do to it, Make is an antiquated pig. No offense to the GNU folks, who generally make the best versions of the traditional *nix utilities, and yes, you do need to keep Make around for backwards compatibility, yada, yada, yada.

      What's really needed is a ground up re-think of how to create a build utility. A number of folks have tried it. I used to use SCons [scons.org], and before that it's Perl based predecessor, Cons. The reason I'm not using them now has nothing to do with the software, which I though was excellent. The project lead's idea of alpha is what some people call final release.

      I suspect the biggest problem to a widely used Make alternative is the sheer variety of options out there. Nevertheless, what are other people's experiences with build utilities other than Make?

      • by serviscope_minor ( 664417 ) on Wednesday October 09, 2013 @04:48PM (#45086107) Journal

        How do those non-make utilities compare? Why are they better? Is it syntax or do they do something more sophisticated than representing the dependency chain as a DAG? Or better integration with other tools?

        • by gmueckl ( 950314 ) on Wednesday October 09, 2013 @06:21PM (#45086823)

          I have tried SCons and cmake as replacements for Makefiles and I'm pretty happy with cmake. Both tools are better than make in that they have more insight in what you're trying to accomplish and end up doing the right thing in many cases. You certainly don't have to spell out every command explicitly like you have to do with Makefiles.

          SCons gives you a lot of programmer's freedom by handing you a whole Python interpreter to work with. That can be cool in some situations, the downside for me is that you have to come up with all the code that configures the build by yourself. The big plus with SCons is that it knows what to do with about any kind of file that can be compiled without having to tell it how to invoke the corresponding compiler.

          cmake on the other hand brings a lot of tools that let you spell out the configuration of the build in terms of user-set variables in a very straight-forward manner and it also has. It doesn't run the build, but can generate build scripts or project definition for a lot of environments and IDEs. I find it to be very easy to write cmake scripts that compile moderately complex builds with lots of dependencies on multiple platforms, where each user has his/her dependencies layout it in a different fashion from everyone else.

      • by account_deleted ( 4530225 ) on Wednesday October 09, 2013 @09:27PM (#45087925)
        Comment removed based on user account deletion
    • by Phillip2 ( 203612 ) on Wednesday October 09, 2013 @03:06PM (#45084799)

      Ant? Seriously, you have to be kidding!

      The bottom line is that there is no replacement for Make; it still does what it was designed for very well. I use it when ever I have lots of small files with unix commands to convert them; python normally shows up there as well.

      But make sucks for Java, hence ant, and then maven. And I use leiningen for Clojure. I'm not sure having one build tool per language is a great situation, but there you have it. But make fills its niche and it will be there in quite a few years time.

      • by ebno-10db ( 1459097 ) on Wednesday October 09, 2013 @03:33PM (#45085163)

        Try SCons [scons.org]. It blows the doors off of Make, and once you get the hang of it, is much simpler to use. It's also written in Python, and you write the "build files" (equivalent to make files) in Python. Real honest-to-goodness Python, not just some restricted kind-of-like Python stuff.

        • by JanneM ( 7445 ) on Wednesday October 09, 2013 @05:17PM (#45086375) Homepage

          ..which is nice until you sit on a system without Python (go to big compute clusters and things like Python are suddenly scarce). Make is completely standalone; and the Autotoools look the way they do because, again, you can run them with minimal external dependencies.

          As I heard it told, the reason Make (and Autotools) is the default despite all the suck is because all proposed alternatives suck more once you leave their original use-case.

          • by ebno-10db ( 1459097 ) on Wednesday October 09, 2013 @07:05PM (#45087153)

            nice until you sit on a system without Python (go to big compute clusters and things like Python are suddenly scarce)

            I'll take your word for it about Python being scarce on such systems, but why? Installing Python is no big deal. If you can install autotools, etc., you can install Python.

            As I heard it told, the reason Make (and Autotools) is the default despite all the suck is because all proposed alternatives suck more once you leave their original use-case.

            You may have heard it told, but I've tried it, and I disagree. What do you mean by "leave their original use-case"?

            • by JanneM ( 7445 ) on Wednesday October 09, 2013 @08:05PM (#45087583) Homepage

              Installing Python is no big deal.

              ..is no big deal on things that look and act much like an X86 workstation. On big machines you frequently need to cross compile; the compiler/assembler/linker suite is not GCC or closely compatible; the system libraries are intended to be compatible these days but are separate implementations with their own quirks; and the environment is geared toward specific use so you lack many libs that are taken for granted in all-round systems.

              I have installed Python on such a machine. It was a big deal and nothing I would ever attempt just to get a make-like utility working. It would be far less work to replace that utility with Make than to get Python onto the machine.

              You may have heard it told, but I've tried it, and I disagree. What do you mean by "leave their original use-case"?

              Sorry; I get a bit abridged at times. What I meant is that Make alternatives normally are born from a specific need. A group wants to build Java programs (for example) and come up with a tool that works better than Make for that.

              But then it almost invariably (so far) turns out that the tool that works great for the original use case is lacking features, or lack flexibility, or has dependencies that make it unsuitable for very different kind of projects. Make-replacements that really are general enough to fully replace it are no easier to learn and use than Make itself. It seems for all its cruft and oddities, Make does seem to represent a floor in the complexity needed to support all the different situations you may encounter.

              I have tried a number of alternatives over the years because I was frustrated with Autotools (which, rather than Make itself, is what people often really complain about). Finally, for one project I bit the bullet, got myself a book and really learned Autotools properly. And found out it's not bad at all, just unintuitive until you get a good explanation. There is some cruft there of course; but many oddities are due to the portable nature of the tools, and others are simply conventions that modern languages don't follow - they're not wrong, just different.

              If you really want to replace make I suspect the best replacement would be - Make. That is, define an optional "new Make" mode that is not backwards compatible, with cleaned up syntax and parsing rules; the surface stuff that people get annoyed by.

    • by spike_gran ( 219938 ) on Wednesday October 09, 2013 @03:24PM (#45085017)

      In the mailing lists, the maintainer of Make implied that the Guile integration was put there essentially as a hedge. People would ask for extensions to Make that he didn't want to commit to, so now the Guile is there so that people can extend make their own way.

      I would imaging that the Guile stuff would be valuable to do complicated pattern substitutions than Make can easily handle. It is trivial in GNU Make to convert a variable containing a list of *.c files to a list of *.o files, etc. But something more complicated of that nature is where a Guile extension would come in.

    • by SkOink ( 212592 ) on Wednesday October 09, 2013 @03:55PM (#45085519) Homepage

      I'm not sure what to use to replace Make though. I'm a Python guy so I would probably want Scons or something like that, but Ruby fans probably want Rake, Java fans probably want Ant, and in general I don't think there is any consensus on what might be the best replacement for Make

      I went back and forth on different Pythonic build tools for awhile. Scons is pretty great if you're doing 'standard' sorts of builds, but I found it a little heavy for my tastes and really hard to customize to my tool flow (in FPGA land, there are all kinds of nonstandard vendor tools that all need to play together).

      I've been using doit more and more over the past few months, and I'm continually impressed by the tool (aside from the goofy name). It works amazingly well for automating tricky/exotic build processes.

      Check it out! http://pydoit.org/index.html/ [pydoit.org]

    • by account_deleted ( 4530225 ) on Wednesday October 09, 2013 @06:04PM (#45086697)
      Comment removed based on user account deletion
    • by account_deleted ( 4530225 ) on Wednesday October 09, 2013 @08:21PM (#45087639)
      Comment removed based on user account deletion
    • by Jonner ( 189691 ) on Wednesday October 09, 2013 @08:51PM (#45087767)

      There are millions of replacements for make, which is part of the problem. I doubt there will ever be one canonical replacement, but Scons is a good choice for many projects IMHO. I'm trying to replace the use of make where I work with Scons, which especially makes sense we use Python for the application code. I think a Scheme-extensible replacement for make could be a very good thing, but adding more languages to the ugliness of Make is not the way to go.

    • by dwheeler ( 321049 ) on Thursday October 10, 2013 @09:21AM (#45091233) Homepage Journal

      There are a lot of build systems that provide more built-in features than straight-up make. Heck, GNU make itself has LOTS more features than POSIX make.

      But many of those more-automated build systems run on top of... make. In particular, if you use cmake or automake/autotools, they *generate* makefiles, so you still need a capable "make" program. In fact, you *want* a "make" underneath with lots of capabilities, so the tool you use directly can generate better results.

      Ant and Maven are nice tools... but usually they're only used with Java. Rake is great, but is typically only used with Ruby. I like Python (the language), but there are several articles showing that at least at the time Scons was *slow* (and thus had trouble scaling). Autoconf's syntax is still baroque, but if you follow certain conventions it's actually not too bad, and it's much easier to use now that a number of annoying bugs have been fixed.

      For general-purpose build systems, the autotools or cmake are still reasonable build systems to look at (unless you're using Java or Ruby). And since they generate makefiles, it's important to have a great tool underneath to process the makefile, even if you don't use make directly.

  • by goruka ( 1721094 ) on Wednesday October 09, 2013 @02:54PM (#45084627)
    At our company we use SCons to build our large projects, which span several platforms (mobile, desktop and consoles), and have plenty of autogenerated code, shaders, etc.
    My point of view is that if you are going to need a complex, scripted build system, why not use a friendlier and more accessible programming language such as Python?
    • by kthreadd ( 1558445 ) on Wednesday October 09, 2013 @03:15PM (#45084895)

      That's why a lot of projects don't use Make directly. You typically use a combination of programs like autoconf, automake and libtool to generate the makefiles for you. In the end you get a shell script that you can send to users and they don't need to have the tools you used installed.

    • by loufoque ( 1400831 ) on Wednesday October 09, 2013 @04:47PM (#45086079)

      It can't be that large if you're using scons.
      SCons is known for being inefficient and scaling badly. It is however fairly powerful at scripting your build rules.

      • by ebno-10db ( 1459097 ) on Wednesday October 09, 2013 @07:55PM (#45087513)

        Much of the scaling issue comes from SCons' default use of hashes to determine if a file has changed. That means in a large build, it has to read and generate a hash for every file. No big deal if you're re-building the whole thing, but a big slowdown if you've changed only one or two files. You can easily switch to timestamps though, ala make. It's not as robust, but it's good for modify-compile-test on big projects. For the real "gotta make sure everything is right", you can go back to hashes.

    • by MtHuurne ( 602934 ) on Wednesday October 09, 2013 @05:01PM (#45086253) Homepage

      I'm a big Python fan, but not so fond of SCons. I think this is mostly a documentation issue: there is a manual which explains things superficially and contains some examples, but what I really want is to have the underlying concepts explained thoroughly. When working on a build system, there are usually multiple ways you could implement something, but they are not equivalent in terms of reliability (robustness against transient failure or user error) and flexibility for future changes in requirements (new platforms with their own weirdness etc). With SCons I could get things to work, but I never really had the feeling I knew why this was the right way to do it.

      (I'm sorry if this is a bit vague, but it's been several years and I don't remember all the details anymore.)

      There isn't really a build system that I do like; most of the time I settle on plain GNU Make (for simple projects) or GNU Make with included Makefiles generated by Python scripts (for complex projects).

  • by romiz ( 757548 ) on Wednesday October 09, 2013 @02:56PM (#45084651)
    Does it build Linux, this time ?

    The Linux build system broke when upgrading GNU Make from 3.81 to 3.82, and all stable branches had to add a fix to handle the changes.
  • by loufoque ( 1400831 ) on Wednesday October 09, 2013 @04:45PM (#45086063)

    Hasn't everyone moved to Ninja yet?

  • by Coppit ( 2441 ) on Wednesday October 09, 2013 @07:02PM (#45087121) Homepage

    SQL is being replaced with NoSQL DBs + imperative code. Want a join? Code up a couple of loops.

    How long before makefiles get replaced with something imperative? Is there anything else widely used that's declarative?

  • by real-modo ( 1460457 ) on Thursday October 10, 2013 @02:40AM (#45089009)

    Make 4.1 will be able to read mail.

  • by descubes ( 35093 ) on Thursday October 10, 2013 @03:10PM (#45095647) Homepage

    See page 184 of the Unix Haters Handbook, http://web.mit.edu/~simsong/www/ugh.pdf [mit.edu]. That has to be the most obstinate bug in the world.

    Helpful comments in the source code:

                    if (wtype == w_eol)
                        {
                            if (*p2 != '\0') /* There's no need to be ivory-tower about this: check for
                                      one of the most common bugs found in makefiles... */
                                fatal (fstart, _("missing separator%s"),
                                              (cmd_prefix == '\t' && !strneq (line, " ", 8))
                                              ? "" : _(" (did you mean TAB instead of 8 spaces?)"));
                            continue;
                        }

    So they detect it, and they'd rather insult the user. But "no ivory tower", no no, we will just not parse a space when the ATT code only parsed tabs. It's a "makefile bug", not a "make bug". Sure.

    And for the fun, I just tried to build make. On MacOSX, supposedly some kind of Unix that I head a few folks actually use to build stuff. Could be a prime citizen. OK, no configure out of the box with the git repository. OK. No makefile, obviously. No install script. Bogus information in the INSTALL that tells me to run nonexistent configure. Well, running the magic incantation, aclocal ; autoheader; automake ; autoconf. Still does not work, missing files like config/compile. Running automake --add-missing. Whatever. Still an error where it's looking for po/Makefile.in.in. Huh?

    So to build make, I need not just make, but four other utilities and makefile input inputs? WTF?

    Make alone was bad enough. But it was not good enough for portability, so autoconf was added. But it did not work so automake was added. But it did not work, so... And now at version 4.0, we have a system here you need half a dozen commands just to build the damn thing, and it still does not build out of the box. Seriously?

    This whole archaic build system is doomed. Go cmake.

Every program is a part of some other program, and rarely fits.

Working...