Why Makefile?
- Why use Make by Mike Bostock. [Feb 2013].
- Role of Makefile in Open-Data-Sharing and reproducible research. [Aug 2015].
How Make?
Tutorials
- Your Makefiles are wrong · Jacob Davis-Hansson; some things that I did not know!
- Notes for new Make users
- A Super-Simple Makefile for Medium-Sized C/C++ Projects
- Using Make – writing less Makefile
- Danilo Spinella’s site - Makefiles, Best Practices
- A Tutorial on Portable Makefiles from null program blog.
- Makefile Basics — a
gist
containing a makefile with annotations on how different features work.
Tips and Tricks
-
.ONESHELL: python: SHELL := python3 python: greeting = “hello” print(f”{greeting}, python!“)
Examples of good use of Makefile
- Homotopy Type Theory — book written using LaTeX, put together using Makefile.
- Use of ifchanges.py to monitor file changes and recompile files.
- Parallelizing tasks
- Rust tutorial makefile
Makefile companions — autotools, premake, scons, cmake
- Introduction to the Autotools (autoconf, automake, and libtool) - Home Page
- Autotools Mythbuster
- premake, CMake and Scons are often recommended as alternatives to auto tools.
- entr(1), Run arbitrary commands when files change
- mitjafelicijan/makext: QOL Extensions for GNU Make
Make-like
- Just ” is a handy way to save and run project-specific commands.” -
just
is a command runner, not a build system, so it avoids much ofmake
’s complexity and idiosyncrasies. No need for.PHONY
recipes! - cmake
- Pants
- tup is a file-based build system for Linux, OSX, and Windows. It inputs a list of file changes and a directed acyclic graph (DAG), then processes the DAG to execute the appropriate commands required to update dependent files. Updates are performed with very little overhead since tup implements powerful build algorithms to avoid doing unnecessary work. This means you can stay focused on your project rather than on your build system.
- casey/just: 🤖 Just a command runner ⚡
- xmake A cross-platform build utility based on Lua Simple, Fast, Cross-platform Modern C/C++ build tools, Support multi-language hybrid compilation.