3 ms·
I recently used my blog as a way to learn how to use Make and Makefiles. I write posts in Markdown, and my Makefile generates HTML for each using Pandoc, then s
by boerseth 3y ago
I recently used my blog as a way to learn how to use Make and Makefiles. I write posts in Markdown, and my Makefile generates HTML for each using Pandoc, then stitches it all together into one `index.html` file. The webpage behaves like a single-page-app, with a table-of-contents and everything, with just some CSS trickery.
I know there are probably frameworks and tools that do this for me already, in ways both more flexible and robust than how I've done it, but I've really enjoyed the process of getting to this point. I started writing dumb shell scripts and struggling with weird cases and messy code, then learned more about Make and improved on things by a lot. In the end, it didn't take a lot of code, yet I feel like I can be really pleased with the result.
I have come to really like Make, I have to say. It is probably used more often than it should, judging by some of the comments here. I've seen a few Makefiles where a substantial percentage of recipes are `.PHONY`, and maybe those are the cases where you should think about looking for a different task-runner? Not sure, but I enjoy Make anyway.