Live data from Hacker News

How I stopped worrying and loved Makefiles

gagor.pro

11–20 of 144 posts

Re: How I stopped worrying and loved Makefiles

#11
Ninja is simple and fast, but intentionally limited in order to not be programmable. Make is powerful and versatile (especially the GNU variant) but has an arcane syntax and lots of pitfalls. I feel that there is a niche between make and ninja for the task runner.

Re: How I stopped worrying and loved Makefiles

#12

Ninja is simple and fast, but intentionally limited in order to not be programmable. Make is powerful and versatile (especially the GNU variant) but has an arcane syntax and lots of pitfalls. I feel that there is a niche between make and ninja for the task runner.

> I feel that there is a niche between make and ninja for the task runner.

I think that's called CMake.

Re: How I stopped worrying and loved Makefiles

#13

Ninja is simple and fast, but intentionally limited in order to not be programmable. Make is powerful and versatile (especially the GNU variant) but has an arcane syntax and lots of pitfalls. I feel that there is a niche between make and ninja for the task runner.

> I feel that there is a niche between make and ninja for the task runner. I think that's called CMake.

No, CMake is a compatibility layer on top of existing task runners like make and ninja. I don't want a compatibility layer, and also CMake has even more features than make.

Re: How I stopped worrying and loved Makefiles

#15

If you’re really looking for a tool to collect small steps/script I highly recommend you check out the ‘just’ cli tool. It’s completely replaced our use of Make and the syntax is much easier.

lol that's a purple link for me: https://github.com/casey/just

Re: How I stopped worrying and loved Makefiles

#18
GNU Make is a surprisingly lisplike language. At some point I realized it had an eval function which I could use to metaprogram it. This actually ruined one of my projects, I got so lost trying to create the perfect makefile system that nothing short of a rewrite would fix it. As a side effect, I finally understood what autoconf's purpose was.

Re: How I stopped worrying and loved Makefiles

#19

My favourite (ab)use of `make` is as a batch runner: https://news.ycombinator.com/item?id=32441602 This (ab)use of `make` runs multiple times a day, every day, and works perfectly every time. The inspiration of this was an (ab)use of `make` as a way to paralellize Linux system startup: https://web.archive.org/web/20110606144530/http://www.ibm.co...

I (ab)use make to manage my dotfiles.

https://github.com/matheusmoreira/.files/blob/master/GNUmake...

I'm surprised at how well this thing works every time I use it. I even blogged about it.

https://www.matheusmoreira.com/articles/managing-dotfiles-wi...

Recently made a tool that processes the make database and prints the phony targets and their dependencies:

https://github.com/matheusmoreira/.files/blob/master/~/.loca...

I use it as a sort of makefile help command. Works surprisingly well too.

Re: How I stopped worrying and loved Makefiles

#20

Ninja is simple and fast, but intentionally limited in order to not be programmable. Make is powerful and versatile (especially the GNU variant) but has an arcane syntax and lots of pitfalls. I feel that there is a niche between make and ninja for the task runner.

> I feel that there is a niche between make and ninja for the task runner. I think that's called CMake.

As one of the unfortunate souls damned to using CMake regularly, I can confidently say that it is slower, less maintainable, and less intelligible than make.
Post reply on HN