• smeg@feddit.uk
    link
    fedilink
    English
    arrow-up
    2
    ·
    3 hours ago

    When I discovered that make treats commands as completely different syntax based on whether the lines start with tabs or spaces I realised it was an insane tool exclusively for masochists

  • beeng@discuss.tchncs.de
    link
    fedilink
    arrow-up
    3
    ·
    4 hours ago

    Been using mise

    Runs tasks and lock files your repos dependencies and their sources over multiple platforms.

  • Snarwin@fedia.io
    link
    fedilink
    arrow-up
    12
    ·
    23 hours ago

    The fundamental problem with all build systems, including make, is that every platform, every toolchain, and every organization has its own unique ideas about (a) what exactly constitutes a “project,” and (b) what exactly it means to “build” such a thing. Because of this, any build system that attempts to create abstractions for things like “projects,” “dependencies,” “targets,” and so on will inevitably exclude some valid use-cases, and, conversely, any build system that attempts to address all use-cases will eventually end up reinventing shell scripting.

    make is a useful tool for turning files into more files. Sometimes, that’s all you need from a build system; sometimes, it’s only part of what you need; and sometimes, what you need is something entirely different.

  • Eager Eagle@lemmy.world
    link
    fedilink
    English
    arrow-up
    9
    arrow-down
    1
    ·
    1 day ago

    Tldr no problems with makefiles were addressed, this is only a superficial introduction to it that doesn’t match the title of the post. Use just if you can.

    • thingsiplay@lemmy.ml
      link
      fedilink
      arrow-up
      6
      arrow-down
      1
      ·
      24 hours ago

      The only issue with just is, that it is another third party tool to depend on. The huge benefit of make is, that this is a trusted tool in core developer toolset. If I were to use just, why not use something more standard like ninja or cmake?

          • lavember@programming.dev
            link
            fedilink
            arrow-up
            1
            ·
            23 hours ago

            nix devshells let devs not worry about preinstalled deps like just, comes in handy esp. with larger teams and monorepos. thats how I managed to introduce stuff outside the js ecossystem to my js-centered peers in our project, they just pull the new stuff and the environment installs whatever it needs. its better also because you can make it reproducible like to the exact dependency version (node/uv/git/whatever) so no issues of “works on my machine” arise

      • onlinepersona@programming.dev
        link
        fedilink
        English
        arrow-up
        2
        arrow-down
        1
        ·
        21 hours ago

        make is just installed by default. Windows is also just installed by default. Using that as an argument to keep something is questionable.

        And to answer your question “why no ninja or cmake?” Because they are complicated af and are for building (mostly) C++ horrors.

        just is a handy way to save and run project-specific commands.

        It’s being used more because it’s simple and easy to run. It’s not a build system or whatever make (poorly) tried to be.

        • thingsiplay@lemmy.ml
          link
          fedilink
          arrow-up
          3
          arrow-down
          3
          ·
          21 hours ago

          make is just installed by default.

          No, its not installed by default. But it is a standard tool.

          Windows is also just installed by default.

          This is irrelevant to our discussion. We are talking about optional tools for developers and Windows is not a tool.

          Using that as an argument to keep something is questionable.

          It is not questionable to have an argument to use standard tools only. To me it is questionable to question that argument at all.

          just is not an established standard tool, compared to make or ninja or cmake. So any objection with the argument its not a standard tool is valid. It does not become invalid just because you said its questionable argument, for no reason.

          • Eager Eagle@lemmy.world
            link
            fedilink
            English
            arrow-up
            1
            arrow-down
            1
            ·
            18 hours ago

            It is not questionable to have an argument to use standard tools only.

            I think it is. It’s a made up constraint that might give you some peace of mind, but it’s not impactful when it takes one command line and a few seconds to install it.

            I don’t understand why anyone would only use programs already installed on their machine, you are probably already using make to compile and install something that your machine is lacking.

            • thingsiplay@lemmy.ml
              link
              fedilink
              arrow-up
              1
              arrow-down
              1
              ·
              18 hours ago

              In case you have reading comprehension problems, I said in case I use just, I would rather prefer using a different third party tool that is more adapted and quasi standards like ninja or cmake. just is not established yet and it doesn’t provide much over make to justify depending on yet another make tool, while there are already lot of projects depending on different make tools.

          • onlinepersona@programming.dev
            link
            fedilink
            arrow-up
            2
            arrow-down
            2
            ·
            19 hours ago

            “I find saying it’s questionable questionable in itself”

            Lol, OK. Obviously you’re the bigger brain here. Can’t argue with that.

            • thingsiplay@lemmy.ml
              link
              fedilink
              arrow-up
              1
              ·
              18 hours ago

              Nothing to do with big brain. You just don’t accept my objection. But it is a real concern to have, you just don’t care. That’s the difference. Because you can’t argue against it, so you invalidate it by saying its questionable.

      • Eager Eagle@lemmy.world
        link
        fedilink
        English
        arrow-up
        1
        arrow-down
        1
        ·
        20 hours ago

        It depends on what you need. The uses I have for just are mostly as a command runner, so I gain no benefit from using a more complicated tool.

    • Ephera@lemmy.ml
      link
      fedilink
      arrow-up
      1
      ·
      19 hours ago

      Should be said, though, that just looks superficially similar, but is a very different tool.

      just is a way of aliasing commands/scripts. You can do that with make as well, by whacking .PHONY onto everything, but it really isn’t what it was built for.

      make is instead a way of defining rules for how to transform files into other files. For that transformation, you’ll then use commands/scripts, but it’s really about defining a whole build system based on the rules.

      Perhaps in other words, just works best, if your language already has a build tool that you just need to call with different flags.
      make is instead intended to be that build tool, and what it calls underneath is a compiler.

  • setsubyou@lemmy.world
    link
    fedilink
    arrow-up
    19
    ·
    1 day ago

    Plain makefiles are horrible if you need to support multiple different platforms that all have their own quirks and build differences.

    And also different implementations of make. The author lumps Unix, Linux and BSD together because you’d be likely to have make available on all of them, but neglects to mention that that could easily be three or more different dialects. If you create your Makefiles on Linux you are not at all unlikely to use GNU-specific features (because they’re handy) that won’t work on BSD. Or even features of GNU make 4 that still won’t work on older versions, e.g. what ships by default on Macs.

    The way the author speaks about Windows in this context suggests they also don’t realize that Windows has nmake (of course also not really compatible with GNU).

    It’s not a coincidence that even when it’s mostly Linux, people use autotools on top, and if it’s more platforms than that handles well, it’s often a set of setup scripts. Or that projects migrated to tools like Cmake, which is one of the worst scripting language designs I have seen in 30 years of professional software development, but makes it much less painful to support multiple platforms with a single build system. Including ones specific to Windows or macOS and so on, but also ninja on Linux that is much faster at incremental builds than make.

  • siftmama@lemmy.world
    link
    fedilink
    arrow-up
    2
    ·
    23 hours ago

    The post uses make purely as a command runner. Using make and all it’s quirks for that is not a great idea. I suggest using mise-en-place this instead. Make has its uses, but using it purely for this, isn’t it. I believe just is also a command runner, but all projects need a way to manage version of tools, so might as well use one system for both, and as a bonus, it gives you env var management too!

  • hosaka@programming.dev
    link
    fedilink
    arrow-up
    2
    ·
    1 day ago

    Just is quite good, especially with multiple modules nested within the project’s directories. It can get a bit unwieldy though and it’s just a bunch of shell scripts underneath when you need to do something complex. That said though I successfully manage a large Unreal Engine project with it and it does building/cooking/testing/deployment on both Win and Linux.

  • FizzyOrange@programming.dev
    link
    fedilink
    arrow-up
    6
    arrow-down
    8
    ·
    1 day ago

    Make is pretty jank. I wouldn’t defend it. The only reasons to use it are that it’s pretty much installed by default, and for some reason nobody has written a better version. Kinda weird really. I might vibe code one.

    If you don’t believe me, look at how recursive Make works, or how the job server works, or how to support paths containing spaces (you can’t), or .PHONY, or how the default rule is chosen, or …

    • Ephera@lemmy.ml
      link
      fedilink
      arrow-up
      1
      ·
      19 hours ago

      make has a huge amount of history, which is pretty much its selling point. We decided recently to introduce it into a project for command aliases, simply because it’s available everywhere.

      just would’ve been the objectively better tool for what we want to use it for. But slapping .PHONY onto everything is less big of a deal than telling all devs to install yet another tool before they can get started.

      • FizzyOrange@programming.dev
        link
        fedilink
        arrow-up
        4
        arrow-down
        2
        ·
        1 day ago

        Ninja isn’t designed for hand written rules - it’s more of a backend tool.

        Redo is barely anything at all. It sounds kind of elegant but I’ve tried it - you basically end up assembling Make yourself from dozens of loose files.

        Just isn’t really a build system at all - it’s a “command runner” like npm run. I’m not sure it can even do dependency tracking like Make can it? In any case in my view it’s worse because they’ve made it super complicated and kitchen sinky.

        • IanTwenty@piefed.social
          link
          fedilink
          English
          arrow-up
          2
          ·
          18 hours ago

          For small stuff ninja is fine and the language is tiny and simple, no mad escaping. It gets completely out the way and you can do a lot before you have to reach for anything else.

      • Lodra@programming.dev
        link
        fedilink
        English
        arrow-up
        2
        ·
        1 day ago

        Don’t forget Task! It’s yaml based and written in go. I like it. It works well. It has a few rough edges. Unfortunately, I haven’t given Just a chance yet to compare

      • [object Object]@lemmy.ca
        link
        fedilink
        arrow-up
        1
        ·
        1 day ago

        So there are multiple use cases here: one is a script runner, and the other is a directed act mix graph runner with timestamp based pruning.

        Make is good for builds because it ignores unmodified data, and just is great as a script runner because it’s way more ergonomic than make to write.

        I think they both have a good place, but for most languages other than C you need a script rune and the compiler does all the file selection and pruning.