[PATCH 3/3] build: Restrict scope of per-arch compiler flags

Simon Horman horms at verge.net.au
Sun Dec 23 02:19:18 EST 2012


Restrict the scope of compiler flags set in per-arch Makefiles
to the architecture the Makefile belongs to.

Signed-off-by: Simon Horman <horms at verge.net.au>
---
 Makefile.in             |    4 ++--
 kexec/arch/arm/Makefile |    2 +-
 kexec/arch/ppc/Makefile |    4 ++--
 3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/Makefile.in b/Makefile.in
index 384cf0b..c1859d1 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -45,10 +45,10 @@ TARGET_CFLAGS	= @TARGET_CFLAGS@
 # Base compiler flags. These are extended by the subcomponent-Makefiles
 # where necessary.
 CPPFLAGS	= @CPPFLAGS@ -I$(srcdir)/include -I$(srcdir)/util_lib/include \
-			-Iinclude/
+			-Iinclude/ $($(ARCH)_CPPFLAGS)
 CFLAGS		= @CFLAGS@ -fno-strict-aliasing -Wall -Wstrict-prototypes
 PURGATORY_EXTRA_CFLAGS = @PURGATORY_EXTRA_CFLAGS@
-ASFLAGS		= @ASFLAGS@
+ASFLAGS		= @ASFLAGS@ $($(ARCH)_ASFLAGS)
 LDFLAGS		= @LDFLAGS@
 LIBS		= @LIBS@
 
diff --git a/kexec/arch/arm/Makefile b/kexec/arch/arm/Makefile
index 192e6ec..682db78 100644
--- a/kexec/arch/arm/Makefile
+++ b/kexec/arch/arm/Makefile
@@ -16,7 +16,7 @@ arm_KEXEC_SRCS+= kexec/fs2dt.c
 
 libfdt_SRCS += $(LIBFDT_SRCS:%=kexec/libfdt/%)
 
-CPPFLAGS+=-I$(srcdir)/kexec/libfdt
+arm_CPPFLAGS = -I$(srcdir)/kexec/libfdt
 
 arm_KEXEC_SRCS += $(libfdt_SRCS)
 
diff --git a/kexec/arch/ppc/Makefile b/kexec/arch/ppc/Makefile
index 312c2b9..71871f1 100644
--- a/kexec/arch/ppc/Makefile
+++ b/kexec/arch/ppc/Makefile
@@ -20,11 +20,11 @@ ppc_libfdt_SRCS = kexec/arch/ppc/libfdt-wrapper.c
 libfdt_SRCS += $(LIBFDT_SRCS:%=kexec/libfdt/%)
 ppc_ARCH_REUSE_INITRD =
 
-CPPFLAGS+=-I$(srcdir)/kexec/libfdt
+ppc_CPPFLAGS = -I$(srcdir)/kexec/libfdt
 
 ppc_KEXEC_SRCS += $(libfdt_SRCS) $(ppc_libfdt_SRCS)
 
-ASFLAGS	+= -Wa,--noexecstack
+ppc_ASFLAGS = -Wa,--noexecstack
 
 dist += kexec/arch/ppc/Makefile $(ppc_KEXEC_SRCS)			\
 	kexec/arch/ppc/crashdump-powerpc.h kexec/arch/ppc/fixup_dtb.h	\
-- 
1.7.10.4




More information about the kexec mailing list