cross-posted from: https://lemmy.ml/post/4908824

There are two major flavours of variables in GNU Make: “simple” and “recursive”.

While simple variables are quite simple and easy to understand, they can be limiting at times. On the other hand, recursive variables are powerful yet tricky.

There is exactly one rule to recall when using recursive variables…

🧠 The value of a recursive variable is computed every time it is expanded.

  • AProfessional@lemmy.world
    link
    fedilink
    English
    arrow-up
    3
    ·
    1 year ago

    Having written a lot of makefiles, I just think it’s best avoided these days. Use something like Meson, or even CMake.

    • bahmanm@lemmy.mlOP
      link
      fedilink
      English
      arrow-up
      4
      ·
      1 year ago

      TBH I use whatever build tool is the better fit for the job, be it Gradle, SBT or Rebar.

      But for some (presumably subjective) reason, I like GNU Make quite a lot. And whenever I get the chance I use it - esp since it’s somehow ubiquitous nowadays w/ all the Linux containers/VMs everywhere and Homebrew on Mac machines.