News for hackers. Stuff that matters.
Re:Why I Prefer Makefiles over Package.json Scripts by Izkata on Monday March 14, 2022 @04:05PM (#30677506)
Make is a file-based dependency tree that only defaults to a specific shell. If you really want to go crazy, you could actually change it to anything that can be invoked with "<executable> <file>", such as python, and use that language instead.

As a really crude example:

  SHELL := python
  .ONESHELL:

  out.csv:
      import csv
      with open("$@", "w") as f:
          writer = csv.writer(f)
          writer.writerow(["header1", "header2"])
and so:

  $ make
  import csv
  with open("out.csv", "w") as f:
      writer = csv.writer(f)
      writer.writerow(["header1", "header2"])
  $ cat out.csv 
  header1,header2
I get that this doesn't exactly solve your "cross-platform work" gripe, but my point is that a lot of what people perceive as make providing isn't actually make in the first place.
Re:Why I Prefer Makefiles over Package.json Scripts by pqb on Monday March 14, 2022 @05:25PM (#30678559)
Thank you for reminding me it! Awesome finding.

Worth noting, each recipe can have its very own SHELL[0] (e.g., ruby recipe, that uses ruby command with -e flag):

  ruby: .SHELLFLAGS := -e
  ruby: SHELL := ruby
  ruby:
   greeting = "labas"
   puts "#{greeting}, ruby!"

[0]: http://agdr.org/2020/05/14/Polyglot-Makefiles.html
Re:Why I Prefer Makefiles over Package.json Scripts by Izkata on Monday March 14, 2022 @08:14PM (#30680203)
Nice, being able to mix them is new to me. I thought SHELL could only be set once.