From: Andre Noll <maan@tuebingen.mpg.de>
Date: Sat, 3 Oct 2015 01:58:43 +0000 (+0000)
Subject: Deactivate implicit make rules.
X-Git-Tag: v0.5.6~66
X-Git-Url: https://git.tue.mpg.de/?a=commitdiff_plain;h=de86b880e37b54167ed21198d99156b0acb657d3;p=paraslash.git

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.
---

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