diff options
author | Egor Tensin <Egor.Tensin@gmail.com> | 2021-03-31 20:42:23 +0300 |
---|---|---|
committer | Egor Tensin <Egor.Tensin@gmail.com> | 2021-04-07 03:30:51 +0300 |
commit | dd5da892eea7a60a7b77c280f9ce4a4dbab3fdc8 (patch) | |
tree | 9b7a1c747bd4874aac79161baab8e17db6018f98 | |
parent | debian: 1.0-1 (diff) | |
download | linux-status-dd5da892eea7a60a7b77c280f9ce4a4dbab3fdc8.tar.gz linux-status-dd5da892eea7a60a7b77c280f9ce4a4dbab3fdc8.zip |
debian: Makefile best practices
Diffstat (limited to '')
-rw-r--r-- | debian/Makefile | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/debian/Makefile b/debian/Makefile index 51aefa4..0a6aebc 100644 --- a/debian/Makefile +++ b/debian/Makefile @@ -1,14 +1,18 @@ -MAKEFLAGS += --warn-undefined-variables +MAKEFLAGS += --no-builtin-rules --no-builtin-variables --warn-undefined-variables +unexport MAKEFLAGS .DEFAULT_GOAL := all .DELETE_ON_ERROR: .SUFFIXES: SHELL := bash +# Careful -eu breaks things as usual. .SHELLFLAGS := -e -o pipefail -c +.PHONY: DO +DO: + escape = $(subst ','\'',$(1)) -# Don't expand parameters: -define escape_arg +define noexpand ifeq ($$(origin $(1)),environment) $(1) := $$(value $(1)) endif @@ -25,18 +29,15 @@ PPA_NAME ?= linux-status GPG_KEY ?= 3B3EF1235420917E0DB0723991D679FB92B036CB DIST ?= bionic -$(eval $(call escape_arg,PPA_OWNER)) -$(eval $(call escape_arg,PPA_NAME)) -$(eval $(call escape_arg,GPG_KEY)) -$(eval $(call escape_arg,DIST)) +$(eval $(call noexpand,PPA_OWNER)) +$(eval $(call noexpand,PPA_NAME)) +$(eval $(call noexpand,GPG_KEY)) +$(eval $(call noexpand,DIST)) this_dir := $(dir $(realpath $(firstword $(MAKEFILE_LIST)))) root := $(this_dir)/.. build_area := $(this_dir)/build-area -.PHONY: DO -DO: - .PHONY: deps deps: apt-get update |