Skip to content

Instantly share code, notes, and snippets.

@fritschy
Created December 17, 2019 18:32
Show Gist options
  • Save fritschy/513bee5c9b285dc34960918d188e292c to your computer and use it in GitHub Desktop.
Save fritschy/513bee5c9b285dc34960918d188e292c to your computer and use it in GitHub Desktop.
Sensible GNU Makefile Template
# Sensible Makefile Template
# Soure: https://web.archive.org/web/1/https://tech.davis-hansson.com/p/make/
SHELL := bash
.ONESHELL:
.SHELLFLAGS := -eu -o pipefail -c
.DELETE_ON_ERROR:
MAKEFLAGS += --warn-undefined-variables
MAKEFLAGS += --no-builtin-rules
ifeq ($(origin .RECIPEPREFIX), undefined)
$(error This Make does not support .RECIPEPREFIX. Please use GNU Make 4.0 or later)
endif
.RECIPEPREFIX = >
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment