Discussion on: Makefiles and alternatives?

jotafeldmann profile image
Jota Feldmann

Hi Pacharapol,

I recommend Makefile for some reasons:

  • Exists since 1976 (old, battle-tested);
  • It's included in Linux and macOS versions;
  • It's some sort of industry standard for common tasks.

Example: you're working in a polyglot stack (Node, Python, Java, Go). Even when you're experienced in one or two languages, you don't know how to execute some tasks (NPM for Node, Pipenv for Python, Maven/Gradle for Java, so on).

One simple way to solve that is using a common approach to create common tasks using the Makefile, and wrap the language-specific command, like make dev for npm run dev (developer profile to watch and reload changes), make test for npm test, make run for npm start (for production), make deploy, etc.

In the end, you don't need to know the tasks or read all the README.md in the repositories. And better: you can check the Makefile for all available tasks and how its work for all languages :)

Makefile its not hard: cs.colby.edu/maxwell/courses/tutor...