[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen-unstable] Tidy makefiles to use CFLAGS-$(foo) idiom instead of ifeq.



# HG changeset patch
# User Tim Deegan <Tim.Deegan@xxxxxxxxxx>
# Date 1299579832 0
# Node ID f071d8e9f744acad4af6ff7fe915878106c0e8d8
# Parent  6183ba4f45e094ad04c48c2663f5104d12e80e0a
Tidy makefiles to use CFLAGS-$(foo) idiom instead of ifeq.

Signed-off-by: Tim Deegan <Tim.Deegan@xxxxxxxxxx>
Acked-by: Keir Fraser <keir@xxxxxxx>
---


diff -r 6183ba4f45e0 -r f071d8e9f744 Config.mk
--- a/Config.mk Mon Mar 07 16:35:49 2011 +0000
+++ b/Config.mk Tue Mar 08 10:23:52 2011 +0000
@@ -23,6 +23,15 @@
 # Allow phony attribute to be listed as dependency rather than fake target
 .PHONY: .phony
 
+# Use Clang/LLVM instead of GCC?
+clang ?= n
+ifeq ($(clang),n)
+gcc := y
+else
+gcc := n
+endif
+
+
 include $(XEN_ROOT)/config/$(XEN_OS).mk
 include $(XEN_ROOT)/config/$(XEN_TARGET_ARCH).mk
 
@@ -148,12 +157,9 @@
 # result of any casted expression causes a warning.
 CFLAGS += -Wno-unused-value
 
-ifeq ($(clang),y)
 # Clang complains about macros that expand to 'if ( ( foo == bar ) ) ...'
-CFLAGS += -Wno-parentheses
-# And is over-zealous with the printf format lint
-CFLAGS += -Wno-format
-endif
+# and is over-zealous with the printf format lint
+CFLAGS-$(clang) += -Wno-parentheses -Wno-format
 
 $(call cc-option-add,HOSTCFLAGS,HOSTCC,-Wdeclaration-after-statement)
 $(call cc-option-add,CFLAGS,CC,-Wdeclaration-after-statement)
diff -r 6183ba4f45e0 -r f071d8e9f744 config/StdGNU.mk
--- a/config/StdGNU.mk  Mon Mar 07 16:35:49 2011 +0000
+++ b/config/StdGNU.mk  Tue Mar 08 10:23:52 2011 +0000
@@ -76,14 +76,10 @@
 else
 # Less than -O1 produces bad code and large stack frames
 CFLAGS += -O1 -fno-omit-frame-pointer
-ifneq ($(clang),y)
-CFLAGS += -fno-optimize-sibling-calls
-endif
+CFLAGS-$(gcc) += -fno-optimize-sibling-calls
 endif
 
 ifeq ($(lto),y)
 CFLAGS += -flto
-ifeq ($(clang),y)
-LDFLAGS += -plugin LLVMgold.so
+LDFLAGS-$(clang) += -plugin LLVMgold.so
 endif
-endif
diff -r 6183ba4f45e0 -r f071d8e9f744 xen/Rules.mk
--- a/xen/Rules.mk      Mon Mar 07 16:35:49 2011 +0000
+++ b/xen/Rules.mk      Tue Mar 08 10:23:52 2011 +0000
@@ -9,7 +9,6 @@
 lock_profile  ?= n
 crash_debug   ?= n
 frame_pointer ?= n
-clang         ?= n
 lto           ?= n
 
 XEN_ROOT=$(BASEDIR)/..
@@ -83,6 +82,8 @@
 # LDFLAGS are only passed directly to $(LD)
 LDFLAGS += $(LDFLAGS_DIRECT)
 
+LDFLAGS += $(LDFLAGS-y)
+
 include Makefile
 
 # Ensure each subdirectory has exactly one trailing slash.
diff -r 6183ba4f45e0 -r f071d8e9f744 xen/arch/x86/Rules.mk
--- a/xen/arch/x86/Rules.mk     Mon Mar 07 16:35:49 2011 +0000
+++ b/xen/arch/x86/Rules.mk     Tue Mar 08 10:23:52 2011 +0000
@@ -14,9 +14,7 @@
 # Solaris grabs stdarg.h and friends from the system include directory.
 # Clang likewise.
 ifneq ($(XEN_OS),SunOS)
-ifneq ($(clang),y)
-CFLAGS += -nostdinc
-endif
+CFLAGS-$(gcc) += -nostdinc
 endif
 
 CFLAGS += -fno-builtin -fno-common -Wredundant-decls
@@ -52,7 +50,7 @@
 x86_64 := y
 endif
 
-ifneq ($(clang),y)
+ifeq ($(gcc),y)
 # Require GCC v3.4+ (to avoid issues with alignment constraints in Xen headers)
 $(call cc-ver-check,CC,0x030400,"Xen requires at least gcc-3.4")
 endif

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.