Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

One day after writing a complex Makefile and getting frustrated because 1) it was hard to read and reason about because of make weird syntax, 2) it didn't run on CI because it uses GNU Make instead of BSD Make on my MacBook, I thought of writing a "modern" alternative:

I wanted it easy to read, write, parse and use, so I'd use YAML. You guys all shit on YAML because it's extremely badly used by, say, Helm charts, but it's a good markup language in itself. StrictYAML is anyway.

So I started writing a toy Makefile in YAML with these requirements: I need to run a command, with variables, it needs to depend on another command, and shouldn't run if the "output" file is already present and newer than the "source" files. So something like this:

    env:
        APPNAME: app
    clean:
        run: rm -rf ./dist

    build:
        depends:
            - clean
        input:
            - **/*.go
        run:
            - go build -o dist/$APPNAME
        output:
            - dist/$APPNAME
At this point I realized I had written exactly the same things proposed by Taskfile (which I heard of but thought "meh it sucks, Makefiles are great).

So yeah, Taskfiles are just Makefiles with a sane syntax and better tooling (JSON schema, auto generated doc, real default target...). I have no idea why the comments are so hostile towards it, because clearly Makefiles are not perfect (it's even a pretty bad format)



I'm the creator of StrictYAML and honestly, I would love to see something like this built with it.

I hate make and I dont like the idea of using non-typesafe YAML to build this (which presumably this tool does, since it's done in golang).

I've been using a "standardized" bash script with a huge case statement as a justfile/this/makefile replacement but it's not ideal.


Thank you for StrictYAML! I wish it was the standard


   it didn't run on CI because it uses GNU Make instead of BSD Make on my MacBook
What?

  $ /usr/bin/make --version
  GNU Make 3.81
  Copyright (C) 2006  Free Software Foundation, Inc.
  This is free software; see the source for copying conditions.
  There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
  PARTICULAR PURPOSE.

  This program built for i386-apple-darwin11.3.0


My memories must fail me, I thought it was a BSD make vs GNU make issue but probably not! Maybe a version issue between the bundled make binaries on each platform, I don't remember the details to be honest




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: