92e002
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
92e002
From: Nigel Croxon <ncroxon@redhat.com>
92e002
Date: Fri, 15 Mar 2019 09:48:10 -0400
92e002
Subject: [PATCH] Make.rules incomplete/wrong; make -r failure
92e002
92e002
Make.rules is not complete; in particular it lacks a %.o: %.S rule.
92e002
This happens to work due to the builtin make rule to that effect. but
92e002
building with make -r, or building as a sub-make of an environment that
92e002
uses make -r (or MAKEFLAGS += -r) causes it to break.
92e002
92e002
In general, make -r is strongly preferred, and Make.rules seems to have
92e002
been created explicitly to support this.
92e002
92e002
To further complicate things, the rule %.S: %.c causes a completely
92e002
incomprehensible error message. This rule is wrong, it should be %.s:
92e002
%.c not %.S: %.c.
92e002
92e002
Finally, the rule %.E: %.c is normally %.i: %.c; .i is the normal
92e002
extension for preprocessed C source. The equivalent rule for assembly is
92e002
%.s: %.S.
92e002
92e002
Signed-off-by: H. Peter Anvin <hpa@users.sf.net>
92e002
Signed-off-by: Nigel Croxon <ncroxon@redhat.com>
92e002
---
92e002
 Make.rules | 10 ++++++++--
92e002
 1 file changed, 8 insertions(+), 2 deletions(-)
92e002
92e002
diff --git a/Make.rules b/Make.rules
92e002
index 5b1c2862e1b..8cb93b0a039 100644
92e002
--- a/Make.rules
92e002
+++ b/Make.rules
92e002
@@ -51,8 +51,14 @@
92e002
 %.o: %.c
92e002
 	$(CC) $(INCDIR) $(CFLAGS) $(CPPFLAGS) -c $< -o $@
92e002
 
92e002
-%.S: %.c
92e002
+%.s: %.c
92e002
 	$(CC) $(INCDIR) $(CFLAGS) $(CPPFLAGS) -S $< -o $@
92e002
 
92e002
-%.E: %.c
92e002
+%.i: %.c
92e002
+	$(CC) $(INCDIR) $(CFLAGS) $(CPPFLAGS) -E $< -o $@
92e002
+
92e002
+%.o: %.S
92e002
+	$(CC) $(INCDIR) $(CFLAGS) $(CPPFLAGS) -c $< -o $@
92e002
+
92e002
+%.s: %.S
92e002
 	$(CC) $(INCDIR) $(CFLAGS) $(CPPFLAGS) -E $< -o $@