aboutsummaryrefslogtreecommitdiffstats
path: root/xen/Rules.mk
diff options
context:
space:
mode:
authorkfraser@localhost.localdomain <kfraser@localhost.localdomain>2006-10-18 14:46:48 +0100
committerkfraser@localhost.localdomain <kfraser@localhost.localdomain>2006-10-18 14:46:48 +0100
commit3943db776371b40e0c93e1244669bc9b78f8bbf1 (patch)
tree67ece81d381d8449636c719a8c7dca723f50d1e7 /xen/Rules.mk
parent946eb2a9da1f63f87656726152ab427e112e392d (diff)
downloadxen-3943db776371b40e0c93e1244669bc9b78f8bbf1.tar.gz
xen-3943db776371b40e0c93e1244669bc9b78f8bbf1.tar.bz2
xen-3943db776371b40e0c93e1244669bc9b78f8bbf1.zip
[XEN] Can be built -std=gnu99 (except for .S files).
Need to be careful with static initialisers: 1. *_LOCK_UNLOCKED, CPU_MASK_* no longer include a cast 2. Dynamic uses of the above are replaced by appropriate function invocations. Signed-off-by: Keir Fraser <keir@xensource.com>
Diffstat (limited to 'xen/Rules.mk')
-rw-r--r--xen/Rules.mk10
1 files changed, 8 insertions, 2 deletions
diff --git a/xen/Rules.mk b/xen/Rules.mk
index b3ae01dfc2..1522ba786b 100644
--- a/xen/Rules.mk
+++ b/xen/Rules.mk
@@ -63,8 +63,13 @@ endif
AFLAGS-y += -D__ASSEMBLY__
ALL_OBJS := $(ALL_OBJS-y)
+
CFLAGS := $(strip $(CFLAGS) $(CFLAGS-y))
+
+# Most CFLAGS are safe for assembly files:
+# -std=gnu{89,99} gets confused by #-prefixed end-of-line comments
AFLAGS := $(strip $(AFLAGS) $(AFLAGS-y))
+AFLAGS += $(patsubst -std=gnu%,,$(CFLAGS))
include Makefile
@@ -102,10 +107,11 @@ _clean_%/: FORCE
$(CC) $(CFLAGS) -c $< -o $@
%.o: %.S $(HDRS) Makefile
- $(CC) $(CFLAGS) $(AFLAGS) -c $< -o $@
+ $(CC) $(AFLAGS) -c $< -o $@
%.i: %.c $(HDRS) Makefile
$(CPP) $(CFLAGS) $< -o $@
+# -std=gnu{89,99} gets confused by # as an end-of-line comment marker
%.s: %.S $(HDRS) Makefile
- $(CPP) $(CFLAGS) $(AFLAGS) $< -o $@
+ $(CPP) $(AFLAGS) $< -o $@