From de86b880e37b54167ed21198d99156b0acb657d3 Mon Sep 17 00:00:00 2001 From: Andre Noll Date: Sat, 3 Oct 2015 01:58:43 +0000 Subject: [PATCH] Deactivate implicit make rules. Without this, make might execute commands defined by implicit rules. This can cause subtle build errors that are hard to debug. To make this work we need to define CC though, and RM must not be defined through the =? operator. --- Makefile.real | 9 +++++++++ t/makefile.test | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/Makefile.real b/Makefile.real index 59579e27..ee0bf447 100644 --- a/Makefile.real +++ b/Makefile.real @@ -1,3 +1,12 @@ +# Implicit rules are implemented in make as suffix rules. The following rule +# empties the suffix list to disable the predefined implicit rules. This +# increases performance and avoids hard-to-debug behaviour. +.SUFFIXES: +MAKEFLAGS += -Rr +ifeq ("$(origin CC)", "default") + CC := cc +endif + vardir := /var/paraslash mandir := $(datarootdir)/man/man1 STRIP := $(CROSS_COMPILE)strip diff --git a/t/makefile.test b/t/makefile.test index 6ef9ac84..15bb6859 100644 --- a/t/makefile.test +++ b/t/makefile.test @@ -1,4 +1,4 @@ -RM ?= rm -f +RM = rm -f results_dir := $(test_dir)/test-results trash_dir := $(test_dir)/trashes -- 2.39.2