Best Makefile Defaults

# Always use bash as the shell.
SHELL := bash

# Enable bash strict mode.
.SHELLFLAGS := -eu -o pipefail -c

## Change some Defaults of Make.
# Ensures each Make recipe is ran as one single shell session,
# rather than one new shell per line.
.ONESHELL:

# Delete it's target file if a Make rule fails.
.DELETE_ON_ERROR:

MAKEFLAGS += --warn-undefined-variables
MAKEFLAGS += --no-builtin-rules

# Always use GNU Make.
ifeq ($(origin .RECIPEPREFIX), undefined)
  $(error This Make does not support .RECIPEPREFIX. Please use GNU Make 4.0 or later)
endif

# Use '>' to instead of tab.
.RECIPEPREFIX = >