xen: Do not assign to CFLAGS/AFLAGS/LDFLAGS with :=.
authorKeir Fraser <keir.fraser@citrix.com>
Tue, 13 Jan 2009 08:40:42 +0000 (08:40 +0000)
committerKeir Fraser <keir.fraser@citrix.com>
Tue, 13 Jan 2009 08:40:42 +0000 (08:40 +0000)
It's not necessary and prevents using rule patterns in these
variables.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
xen/Rules.mk
xen/arch/ia64/Rules.mk
xen/arch/x86/Rules.mk

index 37da124f3d9213982d672d2303310ec8c1a4b74d..3ee2f08593c5ecde1ecd5bbbdf4eec7624497fe8 100644 (file)
@@ -23,9 +23,6 @@ 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.
 override TARGET_SUBARCH  := $(XEN_TARGET_ARCH)
@@ -64,17 +61,18 @@ AFLAGS-y                += -D__ASSEMBLY__
 
 ALL_OBJS := $(ALL_OBJS-y)
 
-CFLAGS_tmp := $(strip $(CFLAGS) $(CFLAGS-y))
-CFLAGS = $(CFLAGS_tmp) -MMD -MF .$(@F).d
+# Get gcc to generate the dependencies for us.
+CFLAGS-y += -MMD -MF .$(@F).d
+DEPS = .*.d
+
+CFLAGS += $(CFLAGS-y)
 
 # 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))
+LDFLAGS += $(LDFLAGS_DIRECT)
 
 include Makefile
 
@@ -92,8 +90,6 @@ obj-y    := $(patsubst %/,%/built-in.o,$(obj-y))
 
 subdir-all := $(subdir-y) $(subdir-n)
 
-DEPS = .*.d
-
 built_in.o: $(obj-y)
        $(LD) $(LDFLAGS) -r -o $@ $^
 
index c4854a79a7ab502568ae9530bf11320787036281..3109a0a37e1a9e75f0c49fba5ebcdbfa62f577c3 100644 (file)
@@ -72,4 +72,4 @@ ifeq ($(xen_ia64_disable_optvfault),y)
 CFLAGS += -DCONFIG_XEN_IA64_DISABLE_OPTVFAULT
 endif
 
-LDFLAGS := -g
+LDFLAGS = -g
index d16f4dc4bce057d23cd3431aee256037ef681e6b..5c2198f5cdc42f86ddc62735a4bdf87e765f5d60 100644 (file)
@@ -45,8 +45,9 @@ ifeq ($(TARGET_SUBARCH),x86_64)
 CFLAGS += -mno-red-zone -fpic -fno-reorder-blocks
 CFLAGS += -fno-asynchronous-unwind-tables
 # -fvisibility=hidden reduces -fpic cost, if it's available
-CFLAGS += $(call cc-option,$(CC),-fvisibility=hidden,)
-CFLAGS := $(subst -fvisibility=hidden,-DGCC_HAS_VISIBILITY_ATTRIBUTE,$(CFLAGS))
+ifneq ($(call cc-option,$(CC),-fvisibility=hidden,n),n)
+CFLAGS += -DGCC_HAS_VISIBILITY_ATTRIBUTE
+endif
 x86_32 := n
 x86_64 := y
 endif