Procházet zdrojové kódy

Make.rules incomplete/wrong; make -r failure

Make.rules is not complete; in particular it lacks a %.o: %.S rule.
This happens to work due to the builtin make rule to that effect. but
building with make -r, or building as a sub-make of an environment that
uses make -r (or MAKEFLAGS += -r) causes it to break.

In general, make -r is strongly preferred, and Make.rules seems to have
been created explicitly to support this.

To further complicate things, the rule %.S: %.c causes a completely
incomprehensible error message. This rule is wrong, it should be %.s:
%.c not %.S: %.c.

Finally, the rule %.E: %.c is normally %.i: %.c; .i is the normal
extension for preprocessed C source. The equivalent rule for assembly is
%.s: %.S.

Signed-off-by: H. Peter Anvin <hpa@users.sf.net>
Signed-off-by: Nigel Croxon <ncroxon@redhat.com>
Nigel Croxon před 6 roky
rodič
revize
de4e5e4e3b
1 změnil soubory, kde provedl 8 přidání a 2 odebrání
  1. 8 2
      Make.rules

+ 8 - 2
Make.rules

@@ -51,8 +51,14 @@
 %.o: %.c
 %.o: %.c
 	$(CC) $(INCDIR) $(CFLAGS) $(CPPFLAGS) -c $< -o $@
 	$(CC) $(INCDIR) $(CFLAGS) $(CPPFLAGS) -c $< -o $@
 
 
-%.S: %.c
+%.s: %.c
 	$(CC) $(INCDIR) $(CFLAGS) $(CPPFLAGS) -S $< -o $@
 	$(CC) $(INCDIR) $(CFLAGS) $(CPPFLAGS) -S $< -o $@
 
 
-%.E: %.c
+%.i: %.c
+	$(CC) $(INCDIR) $(CFLAGS) $(CPPFLAGS) -E $< -o $@
+
+%.o: %.S
+	$(CC) $(INCDIR) $(CFLAGS) $(CPPFLAGS) -c $< -o $@
+
+%.s: %.S
 	$(CC) $(INCDIR) $(CFLAGS) $(CPPFLAGS) -E $< -o $@
 	$(CC) $(INCDIR) $(CFLAGS) $(CPPFLAGS) -E $< -o $@