WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] [PATCH] xen/Rules.mk: Do not dance about pointlessly with CF

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] [PATCH] xen/Rules.mk: Do not dance about pointlessly with CFLAGS_tmp
From: Ian Jackson <Ian.Jackson@xxxxxxxxxxxxx>
Date: Mon, 12 Jan 2009 17:05:37 +0000
Delivery-date: Mon, 12 Jan 2009 09:06:56 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
It is usually better to use `=' in Makefiles than `:='.  The expansion
rules for `:=' are simpler - so simple in fact that they don't work if
any part of the expansion depends on the source or target filenames.

In this patch we remove the shuffling of the value of CFLAGS between
:= and = flavour variables.  This was previously `necessary' because
otherwise it would run the seddery for removing -fomit-frame-pointer
once for each rule.

However this seddery is not actually necessary because there is plenty
of other machinery for (a) only setting -fomit-frame-frame-pointer
when applicable AND (b) passing -fno-omit-frame-pointer later on the
command line if it's not applicable.  So we already have belt and
braces and can remove the safety pins.

Signed-off-by: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>

diff -r 95d8788bf4be xen/Rules.mk
--- a/xen/Rules.mk      Mon Jan 12 10:23:55 2009 +0000
+++ b/xen/Rules.mk      Mon Jan 12 16:58:48 2009 +0000
@@ -22,9 +22,6 @@ endif
 endif
 ifeq ($(perfc_arrays),y)
 perfc := y
-endif
-ifeq ($(frame_pointer),y)
-CFLAGS := $(shell echo $(CFLAGS) | sed -e 's/-f[^ ]*omit-frame-pointer//g')
 endif
 
 # Set ARCH/SUBARCH appropriately.
@@ -64,14 +61,11 @@ AFLAGS-y                += -D__ASSEMBLY_
 
 ALL_OBJS := $(ALL_OBJS-y)
 
-CFLAGS_tmp := $(strip $(CFLAGS) $(CFLAGS-y))
-CFLAGS = $(CFLAGS_tmp) -MMD -MF .$(@F).d
+CFLAGS += $(CFLAGS-y) -MMD -MF .$(@F).d
 
 # Most CFLAGS are safe for assembly files:
 #  -std=gnu{89,99} gets confused by #-prefixed end-of-line comments
-AFLAGS_tmp := $(strip $(AFLAGS) $(AFLAGS-y))
-AFLAGS_tmp += $(patsubst -std=gnu%,,$(CFLAGS_tmp))
-AFLAGS = $(AFLAGS_tmp) -MMD -MF .$(@F).d
+AFLAGS += $(AFLAGS-y) $(filter-out -std=gnu%,$(CFLAGS))
 
 # LDFLAGS are only passed directly to $(LD)
 LDFLAGS  := $(strip $(LDFLAGS) $(LDFLAGS_DIRECT))
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
<Prev in Thread] Current Thread [Next in Thread>