Summary (AI generated)

Archived original version »

This article discusses an opinionated approach to writing (GNU) Makefiles that the author learned from Ben. The main points covered are:

  1. Using .RECIPEPREFIX to replace tabs with ‘>’ for better readability and compatibility.

  2. Setting a specific shell, such as bash or zsh, in the Makefile to avoid cross-shell compatibility issues.

  3. Enabling bash strict mode to ensure that make keeps executing even if there was a failure in one of the targets.

  4. Changing some default Make options for improved error handling and better control over built-in rules.

  5. Emphasizing the importance of using Make as a tool to leverage the file system, rather than just an automation mechanism for shell snippets.

  6. Discussing the use of sentinel files for targets that do not yield exactly one file.

  7. Providing examples of how these concepts can be incorporated into a Makefile to build and package a Node app into a Docker image.