http://qs321.pair.com?node_id=1137457

neilwatson has asked for the wisdom of the Perl Monks concerning the following question:

Greetings Avout,

Make files are hideous and difficult to maintain. Surely we've moved to something better. Are there alternatives? I've seen mention of 'cons' but that seems discontinued. There is SCons which is Python. What do other monks use?

UPDATE: I mean general building, not module building.

Neil Watson
watson-wilson.ca

  • Comment on OT Sick of make, is there a replacement?

Replies are listed 'Best First'.
Re: Sick of make, is there a replacement?
by syphilis (Archbishop) on Aug 05, 2015 at 04:20 UTC
    There's Module::Build, which uses perl to avoid the creation of makefiles.
    I hate it, but many others regard it favourably - it can definitely be classified as an "alternative" to makefiles.

    Cheers,
    Rob
      And then the Powers That Be have decided to take Module::Build out of core, which means that you will first need make to install Module::Build.

      Aristotle gives a good overview of the problems with Module::Build and the promises never fulfilled.

      CountZero

      A program should be light and agile, its subroutines connected like a string of pearls. The spirit and intent of the program should be retained throughout. There should be neither too little or too much, neither needless loops nor useless variables, neither lack of structure nor overwhelming rigidity." - The Tao of Programming, 4.1 - Geoffrey James

      My blog: Imperial Deltronics

        If you want to know what is wrong with p5p: regarding the failure of an installer that never added support for XS modules as "its greatest success" sums it up.

        An installer that doesn't handle XS, has only to copy files from where they get untarred to where they need to be in the filesystem; and after 10 years it couldn't even do that.


        Anyone got any experience of this phone's predecessor?

        With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
        Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
        "Science is about questioning the status quo. Questioning authority". I knew I was on the right track :)
        In the absence of evidence, opinion is indistinguishable from prejudice.
        I'm with torvalds on this Agile (and TDD) debunked I told'em LLVM was the way to go. But did they listen!
        you will first need make to install Module::Build

        No, you don't actually need make to install Module::Build.
        From its README:
        To install "Module::Build", and any other module that uses "Module::Build" for its installation process, do the following: perl Build.PL # 'Build.PL' script creates the 'Build' script ./Build # Need ./ to ensure we're using this "Build" scrip +t ./Build test # and not another one that happens to be in the PA +TH ./Build install
        Module::Build does ship with a Makefile.PL, thus making it possible to install using EU::MM and a make utility.
        But you're not forced to install it that way.

        Cheers,
        Rob
        True, but make as such is not the problem but rather the difficulty of writing a makefile. ExtUtils::MakeMaker takes "care" of that. In most cases it simply works although there will be few people who will totally understand what is happening and it is a pain to do anything that is even a little outside of the standard practices. makepp being a drop-in replacement for make suffers from the same problems.

        Module::Build was started to do away with the dependence on the esoteric makefiles, but it did not fully deliver up on its promises and it just became another black box system to install Perl modules.

        CountZero

        A program should be light and agile, its subroutines connected like a string of pearls. The spirit and intent of the program should be retained throughout. There should be neither too little or too much, neither needless loops nor useless variables, neither lack of structure nor overwhelming rigidity." - The Tao of Programming, 4.1 - Geoffrey James

        My blog: Imperial Deltronics
Re: Sick of make, is there a replacement?
by KurtSchwind (Chaplain) on Aug 05, 2015 at 12:44 UTC

    I think you have essentially 3 main choices. (Many other choices as well, but I these are the ones I see the most in the wild)

    • Makefiles: I actually prefer these, but it might be because I've used them forever
    • CMake: Many open source projects are moving this way and it's got a lot of nice features
    • Ant: Normally used for java based deploys but I've been able to use it for C/C++/Perl and PHP as well.
    --
    “For the Present is the point at which time touches eternity.” - CS Lewis
Re: Sick of make, is there a replacement?
by soonix (Canon) on Aug 05, 2015 at 09:17 UTC
    Do you mean in relation to perl modules, or in general?

      If in general, CMake is becoming popular with FOSS projects. I at first didn't like its ugliness but it is very powerful and makes cross-platrom cross-platform builds musch much easier to maintain.

Re: Sick of make, is there a replacement?
by anonymized user 468275 (Curate) on Aug 05, 2015 at 09:22 UTC
    The requirement is to maintain a configuration file from which software can be built, rather than have to build it manually, which leads to uncertain and untestable deliverables. Some relief from make could be obtained using the dependency management supplied with your version control system (e.g. git). But the most obvious format to replace makefiles with is XML (and lo and behold, a bit of googling leads to a tool called XMake - makefile functionality based on XML files)

    One world, one people

      To paraphrase a sentiment often applied to regular expressions: "I had a problem so I used XML. Now I have two problems.".

      XML is not a solution to anything. And especially it is not a solution that provides a notionally human readable structured configuration or data management solution. XMake may provide some really smart stuff that allows make type dependency stuff easier to manage (I don't know, I've never used it). But that's surely not because of XML, it's in spite of it.

      Premature optimization is the root of all job security
        It's really a matter of taste whether one prefers XML or straight make format but frankly I would expect XML to be more familiar these days. I can agree it was an acquired taste back when I first encountered it, however.

        One world, one people

      Since you didn't provide a link, which of the multiple things named XMake do you mean? Are any of them actively maintained and can you attest to the tool being actually useful? The point being that choosing the build tool based purely on the language seems backwards. But if you're going to suggest an XML-based build tool, why not Ant?

Re: OT Sick of make, is there a replacement?
by fullermd (Priest) on Aug 06, 2015 at 03:51 UTC

    cmake has been suggested a few times above. I recently(ish) rewrote a nasty old imake-based build system on a program into cmake, and found it a reasonable pleasant experience; managing and expanding it since then has failed to be totally miserable. I also replaced another custom make-based build system with cmake, and that went smoothly.

    Of course, cmake is both much more and somewhat less than a make replacement, so depending on just what you're doing, it may be a godsend or a nightmare. If you're looking purely as a building-this-software-package system, it's probably pretty well suited. If you're using make as a more general scripting / automation solution, maybe not so much.

      cmake is both much more and somewhat less than a make replacement

      My only experience with cmake is as a *precursor* to make. Whenever I run cmake (eg to build freeglut or plplot libraries), it generates one or more makefiles and the very next command I run is 'make'.
      I therefore see cmake as an alternative to autotools, not as an alternative to make.

      Cheers,
      Rob

        Sorta. cmake generates makefiles (or other build systems, like ninja), that run (among other things) cmake. So it's not like autotools in that it just spits outs plain makefiles; you need cmake through the whole process, even if you invoke it via make.

Re: OT Sick of make, is there a replacement?
by Anonymous Monk on Aug 05, 2015 at 19:04 UTC
    What do other monks use?

    My fancy IDE uses drag & drop of files, targets, dependencies. The underlying data is XML of medium difficulty to decipher when things go haywire in the GUI, which does happen for rare cases.

    Good: not thought about build file formats in years. Bad: nothing so far. Evaluation: totally worth it.

    The exact product is not important. Fairly certain Eclipse, Visual Studio, Xcode, Komodo offer similar features.