News for hackers. Stuff that matters.
Re:Tired of Makefiles by xmprt on Monday May 13, 2024 @06:33PM (#40349355)
make still has a better UI than shell scripts. With shell scripts you have to maintain multiple files whereas a Makefile has all the scripts in a single file.
Re:Tired of Makefiles by SahAssar on Monday May 13, 2024 @06:49PM (#40349484)
No you don't. I like makefiles because of the dependencies between targets but for simple multi-target things I still do shell scripts like

    mything() {
      # ...
    }

    otherthing() {
      # ...
    }

    if [ $# -eq 0 ]; then
        echo "Usage: ./run.sh [mything, otherthing]"
        exit 1
    fi

    "$@"
Re:Tired of Makefiles by collinvandyck76 on Monday May 13, 2024 @07:09PM (#40349651)
I've been writing scripts like this but with a case/esac at the bottom to map $1 to the right command. Have never thought about doing this instead. thank you for opening my eyes!
Re:Tired of Makefiles by banish-m4 on Tuesday May 14, 2024 @01:31AM (#40351926)
Been There, Done That, Bought The T-Shirt and leads to unmaintainable shit. One script per action. The end.
Re:Tired of Makefiles by collinvandyck76 on Tuesday May 14, 2024 @10:12AM (#40355427)
Maybe for your usecase, sure, but my usecase is my own dotfiles which has some of these helper scripts and it's a good fit there.
Re:Tired of Makefiles by SahAssar on Tuesday May 14, 2024 @04:43PM (#40359946)
You express no nuance and only say that something is wrong without explaining why. Your communication skills lack "skill" and "communication". Your absolutism makes me convinced that you are are either wrong or incapable to explain why you would be right.
Re:Tired of Makefiles by edflsafoiewq on Monday May 13, 2024 @06:45PM (#40349448)
Why is that a better UI?
Re:Tired of Makefiles by t3rra on Monday May 13, 2024 @06:44PM (#40349445)
wth. makefile can include other makefiles.
Re:Tired of Makefiles by banish-m4 on Tuesday May 14, 2024 @01:30AM (#40351920)
That's a god function antipattern and rapidly becomes non-portable.

Each lifecycle hook should be a an executable of some sort like "scripts/{{command}}", be it a shell script or something else.